text
stringlengths 107
2.17M
|
---|
Require Export GeoCoq.Elements.OriginalProofs.lemma_congruencetransitive.
Section Euclid.
Context `{Ax1:euclidean_neutral}.
Lemma lemma_lessthancongruence2 :
forall A B C D E F,
Lt A B C D -> Cong A B E F ->
Lt E F C D.
Proof.
(* Goal: forall (A B C D E F : @Point Ax1) (_ : @Lt Ax1 A B C D) (_ : @Cong Ax1 A B E F), @Lt Ax1 E F C D *)
intros.
(* Goal: @Lt Ax1 E F C D *)
let Tf:=fresh in assert (Tf:exists G, (BetS C G D /\ Cong C G A B)) by (conclude_def Lt );destruct Tf as [G];spliter.
(* Goal: @Lt Ax1 E F C D *)
assert (Cong C G E F) by (conclude lemma_congruencetransitive).
(* Goal: @Lt Ax1 E F C D *)
assert (Lt E F C D) by (conclude_def Lt ).
(* Goal: @Lt Ax1 E F C D *)
close.
Qed.
End Euclid.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_angletrichotomy.
Require Export GeoCoq.Elements.OriginalProofs.proposition_18.
Require Export GeoCoq.Elements.OriginalProofs.lemma_trichotomy1.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma proposition_19 :
forall A B C,
Triangle A B C -> LtA B C A A B C ->
Lt A B A C.
Proof.
(* Goal: forall (A B C : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @LtA Ax0 B C A A B C), @Lt Ax0 A B A C *)
intros.
(* Goal: @Lt Ax0 A B A C *)
assert (nCol A B C) by (conclude_def Triangle ).
(* Goal: @Lt Ax0 A B A C *)
assert (nCol B C A) by (forward_using lemma_NCorder).
(* Goal: @Lt Ax0 A B A C *)
assert (nCol A C B) by (forward_using lemma_NCorder).
(* Goal: @Lt Ax0 A B A C *)
assert (~ Cong A C A B).
(* Goal: @Lt Ax0 A B A C *)
(* Goal: not (@Cong Ax0 A C A B) *)
{
(* Goal: not (@Cong Ax0 A C A B) *)
intro.
(* Goal: False *)
assert (Cong A B A C) by (conclude lemma_congruencesymmetric).
(* Goal: False *)
assert (isosceles A B C) by (conclude_def isosceles ).
(* Goal: False *)
assert (CongA A B C A C B) by (conclude proposition_05).
(* Goal: False *)
assert (CongA A C B A B C) by (conclude lemma_equalanglessymmetric).
(* Goal: False *)
assert (CongA B C A A C B) by (conclude lemma_ABCequalsCBA).
(* Goal: False *)
assert (CongA B C A A B C) by (conclude lemma_equalanglestransitive).
(* Goal: False *)
assert (LtA B C A B C A) by (conclude lemma_angleorderrespectscongruence).
(* Goal: False *)
assert (~ LtA B C A B C A) by (conclude lemma_angletrichotomy).
(* Goal: False *)
contradict.
(* BG Goal: @Lt Ax0 A B A C *)
}
(* Goal: @Lt Ax0 A B A C *)
assert (~ Lt A C A B).
(* Goal: @Lt Ax0 A B A C *)
(* Goal: not (@Lt Ax0 A C A B) *)
{
(* Goal: not (@Lt Ax0 A C A B) *)
intro.
(* Goal: False *)
assert (Triangle A C B) by (conclude_def Triangle ).
(* Goal: False *)
assert (LtA C B A A C B) by (conclude proposition_18).
(* Goal: False *)
assert (CongA A B C C B A) by (conclude lemma_ABCequalsCBA).
(* Goal: False *)
assert (LtA A B C A C B) by (conclude lemma_angleorderrespectscongruence2).
(* Goal: False *)
assert (CongA B C A A C B) by (conclude lemma_ABCequalsCBA).
(* Goal: False *)
assert (LtA A B C B C A) by (conclude lemma_angleorderrespectscongruence).
(* Goal: False *)
assert (~ LtA A B C B C A) by (conclude lemma_angletrichotomy).
(* Goal: False *)
contradict.
(* BG Goal: @Lt Ax0 A B A C *)
}
(* Goal: @Lt Ax0 A B A C *)
assert (CongA A B C A B C) by (conclude lemma_equalanglesreflexive).
(* Goal: @Lt Ax0 A B A C *)
assert (neq A B) by (forward_using lemma_angledistinct).
(* Goal: @Lt Ax0 A B A C *)
assert (neq A C) by (forward_using lemma_angledistinct).
(* Goal: @Lt Ax0 A B A C *)
assert (~ ~ Lt A B A C).
(* Goal: @Lt Ax0 A B A C *)
(* Goal: not (not (@Lt Ax0 A B A C)) *)
{
(* Goal: not (not (@Lt Ax0 A B A C)) *)
intro.
(* Goal: False *)
assert (Cong A B A C) by (conclude lemma_trichotomy1).
(* Goal: False *)
assert (Cong A C A B) by (conclude lemma_congruencesymmetric).
(* Goal: False *)
contradict.
(* BG Goal: @Lt Ax0 A B A C *)
}
(* Goal: @Lt Ax0 A B A C *)
close.
Qed.
End Euclid.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrbool ssrfun eqtype ssrnat seq path div choice.
From mathcomp
Require Import fintype tuple finfun bigop prime ssralg poly finset.
From mathcomp
Require Import fingroup morphism perm automorphism quotient action finalg zmodp.
From mathcomp
Require Import commutator cyclic center pgroup sylow gseries nilpotent abelian.
From mathcomp
Require Import ssrnum ssrint polydiv rat matrix mxalgebra intdiv mxpoly.
From mathcomp
Require Import vector falgebra fieldext separable galois algC cyclotomic algnum.
From mathcomp
Require Import mxrepresentation classfun character.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GroupScope GRing.Theory Num.Theory.
Local Open Scope ring_scope.
Lemma group_num_field_exists (gT : finGroupType) (G : {group gT}) :
{Qn : splittingFieldType rat & galois 1 {:Qn} &
{QnC : {rmorphism Qn -> algC}
& forall nuQn : argumentType (mem ('Gal({:Qn}%VS / 1%VS))),
{nu : {rmorphism algC -> algC} |
{morph QnC: a / nuQn a >-> nu a}}
& {w : Qn & #|G|.-primitive_root w /\ <<1; w>>%VS = fullv
Section GenericClassSums.
Variable (gT : finGroupType) (G : {group gT}) (F : fieldType).
Definition gring_classM_coef_set (Ki Kj : {set gT}) g :=
[set xy in [predX Ki & Kj] | let: (x, y) := xy in x * y == g]%g.
Definition gring_classM_coef (i j k : 'I_#|classes G|) :=
#|gring_classM_coef_set (enum_val i) (enum_val j) (repr (enum_val k))|.
Definition gring_class_sum (i : 'I_#|classes G|) := gset_mx F G (enum_val i).
Local Notation "''K_' i" := (gring_class_sum i)
(at level 8, i at level 2, format "''K_' i") : ring_scope.
Local Notation a := gring_classM_coef.
Lemma gring_class_sum_central i : ('K_i \in 'Z(group_ring F G))%MS.
Proof.
(* Goal: is_true (@submx F (S O) (expn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (S O))) (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 G))))) (@mxvec (GRing.Zmodule.sort (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (gring_class_sum i)) (@center_mx F (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@group_ring (GRing.Field.comUnitRingType F) gT G))) *)
by rewrite -classg_base_center (eq_row_sub i) // rowK.
Qed.
Lemma set_gring_classM_coef (i j k : 'I_#|classes G|) g :
g \in enum_val k ->
a i j k = #|gring_classM_coef_set (enum_val i) (enum_val j) g|.
Theorem gring_classM_expansion i j : 'K_i *m 'K_j = \sum_k (a i j k)%:R *: 'K_k.
Proof.
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (gring_class_sum i) (gring_class_sum j)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
have [/imsetP[zi Gzi dKi] /imsetP[zj Gzj dKj]] := (enum_valP i, enum_valP j).
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (gring_class_sum i) (gring_class_sum j)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
pose aG := regular_repr F G; have sKG := subsetP (class_subG _ (subxx G)).
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (gring_class_sum i) (gring_class_sum j)) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
transitivity (\sum_(x in zi ^: G) \sum_(y in zj ^: G) aG (x * y)%g).
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (gring_class_sum i) (gring_class_sum j)) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))))) *)
rewrite mulmx_suml -/aG dKi; apply: eq_bigr => x /sKG Gx.
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG x) (gring_class_sum j)) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))) *)
rewrite mulmx_sumr -/aG dKj; apply: eq_bigr => y /sKG Gy.
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG x) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG y)) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)) *)
by rewrite repr_mxM ?Gx ?Gy.
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
pose h2 xy : gT := (xy.1 * xy.2)%g.
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
pose h1 xy := enum_rank_in (classes1 G) (h2 xy ^: G).
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@BigOp.bigop (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (index_enum (FinGroup.finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (Finite.sort (FinGroup.finType (FinGroup.base gT))) y (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) 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 zj (@gval gT G))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) aG (@mulg (FinGroup.base gT) x y)))))) (@BigOp.bigop (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun k : Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) => @BigBody (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))))) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) k (@GRing.add (@GRing.Zmodule.Pack (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.base (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@GRing.Lmodule.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@GRing.Lmodule.class (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)))) *)
rewrite pair_big (partition_big h1 xpredT) //=; apply: eq_bigr => k _.
(* Goal: @eq (matrix (GRing.Field.sort F) (@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))))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (fun i : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) i (@GRing.add (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 i) k)) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i))))) (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@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))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)) *)
rewrite (partition_big h2 (mem (enum_val k))) /= => [|[x y]]; last first.
(* Goal: @eq (matrix (GRing.Field.sort F) (@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))))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (FinGroup.arg_sort (FinGroup.base gT)) j (@GRing.add (matrix_zmodType (GRing.Field.zmodType F) (@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)))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) j (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) k)))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (fun i : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) i (@GRing.add (matrix_zmodType (GRing.Field.zmodType F) (@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)))))) (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 i) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 i) j)) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i))))))) (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@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))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)) *)
(* Goal: forall _ : is_true (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) k)), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (h2 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) k)))) *)
case/andP=> /andP[/= /sKG Gx /sKG Gy] /eqP <-.
(* Goal: @eq (matrix (GRing.Field.sort F) (@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))))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (FinGroup.arg_sort (FinGroup.base gT)) j (@GRing.add (matrix_zmodType (GRing.Field.zmodType F) (@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)))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) j (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) k)))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (fun i : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) i (@GRing.add (matrix_zmodType (GRing.Field.zmodType F) (@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)))))) (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 i) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 i) j)) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i))))))) (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@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))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)) *)
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (h2 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) (h1 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)))))) *)
by rewrite enum_rankK_in ?class_refl ?mem_classes ?groupM ?Gx ?Gy.
(* Goal: @eq (matrix (GRing.Field.sort F) (@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))))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (FinGroup.arg_sort (FinGroup.base gT)) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun j : FinGroup.arg_sort (FinGroup.base gT) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (FinGroup.arg_sort (FinGroup.base gT)) j (@GRing.add (matrix_zmodType (GRing.Field.zmodType F) (@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)))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) j (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@enum_val (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) k)))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (fun i : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) i (@GRing.add (matrix_zmodType (GRing.Field.zmodType F) (@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)))))) (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 i) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 i) j)) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i))))))) (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@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))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F))) (gring_classM_coef i j k)) (gring_class_sum k)) *)
rewrite scaler_sumr; apply: eq_bigr => g Kk_g; rewrite scaler_nat.
(* Goal: @eq (matrix (GRing.Field.sort F) (@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))))) (@BigOp.bigop (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) (GRing.zero (matrix_zmodType (GRing.ComUnitRing.zmodType (GRing.Field.comUnitRingType F)) (@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)))))) (index_enum (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (fun i : prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) => @BigBody (matrix (GRing.Field.sort F) (@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))))) (prod (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT))) i (@GRing.add (matrix_zmodType (GRing.Field.zmodType F) (@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)))))) (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 i) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 i) g)) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) i))))) (@GRing.natmul (@GRing.Lmodule.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (Phant (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)))) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType F)) (@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)))))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType F) gT G) g) (gring_classM_coef i j k)) *)
rewrite (set_gring_classM_coef _ _ Kk_g) -sumr_const; apply: eq_big => [] [x y].
(* Goal: forall _ : is_true (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) g)), @eq (matrix (GRing.Field.sort F) (@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))))) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType F) gT G) g) *)
(* Goal: @eq bool (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) g)) (@in_mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y) (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT))) (gring_classM_coef_set (@enum_val (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))) i) (@enum_val (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))) j) g)))) *)
rewrite !inE /= dKi dKj /h1 /h2 /=; apply: andb_id2r => /eqP ->.
(* Goal: forall _ : is_true (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) g)), @eq (matrix (GRing.Field.sort F) (@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))))) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType F) gT G) g) *)
(* Goal: @eq bool (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) x (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) y (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (@enum_rank_in (set_of_finType (FinGroup.finType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) (@classes1 gT G) (@class gT g (@gval gT G))) k)) (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)) (@class gT zi (@gval gT G))))) (@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)) (@class gT zj (@gval gT G)))))) *)
have /imsetP[zk Gzk dKk] := enum_valP k; rewrite dKk in Kk_g.
(* Goal: forall _ : is_true (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) g)), @eq (matrix (GRing.Field.sort F) (@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))))) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType F) gT G) g) *)
(* Goal: @eq bool (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) x (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) y (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (@enum_rank_in (set_of_finType (FinGroup.finType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) (@classes1 gT G) (@class gT g (@gval gT G))) k)) (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)) (@class gT zi (@gval gT G))))) (@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)) (@class gT zj (@gval gT G)))))) *)
by rewrite (class_eqP Kk_g) -dKk enum_valK_in eqxx andbT.
(* Goal: forall _ : is_true (andb (andb (andb (@in_mem (FinGroup.sort (FinGroup.base gT)) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zi (@gval gT G))))) (@in_mem (FinGroup.sort (FinGroup.base gT)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@class gT zj (@gval gT G)))))) (@eq_op (Finite.eqType (@subFinType_finType nat_choiceType (fun x : nat => leq (S x) (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x0 : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x0)))) (ordinal_subFinType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (fun x : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)) x)))))) (h1 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) k)) (@eq_op (Finite.eqType (FinGroup.arg_finType (FinGroup.base gT))) (h2 (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) g)), @eq (matrix (GRing.Field.sort F) (@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))))) (@regular_mx (GRing.Field.comUnitRingType F) gT G (@mulg (FinGroup.base gT) (@fst (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)) (@snd (FinGroup.sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@pair (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base gT)) x y)))) (@repr_mx (GRing.Field.comUnitRingType F) gT (@gval gT G) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType F) gT G) g) *)
by rewrite /h2 /= => /andP[_ /eqP->].
Qed.
Definition gring_irr_mode_def (i : Iirr G) := ('chi_i 1%g)^-1 *: 'chi_i.
Definition gring_irr_mode := locked_with gring_irr_mode_key gring_irr_mode_def.
Canonical gring_irr_mode_unlockable := [unlockable fun gring_irr_mode].
End GenericClassSums.
Arguments gring_irr_mode {gT G%G} i%R _%g : extra scopes.
Notation "''K_' i" := (gring_class_sum _ i)
(at level 8, i at level 2, format "''K_' i") : ring_scope.
Notation "''omega_' i [ A ]" := (xcfun (gring_irr_mode i) A)
(at level 8, i at level 2, format "''omega_' i [ A ]") : ring_scope.
Section IntegralChar.
Variables (gT : finGroupType) (G : {group gT}).
Lemma Aint_char (chi : 'CF(G)) x : chi \is a character -> chi x \in Aint.
Lemma Aint_irr i x : 'chi[G]_i x \in Aint.
Proof.
(* Goal: is_true (@in_mem 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)) i) x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
exact/Aint_char/irr_char.
Qed.
Local Notation R_G := (group_ring algCfield G).
Local Notation a := gring_classM_coef.
Lemma mx_irr_gring_op_center_scalar n (rG : mx_representation algCfield G n) A :
mx_irreducible rG -> (A \in 'Z(R_G))%MS -> is_scalar_mx (gring_op rG A).
Proof.
(* Goal: forall (_ : @mx_irreducible Algebraics.Implementation.fieldType gT G n rG) (_ : is_true (@submx Algebraics.Implementation.fieldType (S O) (expn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (S O))) (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 G))))) (@mxvec (GRing.Field.sort Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A) (@center_mx Algebraics.Implementation.fieldType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@group_ring (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G)))), is_true (@is_scalar_mx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType)) n (@gring_op (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G n rG A)) *)
move/groupC=> irrG /center_mxP[R_A cGA].
(* Goal: is_true (@is_scalar_mx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType)) n (@gring_op (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G n rG A)) *)
apply: mx_abs_irr_cent_scalar irrG _ _; apply/centgmxP => x Gx.
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))))) n n) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x)))) n n n (@gring_op (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G n rG A) (@repr_mx (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))) gT (@gval gT G) n rG x)) (@mulmx (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x)))) n n n (@repr_mx (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))) gT (@gval gT G) n rG x) (@gring_op (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G n rG A)) *)
by rewrite -(gring_opG rG Gx) -!gring_opM ?cGA // envelop_mx_id.
Qed.
Section GringIrrMode.
Variable i : Iirr G.
Let n := irr_degree (socle_of_Iirr i).
Let mxZn_inj: injective (@scalar_mx algCfield n).
Proof.
(* Goal: @injective (matrix (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) n n) (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType Algebraics.Implementation.fieldType))) (@scalar_mx (GRing.Field.ringType Algebraics.Implementation.fieldType) n) *)
by rewrite -[n]prednK ?irr_degree_gt0 //; apply: fmorph_inj.
Qed.
Lemma cfRepr_gring_center n1 (rG : mx_representation algCfield G n1) A :
cfRepr rG = 'chi_i -> (A \in 'Z(R_G))%MS -> gring_op rG A = 'omega_i[A]%:M.
Lemma irr_gring_center A :
(A \in 'Z(R_G))%MS -> gring_op 'Chi_i A = 'omega_i[A]%:M.
Proof.
(* Goal: forall _ : is_true (@submx Algebraics.Implementation.fieldType (S O) (expn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (S O))) (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 G))))) (@mxvec (GRing.Field.sort Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A) (@center_mx Algebraics.Implementation.fieldType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@group_ring (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G))), @eq (matrix (GRing.Ring.sort (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType (GRing.DecidableField.fieldType Algebraics.Implementation.decFieldType)))) (@irr_degree (GRing.DecidableField.fieldType Algebraics.Implementation.decFieldType) gT G (@DecSocleType Algebraics.Implementation.decFieldType gT G (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))) gT G)) (@socle_of_Iirr gT G i)) (@irr_degree (GRing.DecidableField.fieldType Algebraics.Implementation.decFieldType) gT G (@DecSocleType Algebraics.Implementation.decFieldType gT G (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))) gT G)) (@socle_of_Iirr gT G i))) (@gring_op (GRing.Field.comUnitRingType (GRing.DecidableField.fieldType Algebraics.Implementation.decFieldType)) gT G (@irr_degree (GRing.DecidableField.fieldType Algebraics.Implementation.decFieldType) gT G (@DecSocleType Algebraics.Implementation.decFieldType gT G (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))) gT G)) (@socle_of_Iirr gT G i)) (@irr_repr (GRing.DecidableField.fieldType Algebraics.Implementation.decFieldType) gT G (@DecSocleType Algebraics.Implementation.decFieldType gT G (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))) gT G)) (@socle_of_Iirr gT G i)) A) (@scalar_mx (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType) (@irr_degree (GRing.DecidableField.fieldType Algebraics.Implementation.decFieldType) gT G (@DecSocleType Algebraics.Implementation.decFieldType gT G (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@regular_repr (GRing.Field.comUnitRingType (@GRing.Field.clone Algebraics.Implementation.type Algebraics.Implementation.fieldType (GRing.Field.class Algebraics.Implementation.fieldType) (fun x : phantom (GRing.Field.class_of (GRing.Field.sort Algebraics.Implementation.fieldType)) (GRing.Field.class Algebraics.Implementation.fieldType) => x))) gT G)) (@socle_of_Iirr gT G i)) (@xcfun gT G (@gring_irr_mode gT G i) A)) *)
exact: cfRepr_gring_center (irrRepr i).
Qed.
Lemma gring_irr_modeM A B :
(A \in 'Z(R_G))%MS -> (B \in 'Z(R_G))%MS ->
'omega_i[A *m B] = 'omega_i[A] * 'omega_i[B].
Proof.
(* Goal: forall (_ : is_true (@submx Algebraics.Implementation.fieldType (S O) (expn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (S O))) (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 G))))) (@mxvec (GRing.Field.sort Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A) (@center_mx Algebraics.Implementation.fieldType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@group_ring (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G)))) (_ : is_true (@submx Algebraics.Implementation.fieldType (S O) (expn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (S O))) (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 G))))) (@mxvec (GRing.Field.sort Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) B) (@center_mx Algebraics.Implementation.fieldType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@group_ring (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G)))), @eq (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A B)) (@GRing.mul (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType) (@xcfun gT G (@gring_irr_mode gT G i) A) (@xcfun gT G (@gring_irr_mode gT G i) B)) *)
move=> Z_A Z_B; have [[R_A cRA] [R_B cRB]] := (center_mxP Z_A, center_mxP Z_B).
(* Goal: @eq (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A B)) (@GRing.mul (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType) (@xcfun gT G (@gring_irr_mode gT G i) A) (@xcfun gT G (@gring_irr_mode gT G i) B)) *)
apply: mxZn_inj; rewrite scalar_mxM -!irr_gring_center ?gring_opM //.
(* Goal: is_true (@submx Algebraics.Implementation.fieldType (S O) (expn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (S O))) (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 G))))) (@mxvec (GRing.Field.sort Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A B)) (@center_mx Algebraics.Implementation.fieldType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@group_ring (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType) gT G))) *)
apply/center_mxP; split=> [|C R_C]; first exact: envelop_mxM.
(* Goal: @eq (matrix (GRing.Ring.sort (GRing.Field.ringType Algebraics.Implementation.fieldType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) C (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A B)) (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) A B) C) *)
by rewrite mulmxA cRA // -!mulmxA cRB.
Qed.
Lemma gring_mode_class_sum_eq (k : 'I_#|classes G|) g :
g \in enum_val k -> 'omega_i['K_k] = #|g ^: G|%:R * 'chi_i g / 'chi_i 1%g.
Lemma Aint_gring_mode_class_sum k : 'omega_i['K_k] \in Aint.
Proof.
(* Goal: is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
move: k; pose X := [tuple 'omega_i['K_k] | k < #|classes G| ].
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
have memX k: 'omega_i['K_k] \in X by apply: image_f.
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
have S_P := Cint_spanP X; set S := Cint_span X in S_P.
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
have S_X: {subset X <= S} by apply: mem_Cint_span.
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
have S_1: 1 \in S.
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
(* Goal: is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) S)) *)
apply: S_X; apply/codomP; exists (enum_rank_in (classes1 G) 1%g).
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
(* Goal: @eq (Equality.sort (GRing.Ring.eqType (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType))) (GRing.one Algebraics.Implementation.ringType) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType (@enum_rank_in (set_of_finType (FinGroup.finType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))) (@classes1 gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) *)
rewrite (@gring_mode_class_sum_eq _ 1%g) ?enum_rankK_in ?classes1 //.
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
(* Goal: @eq (Equality.sort (GRing.Ring.eqType (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType))) (GRing.one Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@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)) (@class gT (oneg (FinGroup.base gT)) (@gval gT G)))))) (@fun_of_cfun gT (@gval gT G) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (oneg (FinGroup.base gT)))) (@GRing.inv Algebraics.Implementation.unitRingType (@fun_of_cfun gT (@gval gT G) (@tnth (Datatypes.S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) i) (oneg (FinGroup.base gT))))) *)
by rewrite mulfK ?irr1_neq0 // class1G cards1.
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
suffices Smul: mulr_closed S.
(* Goal: @GRing.mulr_closed Algebraics.Implementation.ringType S *)
(* Goal: forall k : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))), is_true (@in_mem (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
by move=> k; apply: fin_Csubring_Aint S_P _ _; rewrite ?S_X.
(* Goal: @GRing.mulr_closed Algebraics.Implementation.ringType S *)
split=> // _ _ /S_P[x ->] /S_P[y ->].
(* Goal: is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun i : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) i (@GRing.add Algebraics.Implementation.zmodType) true (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) X) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@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)))))) int x i)))) (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun i : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) i (@GRing.add Algebraics.Implementation.zmodType) true (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) X) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@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)))))) int y i))))) (@mem (GRing.Ring.sort Algebraics.Implementation.ringType) (predPredType (GRing.Ring.sort Algebraics.Implementation.ringType)) S)) *)
rewrite mulr_sumr rpred_sum // => j _.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.mul Algebraics.Implementation.ringType (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (ordinal_finType (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))))) (fun i : ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (ordinal (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G)))))) i (@GRing.add Algebraics.Implementation.zmodType) true (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) X) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@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)))))) int x i)))) (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) X) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) j)) (@FunFinfun.fun_of_fin (exp_finIndexType (@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)))))) int y j))) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.add_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (Cint_span_addrPred (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X))) (Cint_span_keyed (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X))))) *)
rewrite mulrzAr mulr_suml rpredMz ?rpred_sum // => k _.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.mul Algebraics.Implementation.ringType (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) X) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) k)) (@FunFinfun.fun_of_fin (exp_finIndexType (@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)))))) int x k)) (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) X) (@nat_of_ord (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) j))) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.add_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.zmod_add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (Cint_span_zmodPred (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)))) (Cint_span_keyed (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X))))) *)
rewrite mulrzAl rpredMz {x y}// !nth_mktuple.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.mul Algebraics.Implementation.ringType (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType k)) (@xcfun gT G (@gring_irr_mode gT G i) (@gring_class_sum gT G Algebraics.Implementation.fieldType j))) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.opp_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.zmod_opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (Cint_span_zmodPred (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)))) (Cint_span_keyed (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X))))) *)
rewrite -gring_irr_modeM ?gring_class_sum_central //.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@xcfun gT G (@gring_irr_mode gT G i) (@mulmx (GRing.Field.ringType Algebraics.Implementation.fieldType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@gring_class_sum gT G Algebraics.Implementation.fieldType k) (@gring_class_sum gT G Algebraics.Implementation.fieldType j))) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.opp_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.zmod_opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (Cint_span_zmodPred (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)))) (Cint_span_keyed (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X))))) *)
rewrite gring_classM_expansion raddf_sum rpred_sum // => jk _.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.Additive.apply (matrix_zmodType (GRing.ComUnitRing.zmodType Algebraics.Implementation.comUnitRingType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (GRing.Ring.zmodType (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) (Phant (forall _ : GRing.Zmodule.sort (matrix_zmodType (GRing.ComUnitRing.zmodType Algebraics.Implementation.comUnitRingType) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)))) (@xcfun_additive gT G (@gring_irr_mode gT G i)) (@GRing.scale (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType)) (matrix_lmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType))) (GRing.one (GRing.ComUnitRing.ringType (GRing.Field.comUnitRingType Algebraics.Implementation.fieldType))) (@gring_classM_coef gT G k j jk)) (@gring_class_sum gT G Algebraics.Implementation.fieldType jk))) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.add_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (@GRing.Pred.zmod_add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Cint_span (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)) (Cint_span_zmodPred (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X)))) (Cint_span_keyed (@tval (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (GRing.Ring.sort (GRing.ComUnitRing.ringType Algebraics.Implementation.comUnitRingType)) X))))) *)
by rewrite scaler_nat raddfMn rpredMn ?S_X ?memX.
Qed.
Corollary Aint_class_div_irr1 x :
x \in G -> #|x ^: G|%:R * 'chi_i x / 'chi_i 1%g \in Aint.
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 (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@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)) (@class gT x (@gval gT G)))))) (@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) x)) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
move=> Gx; have clGxG := mem_classes Gx; pose k := enum_rank_in clGxG (x ^: G).
(* Goal: is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@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)) (@class gT x (@gval gT G)))))) (@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) x)) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
have k_x: x \in enum_val k by rewrite enum_rankK_in // class_refl.
(* Goal: is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@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)) (@class gT x (@gval gT G)))))) (@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) x)) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
by rewrite -(gring_mode_class_sum_eq k_x) Aint_gring_mode_class_sum.
Qed.
Theorem coprime_degree_support_cfcenter g :
coprime (truncC ('chi_i 1%g)) #|g ^: G| -> g \notin ('Z('chi_i))%CF ->
'chi_i g = 0.
End GringIrrMode.
Theorem primes_class_simple_gt1 C :
simple G -> ~~ abelian G -> C \in (classes G)^# -> (size (primes #|C|) > 1)%N.
End IntegralChar.
Section MoreIntegralChar.
Implicit Type gT : finGroupType.
Theorem Burnside_p_a_q_b gT (G : {group gT}) :
(size (primes #|G|) <= 2)%N -> solvable G.
Proof.
(* Goal: forall _ : is_true (leq (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (S (S O))), is_true (@solvable gT (@gval gT G)) *)
move: {2}_.+1 (ltnSn #|G|) => n; elim: n => // n IHn in gT G *.
rewrite ltnS => leGn piGle2; have [simpleG | ] := boolP (simple G); last first.
rewrite negb_forall_in => /exists_inP[N sNG]; rewrite eq_sym.
have [-> | ] := altP (N =P G).
rewrite groupP /= genGid normG andbT eqb_id negbK => /eqP->.
exact: solvable1.
rewrite [N == G]eqEproper sNG eqbF_neg !negbK => ltNG /and3P[grN].
case/isgroupP: grN => {N}N -> in sNG ltNG *; rewrite /= genGid => ntN nNG.
have nsNG: N <| G by apply/andP.
have dv_le_pi m: (m %| #|G| -> size (primes m) <= 2)%N.
(* Goal: forall _ : is_true (leq (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (S (S O))), is_true (@solvable gT (@gval gT G)) *)
(* Goal: forall _ : is_true (dvdn m (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), is_true (leq (@size nat (primes m)) (S (S O))) *)
move=> m_dv_G; apply: leq_trans piGle2.
by rewrite uniq_leq_size ?primes_uniq //; apply: pi_of_dvd.
rewrite (series_sol nsNG) !IHn ?dv_le_pi ?cardSg ?dvdn_quotient //.
by apply: leq_trans leGn; apply: ltn_quotient.
by apply: leq_trans leGn; apply: proper_card.
have [->|[p p_pr p_dv_G]] := trivgVpdiv G; first exact: solvable1.
have piGp: p \in \pi(G) by rewrite mem_primes p_pr cardG_gt0.
have [P sylP] := Sylow_exists p G; have [sPG pP p'GP] := and3P sylP.
have ntP: P :!=: 1%g by rewrite -rank_gt0 (rank_Sylow sylP) p_rank_gt0.
have /trivgPn[g /setIP[Pg cPg] nt_g]: 'Z(P) != 1%g.
by rewrite center_nil_eq1 // (pgroup_nil pP).
apply: abelian_sol; have: (size (primes #|g ^: G|) <= 1)%N.
rewrite -ltnS -[_.+1]/(size (p :: _)) (leq_trans _ piGle2) //.
rewrite -index_cent1 uniq_leq_size // => [/= | q].
rewrite primes_uniq -p'natEpi ?(pnat_dvd _ p'GP) ?indexgS //.
by rewrite subsetI sPG sub_cent1.
by rewrite inE => /predU1P[-> // |]; apply: pi_of_dvd; rewrite ?dvdn_indexg.
rewrite leqNgt; apply: contraR => /primes_class_simple_gt1-> //.
by rewrite !inE classG_eq1 nt_g mem_classes // (subsetP sPG).
Qed.
Qed.
Theorem dvd_irr1_cardG gT (G : {group gT}) i : ('chi[G]_i 1%g %| #|G|)%C.
Proof.
(* Goal: is_true (@in_mem Algebraics.divisor (Algebraics.Internals.nat_divisor (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (dvdC (@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)))))) *)
rewrite unfold_in -if_neg irr1_neq0 Cint_rat_Aint //=.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (Algebraics.Internals.nat_divisor (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (Algebraics.Internals.nat_divisor (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Crat)) *)
by rewrite rpred_div ?rpred_nat // rpred_Cnat ?Cnat_irr1.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (Algebraics.Internals.nat_divisor (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
rewrite -[n in n / _]/(_ *+ true) -(eqxx i) -mulr_natr.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.mul Algebraics.Implementation.ringType (Algebraics.Internals.nat_divisor (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (nat_of_bool (@eq_op (ordinal_eqType (S (@pred_Nirr gT (@gval gT G)))) i i)))) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
rewrite -first_orthogonality_relation mulVKf ?neq0CG //.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (@GRing.mul Algebraics.Implementation.ringType (@fun_of_cfun gT (@gval gT G) (@tnth (S (@pred_Nirr gT (@gval gT G))) (@classfun gT (@gval gT G)) (@irr gT (@gval gT G)) 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)) i) (@invg (FinGroup.base gT) x))))) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
rewrite sum_by_classes => [|x y Gx Gy]; rewrite -?conjVg ?cfunJ //.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun xG : Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@in_mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) xG (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@classes gT (@gval gT G))))) (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@card (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) xG)))) (@GRing.mul Algebraics.Implementation.ringType (@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) (@repr (FinGroup.base gT) xG)) (@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) (@invg (FinGroup.base gT) (@repr (FinGroup.base gT) xG))))))) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
rewrite mulr_suml rpred_sum // => K /repr_classesP[Gx {1}->].
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.natmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) (@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)) (@class gT (@repr (FinGroup.base gT) K) (@gval gT G)))))) (@GRing.mul Algebraics.Implementation.ringType (@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) (@repr (FinGroup.base gT) K)) (@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) (@invg (FinGroup.base gT) (@repr (FinGroup.base gT) K))))) (@GRing.inv Algebraics.Implementation.unitRingType (@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))))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (@unkey_pred (GRing.Zmodule.sort Algebraics.Implementation.zmodType) Aint (@GRing.Pred.add_key Algebraics.Implementation.zmodType Aint Aint_addrPred) Aint_keyed))) *)
by rewrite !mulrA mulrAC rpredM ?Aint_irr ?Aint_class_div_irr1.
Qed.
Theorem dvd_irr1_index_center gT (G : {group gT}) i :
('chi[G]_i 1%g %| #|G : 'Z('chi_i)%CF|)%C.
Lemma gring_classM_coef_sum_eq gT (G : {group gT}) j1 j2 k g1 g2 g :
let a := @gring_classM_coef gT G j1 j2 in let a_k := a k in
g1 \in enum_val j1 -> g2 \in enum_val j2 -> g \in enum_val k ->
let sum12g := \sum_i 'chi[G]_i g1 * 'chi_i g2 * ('chi_i g)^* / 'chi_i 1%g in
a_k%:R = (#|enum_val j1| * #|enum_val j2|)%:R / #|G|%:R * sum12g.
Lemma index_support_dvd_degree gT (G H : {group gT}) chi :
H \subset G -> chi \is a character -> chi \in 'CF(G, H) ->
(H :==: 1%g) || abelian G ->
(#|G : H| %| chi 1%g)%C.
Theorem faithful_degree_p_part gT (p : nat) (G P : {group gT}) i :
cfaithful 'chi[G]_i -> p.-nat (truncC ('chi_i 1%g)) ->
Lemma sum_norm2_char_generators gT (G : {group gT}) (chi : 'CF(G)) :
let S := [pred s | generator G s] in
chi \is a character -> {in S, forall s, chi s != 0} ->
\sum_(s in S) `|chi s| ^+ 2 >= #|S|%:R.
Theorem nonlinear_irr_vanish gT (G : {group gT}) i :
'chi[G]_i 1%g > 1 -> exists2 x, x \in G & 'chi_i x = 0.
End MoreIntegralChar. |
From mathcomp
Require Import ssreflect ssrbool ssrfun.
From LemmaOverloading
Require Import heaps stmod stsep stlog.
Notation cont A := (ans A -> heap -> Prop).
Section EvalWriteR.
Variables (A B C : Type).
Lemma bnd_writeR s (v : A) (w : C) x h1 h2
(f : Update h1 h2 (x:->v) (x:->w)) (r : cont B) :
verify (s tt) h1 r ->
verify (bind_s (write_s x v) s) h2 r.
Proof.
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (@write_s A x v) s)) h2 r *)
set l := rest f.
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (@write_s A x v) s)) h2 r *)
have H1 : h1 = (x :-> v) :+ l by eapply (update1 f).
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (@write_s A x v) s)) h2 r *)
have H2 : h2 = (x :-> w) :+ l by eapply (update2 f).
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (@write_s A x v) s)) h2 r *)
by rewrite H1 H2; apply: bnd_write.
Qed.
End EvalWriteR.
Section EvalDeallocR.
Variables (A B : Type).
Lemma bnd_deallocR s (v : A) x h1 h2
(f : Update h1 h2 empty (x:->v)) (r : cont B) :
verify (s tt) h1 r ->
verify (bind_s (dealloc_s x) s) h2 r.
Proof.
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (dealloc_s x) s)) h2 r *)
set l := rest f.
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (dealloc_s x) s)) h2 r *)
have H1 : h1 = empty :+ l by eapply (update1 f).
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (dealloc_s x) s)) h2 r *)
have H2 : h2 = (x :-> v) :+ l by eapply (update2 f).
(* Goal: forall _ : @verify' B (@fr B (s tt)) h1 r, @verify' B (@fr B (@bind_s unit B (dealloc_s x) s)) h2 r *)
by rewrite H1 H2 un0h; apply bnd_dealloc.
Qed.
Section EvalDoR.
Variables (A B : Type).
Lemma val_doR (s : spec A) h i (r : cont A) (f : Find1 h i) :
s.1 i ->
Proof.
(* Goal: forall (_ : @fst (rels.Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s i) (_ : forall (x : A) (m : heap) (_ : @snd (rels.Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s (@Val A x) i m) (_ : is_true (def (union2 m (@rest1 h i f)))), r (@Val A x) (union2 m (@rest1 h i f))) (_ : forall (e : exn) (m : heap) (_ : @snd (rels.Pred heap) (forall (_ : ans A) (_ : heap) (_ : heap), Prop) s (@Exn A e) i m) (_ : is_true (def (union2 m (@rest1 h i f)))), r (@Exn A e) (union2 m (@rest1 h i f))), @verify' A (@fr A s) h r *)
move=>H1 H2 H3.
(* Goal: @verify' A (@fr A s) h r *)
generalize (heq1 (h:=h))=>H.
(* Goal: @verify' A (@fr A s) h r *)
rewrite H.
(* Goal: @verify' A (@fr A s) (union2 i (@rest1 h i f)) r *)
by apply: (val_do (i:=i) (j:=rest1)).
Qed.
Example ex_bwd i x1 x2 (e : unit -> spec nat) q:
verify (e tt) (i :+ (x1 :-> 1 :+ x2 :-> 4)) q ->
verify (bind_s (write_s x2 4) e) (i :+ (x1 :-> 1 :+ x2 :-> 2)) q.
move=>H.
by apply: bnd_writeR.
Abort.
Example ex_fwd i x1 x2 (e : unit -> spec nat) q:
verify (e tt) (i :+ (x1 :-> 1 :+ x2 :-> 4)) q ->
verify (bind_s (write_s x2 4) e) (i :+ (x1 :-> 1 :+ x2 :-> 2)) q.
move=>H.
by apply: (bnd_writeR _ H).
Abort.
Example ex_dealloc_bwd i x1 x2 (e : unit -> spec nat) q:
verify (e tt) (i :+ (x1 :-> 1)) q ->
verify (bind_s (dealloc_s x2) e) (i :+ (x1 :-> 1 :+ x2 :-> 2)) q.
move=>H.
by apply: bnd_deallocR; rewrite unh0.
Abort.
|
Require Export GeoCoq.Elements.OriginalProofs.proposition_05.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglesNC.
Require Export GeoCoq.Elements.OriginalProofs.lemma_supplements.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma proposition_05b :
forall A B C F G,
isosceles A B C -> BetS A B F -> BetS A C G ->
CongA C B F B C G.
Proof.
(* Goal: forall (A B C F G : @Point Ax0) (_ : @isosceles Ax0 A B C) (_ : @BetS Ax0 A B F) (_ : @BetS Ax0 A C G), @CongA Ax0 C B F B C G *)
intros.
(* Goal: @CongA Ax0 C B F B C G *)
assert (CongA A B C A C B) by (conclude proposition_05).
(* Goal: @CongA Ax0 C B F B C G *)
assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: @CongA Ax0 C B F B C G *)
assert (nCol A C B) by (conclude lemma_equalanglesNC).
(* Goal: @CongA Ax0 C B F B C G *)
assert (~ eq B C).
(* Goal: @CongA Ax0 C B F B C G *)
(* 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 (Col A C B) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @CongA Ax0 C B F B C G *)
}
(* Goal: @CongA Ax0 C B F B C G *)
assert (neq C B) by (conclude lemma_inequalitysymmetric).
(* Goal: @CongA Ax0 C B F B C G *)
assert (Out B C C) by (conclude lemma_ray4).
(* Goal: @CongA Ax0 C B F B C G *)
assert (Supp A B C C F) by (conclude_def Supp ).
(* Goal: @CongA Ax0 C B F B C G *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @CongA Ax0 C B F B C G *)
assert (Out C B B) by (conclude lemma_ray4).
(* Goal: @CongA Ax0 C B F B C G *)
assert (Supp A C B B G) by (conclude_def Supp ).
(* Goal: @CongA Ax0 C B F B C G *)
assert (CongA C B F B C G) by (conclude lemma_supplements).
(* Goal: @CongA Ax0 C B F B C G *)
close.
Qed.
End Euclid.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_notperp.
Require Export GeoCoq.Elements.OriginalProofs.lemma_pointreflectionisometry.
Require Export GeoCoq.Elements.OriginalProofs.lemma_planeseparation.
Require Export GeoCoq.Elements.OriginalProofs.lemma_oppositesidesymmetric.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma proposition_11B :
forall A B C P,
BetS A C B -> nCol A B P ->
exists X, Per A C X /\ TS X A B P.
Proof.
(* Goal: forall (A B C P : @Point Ax0) (_ : @BetS Ax0 A C B) (_ : @nCol Ax0 A B P), @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
intros.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
let Tf:=fresh in assert (Tf:exists M, (nCol A B M /\ OS M P A B /\ ~ Per A C M)) by (conclude lemma_notperp);destruct Tf as [M];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq A B) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
let Tf:=fresh in assert (Tf:exists Q, Perp_at M Q A B Q) by (conclude proposition_12);destruct Tf as [Q];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
let Tf:=fresh in assert (Tf:exists E, (Col M Q Q /\ Col A B Q /\ Col A B E /\ Per E Q M)) by (conclude_def Perp_at );destruct Tf as [E];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (~ eq M Q).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
(* Goal: not (@eq Ax0 M Q) *)
{
(* Goal: not (@eq Ax0 M Q) *)
intro.
(* Goal: False *)
assert (Col A B M) by (conclude cn_equalitysub).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq Q M) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col A B C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col B A E) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col B A C) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq B A) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (~ eq C Q).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
(* Goal: not (@eq Ax0 C Q) *)
{
(* Goal: not (@eq Ax0 C Q) *)
intro.
(* Goal: False *)
assert (Per E C M) by (conclude cn_equalitysub).
(* Goal: False *)
assert (Col A E C) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col E C A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq A C) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Per A C M) by (conclude lemma_collinearright).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col C Q E) by (conclude lemma_collinear5).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col E Q C) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Per C Q M) by (conclude lemma_collinearright).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq Q C) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
let Tf:=fresh in assert (Tf:exists G, (BetS Q G C /\ Cong G Q G C)) by (conclude proposition_10);destruct Tf as [G];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (~ eq M G).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
(* Goal: not (@eq Ax0 M G) *)
{
(* Goal: not (@eq Ax0 M G) *)
intro.
(* Goal: False *)
assert (BetS Q M C) by (conclude cn_equalitysub).
(* Goal: False *)
assert (Col Q M C) by (conclude_def Col ).
(* Goal: False *)
assert (Col B Q C) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col Q C M) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col Q C B) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq Q C) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col C M B) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col C B M) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col C B A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq C B) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col B M A) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A B M) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
rename_H H;let Tf:=fresh in assert (Tf:exists H, (BetS M G H /\ Cong G H M G)) by (conclude lemma_extension);destruct Tf as [H];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong M G G H) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Midpoint M G H) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong Q G G C) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Midpoint Q G C) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col Q G C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col C Q G) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq Q G) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq G Q) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Per G Q M) by (conclude lemma_collinearright).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
let Tf:=fresh in assert (Tf:exists J, (BetS M Q J /\ Cong Q J M Q)) by (conclude lemma_extension);destruct Tf as [J];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong M Q Q J) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Per M Q G) by (conclude lemma_8_2).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong M G J G) by (conclude lemma_rightreverse).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (BetS J Q M) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong J Q M Q) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong J G M G) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Per J Q G) by (conclude_def Per ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (~ eq J G).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
(* Goal: not (@eq Ax0 J G) *)
{
(* Goal: not (@eq Ax0 J G) *)
intro.
(* Goal: False *)
assert (Col J Q G) by (conclude_def Col ).
(* Goal: False *)
assert (nCol J Q G) by (conclude lemma_rightangleNC).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
let Tf:=fresh in assert (Tf:exists K, (BetS J G K /\ Cong G K J G)) by (conclude lemma_extension);destruct Tf as [K];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong J G G K) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Midpoint J G K) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong M Q H C) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq J Q) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq Q J) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq M J) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong Q J C K) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong M J H K) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (BetS H C K) by (conclude lemma_betweennesspreserved).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H G G M) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong G M J G) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H G J G) by (conclude lemma_congruencetransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong J G G K) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H G G K) by (conclude lemma_congruencetransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H G K G) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq G C) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H C M Q) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong M Q Q J) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H C Q J) by (conclude lemma_congruencetransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H C C K) by (conclude lemma_congruencetransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Cong H C K C) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq G C) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq C G) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Per H C G) by (conclude_def Per ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Per G C H) by (conclude lemma_8_2).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col A B A) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col Q C A) by (conclude lemma_collinear5).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col Q C G) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col C A G) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col G C A) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq A C) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Per A C H) by (conclude lemma_collinearright).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col C A B) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (neq C A) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col A G B) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (Col A B G) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (OS P M A B) by (forward_using lemma_samesidesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (TS M A B H) by (conclude_def TS ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (TS P A B H) by (conclude lemma_planeseparation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
assert (TS H A B P) by (conclude lemma_oppositesidesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => and (@Per Ax0 A C X) (@TS Ax0 X A B P)) *)
close.
Qed.
End Euclid.
|
Require Import Arith.
Require Import Zbase.
Require Import Z_succ_pred.
Require Import Zadd.
Definition leZ (x y : Z) :=
match x return Prop with
| OZ =>
match y return Prop with
| OZ => True
| pos n => True
| neg n => False
end
| pos n =>
match y return Prop with
| OZ => False
| pos m => n <= m
| neg m => False
end
| neg n =>
match y return Prop with
| OZ => True
| pos m => True
| neg m => m <= n
end
end.
Lemma sign_absZ : forall x : Z, leZ OZ (absZ x).
Proof.
(* Goal: forall x : Z, leZ OZ (absZ x) *)
intros; elim x; simpl in |- *.
(* Goal: forall _ : nat, True *)
(* Goal: forall _ : nat, True *)
(* Goal: True *)
exact I.
(* Goal: forall _ : nat, True *)
(* Goal: forall _ : nat, True *)
intro; simpl in |- *.
(* Goal: forall _ : nat, True *)
(* Goal: True *)
exact I.
(* Goal: forall _ : nat, True *)
intro; simpl in |- *.
(* Goal: True *)
exact I.
Qed.
Lemma tech_le_pos_abs : forall x : Z, leZ OZ x -> absZ x = x.
Proof.
(* Goal: forall (x : Z) (_ : leZ OZ x), @eq Z (absZ x) x *)
intro x; elim x.
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)), @eq Z (absZ (neg n)) (neg n) *)
(* Goal: forall (n : nat) (_ : leZ OZ (pos n)), @eq Z (absZ (pos n)) (pos n) *)
(* Goal: forall _ : leZ OZ OZ, @eq Z (absZ OZ) OZ *)
unfold absZ in |- *; reflexivity.
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)), @eq Z (absZ (neg n)) (neg n) *)
(* Goal: forall (n : nat) (_ : leZ OZ (pos n)), @eq Z (absZ (pos n)) (pos n) *)
unfold absZ in |- *; reflexivity.
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)), @eq Z (absZ (neg n)) (neg n) *)
intros; elim H.
Qed.
Theorem leZ_antisymmetric : forall x y : Z, leZ x y -> leZ y x -> x = y.
Proof.
(* Goal: forall (x y : Z) (_ : leZ x y) (_ : leZ y x), @eq Z x y *)
intros x y; elim x.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n : nat) (_ : leZ (pos n) y) (_ : leZ y (pos n)), @eq Z (pos n) y *)
(* Goal: forall (_ : leZ OZ y) (_ : leZ y OZ), @eq Z OZ y *)
elim y.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n : nat) (_ : leZ (pos n) y) (_ : leZ y (pos n)), @eq Z (pos n) y *)
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)) (_ : leZ (neg n) OZ), @eq Z OZ (neg n) *)
(* Goal: forall (n : nat) (_ : leZ OZ (pos n)) (_ : leZ (pos n) OZ), @eq Z OZ (pos n) *)
(* Goal: forall (_ : leZ OZ OZ) (_ : leZ OZ OZ), @eq Z OZ OZ *)
reflexivity.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n : nat) (_ : leZ (pos n) y) (_ : leZ y (pos n)), @eq Z (pos n) y *)
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)) (_ : leZ (neg n) OZ), @eq Z OZ (neg n) *)
(* Goal: forall (n : nat) (_ : leZ OZ (pos n)) (_ : leZ (pos n) OZ), @eq Z OZ (pos n) *)
intros; elim H0.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n : nat) (_ : leZ (pos n) y) (_ : leZ y (pos n)), @eq Z (pos n) y *)
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)) (_ : leZ (neg n) OZ), @eq Z OZ (neg n) *)
intros; elim H.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n : nat) (_ : leZ (pos n) y) (_ : leZ y (pos n)), @eq Z (pos n) y *)
intro n; elim y.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n0 : nat) (_ : leZ (pos n) (neg n0)) (_ : leZ (neg n0) (pos n)), @eq Z (pos n) (neg n0) *)
(* Goal: forall (n0 : nat) (_ : leZ (pos n) (pos n0)) (_ : leZ (pos n0) (pos n)), @eq Z (pos n) (pos n0) *)
(* Goal: forall (_ : leZ (pos n) OZ) (_ : leZ OZ (pos n)), @eq Z (pos n) OZ *)
intros; elim H.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n0 : nat) (_ : leZ (pos n) (neg n0)) (_ : leZ (neg n0) (pos n)), @eq Z (pos n) (neg n0) *)
(* Goal: forall (n0 : nat) (_ : leZ (pos n) (pos n0)) (_ : leZ (pos n0) (pos n)), @eq Z (pos n) (pos n0) *)
simpl in |- *; intros; elim (le_antisym n n0 H H0); reflexivity.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
(* Goal: forall (n0 : nat) (_ : leZ (pos n) (neg n0)) (_ : leZ (neg n0) (pos n)), @eq Z (pos n) (neg n0) *)
intros; elim H.
(* Goal: forall (n : nat) (_ : leZ (neg n) y) (_ : leZ y (neg n)), @eq Z (neg n) y *)
intro n; elim y.
(* Goal: forall (n0 : nat) (_ : leZ (neg n) (neg n0)) (_ : leZ (neg n0) (neg n)), @eq Z (neg n) (neg n0) *)
(* Goal: forall (n0 : nat) (_ : leZ (neg n) (pos n0)) (_ : leZ (pos n0) (neg n)), @eq Z (neg n) (pos n0) *)
(* Goal: forall (_ : leZ (neg n) OZ) (_ : leZ OZ (neg n)), @eq Z (neg n) OZ *)
intros; elim H0.
(* Goal: forall (n0 : nat) (_ : leZ (neg n) (neg n0)) (_ : leZ (neg n0) (neg n)), @eq Z (neg n) (neg n0) *)
(* Goal: forall (n0 : nat) (_ : leZ (neg n) (pos n0)) (_ : leZ (pos n0) (neg n)), @eq Z (neg n) (pos n0) *)
intros; elim H0.
(* Goal: forall (n0 : nat) (_ : leZ (neg n) (neg n0)) (_ : leZ (neg n0) (neg n)), @eq Z (neg n) (neg n0) *)
simpl in |- *; intros; elim (le_antisym n0 n H H0); reflexivity.
Qed.
Definition ltZ (x y : Z) := leZ (succZ x) y.
Definition lt_absZ (x y : Z) := ltZ (absZ x) (absZ y).
Lemma tech_lt_abs_OZ : forall x : Z, lt_absZ x (pos 0) -> x = OZ.
Proof.
(* Goal: forall (x : Z) (_ : lt_absZ x (pos O)), @eq Z x OZ *)
simple induction x.
(* Goal: forall (n : nat) (_ : lt_absZ (neg n) (pos O)), @eq Z (neg n) OZ *)
(* Goal: forall (n : nat) (_ : lt_absZ (pos n) (pos O)), @eq Z (pos n) OZ *)
(* Goal: forall _ : lt_absZ OZ (pos O), @eq Z OZ OZ *)
reflexivity.
(* Goal: forall (n : nat) (_ : lt_absZ (neg n) (pos O)), @eq Z (neg n) OZ *)
(* Goal: forall (n : nat) (_ : lt_absZ (pos n) (pos O)), @eq Z (pos n) OZ *)
unfold lt_absZ in |- *; unfold absZ in |- *; unfold ltZ in |- *; unfold leZ in |- *; intros.
(* Goal: forall (n : nat) (_ : lt_absZ (neg n) (pos O)), @eq Z (neg n) OZ *)
(* Goal: @eq Z (pos n) OZ *)
elim (le_Sn_O n H).
(* Goal: forall (n : nat) (_ : lt_absZ (neg n) (pos O)), @eq Z (neg n) OZ *)
unfold lt_absZ in |- *; unfold absZ in |- *; unfold ltZ in |- *; unfold leZ in |- *; intros.
(* Goal: @eq Z (neg n) OZ *)
elim (le_Sn_O n H).
Qed.
Lemma tech_posOZ_pos : forall n : nat, leZ OZ (posOZ n).
Proof.
(* Goal: forall n : nat, leZ OZ (posOZ n) *)
intros; elim n.
(* Goal: forall (n : nat) (_ : leZ OZ (posOZ n)), leZ OZ (posOZ (S n)) *)
(* Goal: leZ OZ (posOZ O) *)
simpl in |- *; exact I.
(* Goal: forall (n : nat) (_ : leZ OZ (posOZ n)), leZ OZ (posOZ (S n)) *)
simpl in |- *; intros; exact I.
Qed.
Lemma le_opp_OZ_l : forall x : Z, leZ OZ x -> leZ (oppZ x) OZ.
Proof.
(* Goal: forall (x : Z) (_ : leZ OZ x), leZ (oppZ x) OZ *)
intro x; elim x.
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)), leZ (oppZ (neg n)) OZ *)
(* Goal: forall (n : nat) (_ : leZ OZ (pos n)), leZ (oppZ (pos n)) OZ *)
(* Goal: forall _ : leZ OZ OZ, leZ (oppZ OZ) OZ *)
simpl in |- *; intros; exact I.
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)), leZ (oppZ (neg n)) OZ *)
(* Goal: forall (n : nat) (_ : leZ OZ (pos n)), leZ (oppZ (pos n)) OZ *)
simpl in |- *; intros; exact I.
(* Goal: forall (n : nat) (_ : leZ OZ (neg n)), leZ (oppZ (neg n)) OZ *)
intros; elim H.
Qed.
Lemma le_opp_OZ :
forall x y : Z, x = oppZ y -> leZ OZ x -> leZ OZ y -> x = OZ.
Proof.
(* Goal: forall (x y : Z) (_ : @eq Z x (oppZ y)) (_ : leZ OZ x) (_ : leZ OZ y), @eq Z x OZ *)
intros.
(* Goal: @eq Z x OZ *)
apply (leZ_antisymmetric x OZ).
(* Goal: leZ OZ x *)
(* Goal: leZ x OZ *)
rewrite H.
(* Goal: leZ OZ x *)
(* Goal: leZ (oppZ y) OZ *)
exact (le_opp_OZ_l y H1).
(* Goal: leZ OZ x *)
exact H0.
Qed.
Let opp_inv : forall x y : Z, x = oppZ y -> y = oppZ x.
Proof.
(* Goal: forall (x y : Z) (_ : @eq Z x (oppZ y)), @eq Z y (oppZ x) *)
intros x y; elim y; simpl in |- *.
(* Goal: forall (n : nat) (_ : @eq Z x (pos n)), @eq Z (neg n) (oppZ x) *)
(* Goal: forall (n : nat) (_ : @eq Z x (neg n)), @eq Z (pos n) (oppZ x) *)
(* Goal: forall _ : @eq Z x OZ, @eq Z OZ (oppZ x) *)
intro H'; rewrite H'; auto with arith.
(* Goal: forall (n : nat) (_ : @eq Z x (pos n)), @eq Z (neg n) (oppZ x) *)
(* Goal: forall (n : nat) (_ : @eq Z x (neg n)), @eq Z (pos n) (oppZ x) *)
intros n H'; rewrite H'; auto with arith.
(* Goal: forall (n : nat) (_ : @eq Z x (pos n)), @eq Z (neg n) (oppZ x) *)
intros n H'; rewrite H'; auto with arith.
Qed.
Lemma le_opp_OZ2 :
forall x y : Z, x = oppZ y -> leZ OZ x -> leZ OZ y -> x = y.
Proof.
(* Goal: forall (x y : Z) (_ : @eq Z x (oppZ y)) (_ : leZ OZ x) (_ : leZ OZ y), @eq Z x y *)
intros.
(* Goal: @eq Z x y *)
rewrite (le_opp_OZ x y H H0 H1).
(* Goal: @eq Z OZ y *)
cut (y = oppZ x).
(* Goal: @eq Z y (oppZ x) *)
(* Goal: forall _ : @eq Z y (oppZ x), @eq Z OZ y *)
intro H'; rewrite H'.
(* Goal: @eq Z y (oppZ x) *)
(* Goal: @eq Z OZ (oppZ x) *)
rewrite (le_opp_OZ x y H H0 H1); simpl in |- *; reflexivity.
(* Goal: @eq Z y (oppZ x) *)
apply opp_inv; trivial with arith.
Qed.
|
Require Import securite.
Lemma POinv0 :
forall st1 st2 : GlobalState, inv0 st1 -> rel st1 st2 -> inv0 st2.
Proof.
(* Goal: forall (st1 st2 : GlobalState) (_ : inv0 st1) (_ : rel st1 st2), inv0 st2 *)
simple induction st1; intros a b s l; elim a; elim b; elim s.
(* Goal: forall (d d0 d1 d2 d3 d4 d5 d6 : D) (k : K) (c c0 : C) (d7 d8 d9 : D) (k0 : K) (st2 : GlobalState) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) st2), inv0 st2 *)
simple induction st2; intros a0 b0 s0 l0; elim a0; elim b0; elim s0.
(* Goal: forall (d10 d11 d12 d13 d14 d15 d16 d17 : D) (k1 : K) (c1 c2 : C) (d18 d19 d20 : D) (k2 : K) (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel (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)), inv0 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
do 15 intro.
(* Goal: forall (_ : inv0 (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l)) (_ : rel (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)), inv0 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
unfold inv0 in |- *; unfold rel in |- *; intros know_c_c0_l rel1_8.
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim rel1_8.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
intros r1.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r1; intros eq_l0 and1; elim and1; intros t1 and2; elim and2; intros t2 and3; elim and3; intros i_c1_c2 t3.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 r1 and1 and2 and3 t1 t2 t3.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
inversion i_c1_c2; elim H4; elim H5; rewrite eq_l0.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in 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)) (known_in c0 (@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)) *)
split; apply E0; elim know_c_c0_l; intros; assumption.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), and (known_in c1 l0) (known_in c2 l0) *)
intro rel2_8; elim rel2_8.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
intros r2.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r2; unfold quad in |- *; intros know_c1_l and1; elim and1; intros t1 and2; elim and2; intros t2 and3; elim and3; intros eq_l0 and4; elim and4; intros t3 and5; elim and5; intros t4 eq_c2.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 rel2_8 r2 and1 and2 and3 and4 and5 t1 t2 t3 t4.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim eq_l0; elim eq_c2.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l) (known_in c0 l) *)
split.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: known_in c0 l *)
(* Goal: known_in c1 l *)
apply (A2B (B2C (D2B Bid)) c1 l (A2B (B2C (D2B d16)) (Pair (B2C (D2B Bid)) c1) l (A2B (B2C (D2B d15)) (Pair (B2C (D2B d16)) (Pair (B2C (D2B Bid)) c1)) l know_c1_l))).
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: known_in c0 l *)
elim know_c_c0_l; intros; assumption.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), and (known_in c1 l0) (known_in c2 l0) *)
intros rel3_8; elim rel3_8.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
intros r3.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r3; intros eq_l0 and1; elim and1; intros t1 and2; elim and2; intros t2 and3; elim and3; intros t3 and4; elim and4; intros t4 and5; elim and5; intros t5 and6; elim and6; intros t6 and7; elim and7; intros eq_c1 eq_c2.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 rel2_8 rel3_8 r3 and1 and2 and3 and4 and5 and6 and7 t1 t2 t3 t4 t5 t6.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim eq_c1; elim eq_c2; rewrite eq_l0.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in 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)) (known_in c0 (@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)) *)
split; apply E0; elim know_c_c0_l; intros; assumption.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), and (known_in c1 l0) (known_in c2 l0) *)
intros rel4_8; elim rel4_8.
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
intros r4.
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r4; intros t1 and1; elim and1; intros t2 and2; elim and2; intros i_c1_c2 eq_l0.
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 rel2_8 rel3_8 rel4_8 r4 and1 and2 t1 t2.
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
inversion i_c1_c2; elim H4; elim H5; elim eq_l0; assumption.
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))), and (known_in c1 l0) (known_in c2 l0) *)
intros rel5_8; elim rel5_8.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
intros r5.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r5; intros eq_l0 and1; elim and1; intros t1 and2; elim and2; intros i_c1_c2 t2.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 rel2_8 rel3_8 rel4_8 rel5_8 r5 and1 and2 t1 t2.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
inversion i_c1_c2; elim H4; elim H5; rewrite eq_l0.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in 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)) (known_in c0 (@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)) *)
split; apply E0; elim know_c_c0_l; intros; assumption.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), and (known_in c1 l0) (known_in c2 l0) *)
intros rel6_8; elim rel6_8.
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: forall _ : rel6 (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), and (known_in c1 l0) (known_in c2 l0) *)
intros r6.
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r6; unfold triple in |- *; intros know_c2_l and1; elim and1; intros t1 and2; elim and2; intros t2 and3; elim and3; intros eq_l0 and4; elim and4; intros t3 and5; elim and5; intros t4 and6; elim and6; intros t5 eq_c1.
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 rel2_8 rel3_8 rel4_8 rel5_8 rel6_8 r6 and1 and2 and3 and4 and5 and6 t1 t2 t3 t4 t5.
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim eq_c1; elim eq_l0.
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c l) (known_in c2 l) *)
split.
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: known_in c2 l *)
(* Goal: known_in c l *)
elim know_c_c0_l; intros; assumption.
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: known_in c2 l *)
apply (A2A c2 (Encrypt (Pair (B2C (D2B d6)) (B2C (K2B k1))) (KeyX Bid)) l (A2B (B2C (D2B d4)) (Pair c2 (Encrypt (Pair (B2C (D2B d6)) (B2C (K2B k1))) (KeyX Bid))) l know_c2_l)).
(* Goal: forall _ : or (rel7 (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)) (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)), and (known_in c1 l0) (known_in c2 l0) *)
intros rel7_8; elim rel7_8.
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: forall _ : rel7 (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), and (known_in c1 l0) (known_in c2 l0) *)
intros r7.
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r7; intros eq_l0 and1; elim and1; intros t1 and2; elim and2; intros i_c1_c2 t2.
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 rel2_8 rel3_8 rel4_8 rel5_8 rel6_8 rel7_8 r7 and1 and2 t1 t2.
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
inversion i_c1_c2; elim H4; elim H5; rewrite eq_l0.
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
(* Goal: and (known_in c (@cons C (Pair (B2C (D2B d4)) c0) l)) (known_in c0 (@cons C (Pair (B2C (D2B d4)) c0) l)) *)
split; apply E0; elim know_c_c0_l; intros; assumption.
(* Goal: forall _ : 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), and (known_in c1 l0) (known_in c2 l0) *)
intros r8.
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
elim r8; intros t1 and1; elim and1; intros i_c1_c2 and2; elim and2; intros t2 and3; elim and3; intros eq_l0 t3.
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
clear rel1_8 rel2_8 rel3_8 rel4_8 rel5_8 rel6_8 rel7_8 r8 and1 and2 and3 t1 t2 t3.
(* Goal: and (known_in c1 l0) (known_in c2 l0) *)
inversion i_c1_c2; elim H4; elim H5; elim eq_l0; assumption.
Qed.
|
Require Import securite.
Require Import inv1rel1.
Require Import inv1rel2.
Require Import inv1rel3.
Require Import inv1rel4.
Require Import inv1rel5.
Require Import inv1rel6.
Require Import inv1rel7.
Require Import inv1rel8.
Lemma POinv1 :
forall st1 st2 : GlobalState,
inv0 st1 -> inv1 st1 -> rel st1 st2 -> inv1 st2.
Proof.
(* Goal: forall (st1 st2 : GlobalState) (_ : inv0 st1) (_ : inv1 st1) (_ : rel st1 st2), inv1 st2 *)
simple induction st1; intros a b s l; elim a; elim b; elim s.
(* Goal: forall (d d0 d1 d2 d3 d4 d5 d6 : D) (k : K) (c c0 : C) (d7 d8 d9 : D) (k0 : K) (st2 : GlobalState) (_ : 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)) (_ : rel (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) st2), inv1 st2 *)
simple induction st2; intros a0 b0 s0 l0; elim a0; elim b0; elim s0.
(* Goal: forall (d10 d11 d12 d13 d14 d15 d16 d17 : D) (k1 : K) (c1 c2 : C) (d18 d19 d20 : D) (k2 : K) (_ : 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)) (_ : rel (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 15 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)) (_ : rel (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 rel in |- *; intros Inv0 Inv1.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
intros Rel1_8.
(* Goal: inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel1_8; clear Rel1_8.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
(* Goal: forall _ : 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) *)
exact (POinv1rel1 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
intros Rel2_8.
(* Goal: inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel2_8; clear Rel2_8.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
(* Goal: forall _ : 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), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
exact (POinv1rel2 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
intros Rel3_8.
(* Goal: inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel3_8; clear Rel3_8.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
(* Goal: forall _ : 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), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
exact (POinv1rel3 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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))))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
intros Rel4_8.
(* Goal: inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel4_8; clear Rel4_8.
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
(* Goal: forall _ : 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), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
exact (POinv1rel4 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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)))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
intros Rel5_8.
(* Goal: inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel5_8; clear Rel5_8.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
(* Goal: forall _ : 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), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
exact (POinv1rel5 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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))), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
intros Rel6_8.
(* Goal: inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel6_8; clear Rel6_8.
(* Goal: forall _ : or (rel7 (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)) (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)), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
(* Goal: forall _ : rel6 (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) *)
exact (POinv1rel6 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
(* Goal: forall _ : or (rel7 (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)) (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)), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
intros Rel7_8.
(* Goal: inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel7_8; clear Rel7_8.
(* Goal: forall _ : 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), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
(* Goal: forall _ : rel7 (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) *)
exact (POinv1rel7 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
(* Goal: forall _ : 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), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
exact (POinv1rel8 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1).
Qed.
|
Section Relations.
Variable U : Type.
Definition Relation := U -> U -> Prop.
Variable R : Relation.
Definition Reflexive : Prop := forall x : U, R x x.
Definition Transitive : Prop := forall x y z : U, R x y -> R y z -> R x z.
Definition Antisymmetric : Prop := forall x y : U, R x y /\ R y x -> x = y.
Definition Order : Prop := (Reflexive /\ Transitive) /\ Antisymmetric.
Definition Symmetric : Prop := forall x y : U, R x y -> R y x.
Definition Equivalence : Prop := (Reflexive /\ Symmetric) /\ Transitive.
Definition PER : Prop := Symmetric /\ Transitive.
End Relations.
Hint Unfold Reflexive.
Hint Unfold Transitive.
Hint Unfold Antisymmetric.
Hint Unfold Order.
Hint Unfold Symmetric.
Hint Unfold Equivalence.
Hint Unfold PER.
Theorem sym_not_P :
forall (U : Type) (P : Relation U) (x y : U),
Symmetric U P -> ~ P x y -> ~ P y x.
Proof.
(* Goal: forall (U : Type) (P : Relation U) (x y : U) (_ : Symmetric U P) (_ : not (P x y)), not (P y x) *)
intros U P x y H' H'0; unfold not at 1 in |- *; intro H'1.
(* Goal: False *)
apply H'0; apply H'; auto.
Qed.
Theorem Equiv_from_order :
forall (U : Type) (R : Relation U),
Order U R -> Equivalence U (fun x y : U => R x y /\ R y x).
Proof.
(* Goal: forall (U : Type) (R : Relation U) (_ : Order U R), Equivalence U (fun x y : U => and (R x y) (R y x)) *)
intros U R H'; red in |- *.
(* Goal: and (and (Reflexive U (fun x y : U => and (R x y) (R y x))) (Symmetric U (fun x y : U => and (R x y) (R y x)))) (Transitive U (fun x y : U => and (R x y) (R y x))) *)
elim H'; intros H'0 H'1; elim H'0; intros H'2 H'3; clear H' H'0.
(* Goal: and (and (Reflexive U (fun x y : U => and (R x y) (R y x))) (Symmetric U (fun x y : U => and (R x y) (R y x)))) (Transitive U (fun x y : U => and (R x y) (R y x))) *)
split; [ split; red in |- * | red in |- * ].
(* Goal: forall (x y z : U) (_ : and (R x y) (R y x)) (_ : and (R y z) (R z y)), and (R x z) (R z x) *)
(* Goal: forall (x y : U) (_ : and (R x y) (R y x)), and (R y x) (R x y) *)
(* Goal: forall x : U, and (R x x) (R x x) *)
intro x; split; try exact (H'2 x).
(* Goal: forall (x y z : U) (_ : and (R x y) (R y x)) (_ : and (R y z) (R z y)), and (R x z) (R z x) *)
(* Goal: forall (x y : U) (_ : and (R x y) (R y x)), and (R y x) (R x y) *)
intros x y H'; elim H'; intros H'0 H'4; clear H'; auto.
(* Goal: forall (x y z : U) (_ : and (R x y) (R y x)) (_ : and (R y z) (R z y)), and (R x z) (R z x) *)
intros x y z H' H'0; elim H'0; intros H'4 H'5; clear H'0; elim H'; intros H'6 H'7; clear H'.
(* Goal: and (R x z) (R z x) *)
red in H'3.
(* Goal: and (R x z) (R z x) *)
split; apply H'3 with y; auto.
Qed.
Hint Resolve Equiv_from_order.
|
Require Import ZArith.
Require Import lemmas.
Require Import natZ.
Fixpoint Exp (a : Z) (n : nat) {struct n} : Z :=
match n with
| O => 1%Z
| S m => (a * Exp a m)%Z
end.
Lemma exp_0 : forall n : nat, Exp 0 (S n) = 0%Z.
Proof.
(* Goal: forall n : nat, @eq Z (Exp Z0 (S n)) Z0 *)
simpl in |- *.
(* Goal: forall _ : nat, @eq Z Z0 Z0 *)
intros.
(* Goal: @eq Z Z0 Z0 *)
reflexivity.
Qed.
Lemma exp_1 : forall n : nat, Exp 1 n = 1%Z.
Proof.
(* Goal: forall n : nat, @eq Z (Exp (Zpos xH) n) (Zpos xH) *)
simple induction n.
(* Goal: forall (n : nat) (_ : @eq Z (Exp (Zpos xH) n) (Zpos xH)), @eq Z (Exp (Zpos xH) (S n)) (Zpos xH) *)
(* Goal: @eq Z (Exp (Zpos xH) O) (Zpos xH) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : @eq Z (Exp (Zpos xH) n) (Zpos xH)), @eq Z (Exp (Zpos xH) (S n)) (Zpos xH) *)
(* Goal: @eq Z (Zpos xH) (Zpos xH) *)
reflexivity.
(* Goal: forall (n : nat) (_ : @eq Z (Exp (Zpos xH) n) (Zpos xH)), @eq Z (Exp (Zpos xH) (S n)) (Zpos xH) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : @eq Z (Exp (Zpos xH) n) (Zpos xH)), @eq Z match Exp (Zpos xH) n with | Z0 => Z0 | Zpos y' => Zpos y' | Zneg y' => Zneg y' end (Zpos xH) *)
intros m IH.
(* Goal: @eq Z match Exp (Zpos xH) m with | Z0 => Z0 | Zpos y' => Zpos y' | Zneg y' => Zneg y' end (Zpos xH) *)
rewrite IH.
(* Goal: @eq Z (Zpos xH) (Zpos xH) *)
reflexivity.
Qed.
Lemma exp_S : forall (a : Z) (n : nat), Exp a (S n) = (a * Exp a n)%Z.
Proof.
(* Goal: forall (a : Z) (n : nat), @eq Z (Exp a (S n)) (Z.mul a (Exp a n)) *)
simpl in |- *.
(* Goal: forall (a : Z) (n : nat), @eq Z (Z.mul a (Exp a n)) (Z.mul a (Exp a n)) *)
reflexivity.
Qed.
Lemma exp_plus :
forall (a : Z) (n m : nat), Exp a (n + m) = (Exp a n * Exp a m)%Z.
Proof.
(* Goal: forall (a : Z) (n m : nat), @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m)) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m))) (m : nat), @eq Z (Exp a (Init.Nat.add (S n) m)) (Z.mul (Exp a (S n)) (Exp a m)) *)
(* Goal: forall m : nat, @eq Z (Exp a (Init.Nat.add O m)) (Z.mul (Exp a O) (Exp a m)) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m))) (m : nat), @eq Z (Exp a (Init.Nat.add (S n) m)) (Z.mul (Exp a (S n)) (Exp a m)) *)
(* Goal: forall m : nat, @eq Z (Exp a m) match Exp a m with | Z0 => Z0 | Zpos y' => Zpos y' | Zneg y' => Zneg y' end *)
intros.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m))) (m : nat), @eq Z (Exp a (Init.Nat.add (S n) m)) (Z.mul (Exp a (S n)) (Exp a m)) *)
(* Goal: @eq Z (Exp a m) match Exp a m with | Z0 => Z0 | Zpos y' => Zpos y' | Zneg y' => Zneg y' end *)
elim (Exp a m).
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m))) (m : nat), @eq Z (Exp a (Init.Nat.add (S n) m)) (Z.mul (Exp a (S n)) (Exp a m)) *)
(* Goal: forall p : positive, @eq Z (Zneg p) (Zneg p) *)
(* Goal: forall p : positive, @eq Z (Zpos p) (Zpos p) *)
(* Goal: @eq Z Z0 Z0 *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m))) (m : nat), @eq Z (Exp a (Init.Nat.add (S n) m)) (Z.mul (Exp a (S n)) (Exp a m)) *)
(* Goal: forall p : positive, @eq Z (Zneg p) (Zneg p) *)
(* Goal: forall p : positive, @eq Z (Zpos p) (Zpos p) *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m))) (m : nat), @eq Z (Exp a (Init.Nat.add (S n) m)) (Z.mul (Exp a (S n)) (Exp a m)) *)
(* Goal: forall p : positive, @eq Z (Zneg p) (Zneg p) *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.add n m)) (Z.mul (Exp a n) (Exp a m))) (m : nat), @eq Z (Exp a (Init.Nat.add (S n) m)) (Z.mul (Exp a (S n)) (Exp a m)) *)
intros n1 IH.
(* Goal: forall m : nat, @eq Z (Exp a (Init.Nat.add (S n1) m)) (Z.mul (Exp a (S n1)) (Exp a m)) *)
simpl in |- *.
(* Goal: forall m : nat, @eq Z (Z.mul a (Exp a (Init.Nat.add n1 m))) (Z.mul (Z.mul a (Exp a n1)) (Exp a m)) *)
intros.
(* Goal: @eq Z (Z.mul a (Exp a (Init.Nat.add n1 m))) (Z.mul (Z.mul a (Exp a n1)) (Exp a m)) *)
rewrite (IH m).
(* Goal: @eq Z (Z.mul a (Z.mul (Exp a n1) (Exp a m))) (Z.mul (Z.mul a (Exp a n1)) (Exp a m)) *)
apply Zmult_assoc.
Qed.
Lemma exp_abn :
forall (a b : Z) (n : nat), Exp (a * b) n = (Exp a n * Exp b n)%Z.
Proof.
(* Goal: forall (a b : Z) (n : nat), @eq Z (Exp (Z.mul a b) n) (Z.mul (Exp a n) (Exp b n)) *)
simple induction n.
(* Goal: forall (n : nat) (_ : @eq Z (Exp (Z.mul a b) n) (Z.mul (Exp a n) (Exp b n))), @eq Z (Exp (Z.mul a b) (S n)) (Z.mul (Exp a (S n)) (Exp b (S n))) *)
(* Goal: @eq Z (Exp (Z.mul a b) O) (Z.mul (Exp a O) (Exp b O)) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : @eq Z (Exp (Z.mul a b) n) (Z.mul (Exp a n) (Exp b n))), @eq Z (Exp (Z.mul a b) (S n)) (Z.mul (Exp a (S n)) (Exp b (S n))) *)
(* Goal: @eq Z (Zpos xH) (Zpos xH) *)
reflexivity.
(* Goal: forall (n : nat) (_ : @eq Z (Exp (Z.mul a b) n) (Z.mul (Exp a n) (Exp b n))), @eq Z (Exp (Z.mul a b) (S n)) (Z.mul (Exp a (S n)) (Exp b (S n))) *)
intros m IH.
(* Goal: @eq Z (Exp (Z.mul a b) (S m)) (Z.mul (Exp a (S m)) (Exp b (S m))) *)
simpl in |- *.
(* Goal: @eq Z (Z.mul (Z.mul a b) (Exp (Z.mul a b) m)) (Z.mul (Z.mul a (Exp a m)) (Z.mul b (Exp b m))) *)
rewrite IH.
(* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul a (Exp a m)) (Z.mul b (Exp b m))) *)
rewrite (Zmult_assoc (a * Exp a m) b (Exp b m)).
(* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul (Z.mul a (Exp a m)) b) (Exp b m)) *)
rewrite (Zmult_assoc_reverse a (Exp a m) b).
(* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul a (Z.mul (Exp a m) b)) (Exp b m)) *)
rewrite (Zmult_comm (Exp a m) b).
(* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul a (Z.mul b (Exp a m))) (Exp b m)) *)
rewrite (Zmult_assoc a b (Exp a m)).
(* Goal: @eq Z (Z.mul (Z.mul a b) (Z.mul (Exp a m) (Exp b m))) (Z.mul (Z.mul (Z.mul a b) (Exp a m)) (Exp b m)) *)
apply Zmult_assoc.
Qed.
Lemma exp_mult : forall (a : Z) (n m : nat), Exp a (n * m) = Exp (Exp a n) m.
Proof.
(* Goal: forall (a : Z) (n m : nat), @eq Z (Exp a (Init.Nat.mul n m)) (Exp (Exp a n) m) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.mul n m)) (Exp (Exp a n) m)) (m : nat), @eq Z (Exp a (Init.Nat.mul (S n) m)) (Exp (Exp a (S n)) m) *)
(* Goal: forall m : nat, @eq Z (Exp a (Init.Nat.mul O m)) (Exp (Exp a O) m) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.mul n m)) (Exp (Exp a n) m)) (m : nat), @eq Z (Exp a (Init.Nat.mul (S n) m)) (Exp (Exp a (S n)) m) *)
(* Goal: forall m : nat, @eq Z (Zpos xH) (Exp (Zpos xH) m) *)
intro.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.mul n m)) (Exp (Exp a n) m)) (m : nat), @eq Z (Exp a (Init.Nat.mul (S n) m)) (Exp (Exp a (S n)) m) *)
(* Goal: @eq Z (Zpos xH) (Exp (Zpos xH) m) *)
rewrite exp_1.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.mul n m)) (Exp (Exp a n) m)) (m : nat), @eq Z (Exp a (Init.Nat.mul (S n) m)) (Exp (Exp a (S n)) m) *)
(* Goal: @eq Z (Zpos xH) (Zpos xH) *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq Z (Exp a (Init.Nat.mul n m)) (Exp (Exp a n) m)) (m : nat), @eq Z (Exp a (Init.Nat.mul (S n) m)) (Exp (Exp a (S n)) m) *)
intros m IH.
(* Goal: forall m0 : nat, @eq Z (Exp a (Init.Nat.mul (S m) m0)) (Exp (Exp a (S m)) m0) *)
simpl in |- *.
(* Goal: forall m0 : nat, @eq Z (Exp a (Init.Nat.add m0 (Init.Nat.mul m m0))) (Exp (Z.mul a (Exp a m)) m0) *)
intros.
(* Goal: @eq Z (Exp a (Init.Nat.add m0 (Init.Nat.mul m m0))) (Exp (Z.mul a (Exp a m)) m0) *)
rewrite exp_plus.
(* Goal: @eq Z (Z.mul (Exp a m0) (Exp a (Init.Nat.mul m m0))) (Exp (Z.mul a (Exp a m)) m0) *)
rewrite exp_abn.
(* Goal: @eq Z (Z.mul (Exp a m0) (Exp a (Init.Nat.mul m m0))) (Z.mul (Exp a m0) (Exp (Exp a m) m0)) *)
rewrite IH.
(* Goal: @eq Z (Z.mul (Exp a m0) (Exp (Exp a m) m0)) (Z.mul (Exp a m0) (Exp (Exp a m) m0)) *)
reflexivity.
Qed.
Lemma exp_not0 : forall a : Z, a <> 0%Z -> forall m : nat, Exp a m <> 0%Z.
Proof.
(* Goal: forall (a : Z) (_ : not (@eq Z a Z0)) (m : nat), not (@eq Z (Exp a m) Z0) *)
intros a Ha.
(* Goal: forall m : nat, not (@eq Z (Exp a m) Z0) *)
simple induction m.
(* Goal: forall (n : nat) (_ : not (@eq Z (Exp a n) Z0)), not (@eq Z (Exp a (S n)) Z0) *)
(* Goal: not (@eq Z (Exp a O) Z0) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : not (@eq Z (Exp a n) Z0)), not (@eq Z (Exp a (S n)) Z0) *)
(* Goal: not (@eq Z (Zpos xH) Z0) *)
discriminate.
(* Goal: forall (n : nat) (_ : not (@eq Z (Exp a n) Z0)), not (@eq Z (Exp a (S n)) Z0) *)
intros n IH.
(* Goal: not (@eq Z (Exp a (S n)) Z0) *)
simpl in |- *.
(* Goal: not (@eq Z (Z.mul a (Exp a n)) Z0) *)
intro.
(* Goal: False *)
elim (Zmult_ab0a0b0 a (Exp a n)).
(* Goal: @eq Z (Z.mul a (Exp a n)) Z0 *)
(* Goal: forall _ : @eq Z (Exp a n) Z0, False *)
(* Goal: forall _ : @eq Z a Z0, False *)
assumption.
(* Goal: @eq Z (Z.mul a (Exp a n)) Z0 *)
(* Goal: forall _ : @eq Z (Exp a n) Z0, False *)
assumption.
(* Goal: @eq Z (Z.mul a (Exp a n)) Z0 *)
assumption.
Qed.
Lemma exp_eq : forall (n m : nat) (a : Z), n = m -> Exp a n = Exp a m.
Proof.
(* Goal: forall (n m : nat) (a : Z) (_ : @eq nat n m), @eq Z (Exp a n) (Exp a m) *)
intros.
(* Goal: @eq Z (Exp a n) (Exp a m) *)
rewrite H.
(* Goal: @eq Z (Exp a m) (Exp a m) *)
reflexivity.
Qed.
Lemma exp_pred_succ : forall (a : Z) (n : nat), Exp a (pred (S n)) = Exp a n.
Proof.
(* Goal: forall (a : Z) (n : nat), @eq Z (Exp a (Init.Nat.pred (S n))) (Exp a n) *)
intros.
(* Goal: @eq Z (Exp a (Init.Nat.pred (S n))) (Exp a n) *)
simpl in |- *.
(* Goal: @eq Z (Exp a n) (Exp a n) *)
reflexivity.
Qed.
Definition ZExp (a n : Z) : Z :=
match n with
| Z0 => 1%Z
| Zpos p => Exp a (nat_of_P p)
| Zneg p => Exp a (nat_of_P p)
end.
Lemma zexp_pred_succ : forall a x : Z, ZExp a (x + 1 - 1) = ZExp a x.
Proof.
(* Goal: forall a x : Z, @eq Z (ZExp a (Z.sub (Z.add x (Zpos xH)) (Zpos xH))) (ZExp a x) *)
unfold Zminus in |- *.
(* Goal: forall a x : Z, @eq Z (ZExp a (Z.add (Z.add x (Zpos xH)) (Z.opp (Zpos xH)))) (ZExp a x) *)
intros.
(* Goal: @eq Z (ZExp a (Z.add (Z.add x (Zpos xH)) (Z.opp (Zpos xH)))) (ZExp a x) *)
rewrite Zplus_assoc_reverse.
(* Goal: @eq Z (ZExp a (Z.add x (Z.add (Zpos xH) (Z.opp (Zpos xH))))) (ZExp a x) *)
rewrite Zplus_opp_r.
(* Goal: @eq Z (ZExp a (Z.add x Z0)) (ZExp a x) *)
rewrite <- Zplus_0_r_reverse.
(* Goal: @eq Z (ZExp a x) (ZExp a x) *)
reflexivity.
Qed.
Lemma zexp_eq : forall x y a : Z, x = y -> ZExp a x = ZExp a y.
Proof.
(* Goal: forall (x y a : Z) (_ : @eq Z x y), @eq Z (ZExp a x) (ZExp a y) *)
intros.
(* Goal: @eq Z (ZExp a x) (ZExp a y) *)
rewrite H.
(* Goal: @eq Z (ZExp a y) (ZExp a y) *)
reflexivity.
Qed.
Lemma inj_zexp : forall (n : nat) (a : Z), ZExp a (Z_of_nat n) = Exp a n.
Proof.
(* Goal: forall (n : nat) (a : Z), @eq Z (ZExp a (Z.of_nat n)) (Exp a n) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall a : Z, @eq Z (ZExp a (Z.of_nat n)) (Exp a n)) (a : Z), @eq Z (ZExp a (Z.of_nat (S n))) (Exp a (S n)) *)
(* Goal: forall a : Z, @eq Z (ZExp a (Z.of_nat O)) (Exp a O) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall a : Z, @eq Z (ZExp a (Z.of_nat n)) (Exp a n)) (a : Z), @eq Z (ZExp a (Z.of_nat (S n))) (Exp a (S n)) *)
(* Goal: forall _ : Z, @eq Z (Zpos xH) (Zpos xH) *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall a : Z, @eq Z (ZExp a (Z.of_nat n)) (Exp a n)) (a : Z), @eq Z (ZExp a (Z.of_nat (S n))) (Exp a (S n)) *)
intros m IH.
(* Goal: forall a : Z, @eq Z (ZExp a (Z.of_nat (S m))) (Exp a (S m)) *)
intros.
(* Goal: @eq Z (ZExp a (Z.of_nat (S m))) (Exp a (S m)) *)
simpl in |- *.
(* Goal: @eq Z (Exp a (Pos.to_nat (Pos.of_succ_nat m))) (Z.mul a (Exp a m)) *)
rewrite nat_of_P_o_P_of_succ_nat_eq_succ.
(* Goal: @eq Z (Exp a (S m)) (Z.mul a (Exp a m)) *)
simpl in |- *.
(* Goal: @eq Z (Z.mul a (Exp a m)) (Z.mul a (Exp a m)) *)
reflexivity.
Qed.
Lemma expzexp : forall x a : Z, ZExp a x = Exp a (Zabs_nat x).
Proof.
(* Goal: forall x a : Z, @eq Z (ZExp a x) (Exp a (Z.abs_nat x)) *)
intros.
(* Goal: @eq Z (ZExp a x) (Exp a (Z.abs_nat x)) *)
induction x as [| p| p].
(* Goal: @eq Z (ZExp a (Zneg p)) (Exp a (Z.abs_nat (Zneg p))) *)
(* Goal: @eq Z (ZExp a (Zpos p)) (Exp a (Z.abs_nat (Zpos p))) *)
(* Goal: @eq Z (ZExp a Z0) (Exp a (Z.abs_nat Z0)) *)
simpl in |- *.
(* Goal: @eq Z (ZExp a (Zneg p)) (Exp a (Z.abs_nat (Zneg p))) *)
(* Goal: @eq Z (ZExp a (Zpos p)) (Exp a (Z.abs_nat (Zpos p))) *)
(* Goal: @eq Z (Zpos xH) (Zpos xH) *)
reflexivity.
(* Goal: @eq Z (ZExp a (Zneg p)) (Exp a (Z.abs_nat (Zneg p))) *)
(* Goal: @eq Z (ZExp a (Zpos p)) (Exp a (Z.abs_nat (Zpos p))) *)
simpl in |- *.
(* Goal: @eq Z (ZExp a (Zneg p)) (Exp a (Z.abs_nat (Zneg p))) *)
(* Goal: @eq Z (Exp a (Pos.to_nat p)) (Exp a (Pos.to_nat p)) *)
reflexivity.
(* Goal: @eq Z (ZExp a (Zneg p)) (Exp a (Z.abs_nat (Zneg p))) *)
simpl in |- *.
(* Goal: @eq Z (Exp a (Pos.to_nat p)) (Exp a (Pos.to_nat p)) *)
reflexivity.
Qed.
Lemma zexp_S1 :
forall a n : Z, (0 <= n)%Z -> ZExp a (n + 1) = (a * ZExp a n)%Z.
Proof.
(* Goal: forall (a n : Z) (_ : Z.le Z0 n), @eq Z (ZExp a (Z.add n (Zpos xH))) (Z.mul a (ZExp a n)) *)
intros.
(* Goal: @eq Z (ZExp a (Z.add n (Zpos xH))) (Z.mul a (ZExp a n)) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.add n (Zpos xH)))) (Z.mul a (ZExp a n)) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.add n (Zpos xH)))) (Z.mul a (Exp a (Z.abs_nat n))) *)
rewrite abs_plus_pos.
(* Goal: Z.le Z0 (Zpos xH) *)
(* Goal: Z.le Z0 n *)
(* Goal: @eq Z (Exp a (Init.Nat.add (Z.abs_nat n) (Z.abs_nat (Zpos xH)))) (Z.mul a (Exp a (Z.abs_nat n))) *)
rewrite plus_comm.
(* Goal: Z.le Z0 (Zpos xH) *)
(* Goal: Z.le Z0 n *)
(* Goal: @eq Z (Exp a (Nat.add (Z.abs_nat (Zpos xH)) (Z.abs_nat n))) (Z.mul a (Exp a (Z.abs_nat n))) *)
change (Exp a (S (Zabs_nat n)) = (a * Exp a (Zabs_nat n))%Z) in |- *.
(* Goal: Z.le Z0 (Zpos xH) *)
(* Goal: Z.le Z0 n *)
(* Goal: @eq Z (Exp a (S (Z.abs_nat n))) (Z.mul a (Exp a (Z.abs_nat n))) *)
apply exp_S.
(* Goal: Z.le Z0 (Zpos xH) *)
(* Goal: Z.le Z0 n *)
assumption.
(* Goal: Z.le Z0 (Zpos xH) *)
unfold Zle in |- *.
(* Goal: not (@eq comparison (Z.compare Z0 (Zpos xH)) Gt) *)
simpl in |- *.
(* Goal: not (@eq comparison Lt Gt) *)
discriminate.
Qed.
Lemma zexp_S :
forall a n : Z, (0 <= n)%Z -> ZExp a (Zsucc n) = (a * ZExp a n)%Z.
Proof.
(* Goal: forall (a n : Z) (_ : Z.le Z0 n), @eq Z (ZExp a (Z.succ n)) (Z.mul a (ZExp a n)) *)
intros.
(* Goal: @eq Z (ZExp a (Z.succ n)) (Z.mul a (ZExp a n)) *)
change (ZExp a (n + 1) = (a * ZExp a n)%Z) in |- *.
(* Goal: @eq Z (ZExp a (Z.add n (Zpos xH))) (Z.mul a (ZExp a n)) *)
apply zexp_S1.
(* Goal: Z.le Z0 n *)
assumption.
Qed.
Lemma zexp_plus :
forall a n m : Z,
(0 <= n)%Z -> (0 <= m)%Z -> ZExp a (n + m) = (ZExp a n * ZExp a m)%Z.
Proof.
(* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.add n m)) (Z.mul (ZExp a n) (ZExp a m)) *)
intros.
(* Goal: @eq Z (ZExp a (Z.add n m)) (Z.mul (ZExp a n) (ZExp a m)) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.add n m))) (Z.mul (ZExp a n) (ZExp a m)) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.add n m))) (Z.mul (Exp a (Z.abs_nat n)) (ZExp a m)) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.add n m))) (Z.mul (Exp a (Z.abs_nat n)) (Exp a (Z.abs_nat m))) *)
rewrite abs_plus_pos.
(* Goal: Z.le Z0 m *)
(* Goal: Z.le Z0 n *)
(* Goal: @eq Z (Exp a (Init.Nat.add (Z.abs_nat n) (Z.abs_nat m))) (Z.mul (Exp a (Z.abs_nat n)) (Exp a (Z.abs_nat m))) *)
apply exp_plus.
(* Goal: Z.le Z0 m *)
(* Goal: Z.le Z0 n *)
assumption.
(* Goal: Z.le Z0 m *)
assumption.
Qed.
Lemma zexp_mult :
forall a n m : Z,
(0 <= n)%Z -> (0 <= m)%Z -> ZExp a (n * m) = ZExp (ZExp a n) m.
Proof.
(* Goal: forall (a n m : Z) (_ : Z.le Z0 n) (_ : Z.le Z0 m), @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *)
intros.
(* Goal: @eq Z (ZExp a (Z.mul n m)) (ZExp (ZExp a n) m) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (ZExp (ZExp a n) m) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (ZExp a n) (Z.abs_nat m)) *)
rewrite expzexp.
(* Goal: @eq Z (Exp a (Z.abs_nat (Z.mul n m))) (Exp (Exp a (Z.abs_nat n)) (Z.abs_nat m)) *)
rewrite abs_mult.
(* Goal: @eq Z (Exp a (Init.Nat.mul (Z.abs_nat n) (Z.abs_nat m))) (Exp (Exp a (Z.abs_nat n)) (Z.abs_nat m)) *)
apply exp_mult.
Qed.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_rayimpliescollinear.
Require Export GeoCoq.Elements.OriginalProofs.lemma_ray2.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearitypreserved.
Require Export GeoCoq.Elements.OriginalProofs.lemma_raystrict.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_equalanglessymmetric :
forall A B C a b c,
CongA A B C a b c ->
CongA a b c A B C.
Proof.
(* Goal: forall (A B C a b c : @Point Ax0) (_ : @CongA Ax0 A B C a b c), @CongA Ax0 a b c A B C *)
intros.
(* Goal: @CongA Ax0 a b c A B C *)
let Tf:=fresh in assert (Tf:exists U V u v, (Out B A U /\ Out B C V /\ Out b a u /\ Out b c v /\ Cong B U b u /\ Cong B V b v /\ Cong U V u v /\ nCol A B C)) by (conclude_def CongA );destruct Tf as [U[V[u[v]]]];spliter.
(* Goal: @CongA Ax0 a b c A B C *)
assert (Cong b u B U) by (conclude lemma_congruencesymmetric).
(* Goal: @CongA Ax0 a b c A B C *)
assert (Cong b v B V) by (conclude lemma_congruencesymmetric).
(* Goal: @CongA Ax0 a b c A B C *)
assert (Cong v u V U) by (forward_using lemma_doublereverse).
(* Goal: @CongA Ax0 a b c A B C *)
assert (~ Col a b c).
(* Goal: @CongA Ax0 a b c A B C *)
(* Goal: not (@Col Ax0 a b c) *)
{
(* Goal: not (@Col Ax0 a b c) *)
intro.
(* Goal: False *)
assert (Col b a u) by (conclude lemma_rayimpliescollinear).
(* Goal: False *)
assert (Col b c v) by (conclude lemma_rayimpliescollinear).
(* Goal: False *)
assert (Col B A U) by (conclude lemma_rayimpliescollinear).
(* Goal: False *)
assert (Col B C V) by (conclude lemma_rayimpliescollinear).
(* Goal: False *)
assert (Col a b u) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq b a) by (conclude lemma_ray2).
(* Goal: False *)
assert (neq a b) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col b u c) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col c b u) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col c b v) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq b c) by (conclude lemma_ray2).
(* Goal: False *)
assert (neq c b) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col b u v) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Cong u v U V) by (conclude lemma_congruencesymmetric).
(* Goal: False *)
assert (Col B U V) by (conclude lemma_collinearitypreserved).
(* Goal: False *)
assert (Col U B V) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col U B A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq B U) by (conclude lemma_raystrict).
(* Goal: False *)
assert (neq U B) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col B V A) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col V B A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col V B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq B V) by (conclude lemma_raystrict).
(* Goal: False *)
assert (neq V B) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col B A C) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @CongA Ax0 a b c A B C *)
}
(* Goal: @CongA Ax0 a b c A B C *)
assert (Cong u v U V) by (conclude lemma_congruencesymmetric).
(* Goal: @CongA Ax0 a b c A B C *)
assert (CongA a b c A B C) by (conclude_def CongA ).
(* Goal: @CongA Ax0 a b c A B C *)
close.
Qed.
End Euclid.
|
Section General_Order.
Variable S : Set.
Variable O : S -> S -> Prop.
Variable E : S -> S -> Prop.
Definition is_order :=
(forall x : S, ~ O x x) /\ (forall x y z : S, O x y -> O y z -> O x z).
Definition wf_ind :=
forall P : S -> Prop,
(forall q : S, (forall r : S, O r q -> P r) -> P q) -> forall q : S, P q.
Definition is_equality :=
(forall x : S, E x x) /\
(forall x y : S, E x y -> E y x) /\
(forall x y z : S, E x y -> E y z -> E x z).
Definition is_well_def_rht :=
forall x y : S, O x y -> forall z : S, E y z -> O x z.
Definition is_well_def_lft :=
forall x y : S, O x y -> forall z : S, E x z -> O z y.
End General_Order.
Record well_ordering : Type :=
{wfcrr :> Set;
order : wfcrr -> wfcrr -> Prop;
equality : wfcrr -> wfcrr -> Prop;
is_ord : is_order wfcrr order;
is_eq : is_equality wfcrr equality;
ord_is_wf : wf_ind wfcrr order;
ord_wd_rht : is_well_def_rht wfcrr order equality}.
Section Negation_Order.
Variable S : well_ordering.
Let O := order S.
Lemma order_lt_le_weak : forall n m : S, O m n -> ~ O n m.
Proof.
(* Goal: forall (n m : wfcrr S) (_ : O m n), not (O n m) *)
intros.
(* Goal: not (O n m) *)
elim (is_ord S).
(* Goal: forall (_ : forall x : wfcrr S, not (order S x x)) (_ : forall (x y z : wfcrr S) (_ : order S x y) (_ : order S y z), order S x z), not (O n m) *)
intro.
(* Goal: forall _ : forall (x y z : wfcrr S) (_ : order S x y) (_ : order S y z), order S x z, not (O n m) *)
intro.
(* Goal: not (O n m) *)
intro.
(* Goal: False *)
apply H0 with n.
(* Goal: order S n n *)
apply H1 with m.
(* Goal: order S m n *)
(* Goal: order S n m *)
assumption.
(* Goal: order S m n *)
assumption.
Qed.
End Negation_Order.
Section Merge_Order.
Variable S1 S2 : well_ordering.
Let O1 := order S1.
Let O2 := order S2.
Let E1 := equality S1.
Let E2 := equality S2.
Definition merge_lt (x1 : S1) (p1 : S2) (x2 : S1) (p2 : S2) :=
O1 x1 x2 \/ E1 x1 x2 /\ O2 p1 p2.
Definition merge_le (x1 : S1) (p1 : S2) (x2 : S1) (p2 : S2) :=
merge_lt x1 p1 x2 p2 \/ E1 x1 x2 /\ E2 p1 p2.
Let S1ind_wf := ord_is_wf S1.
Let S2ind_wf := ord_is_wf S2.
Lemma merge_lt_wf :
forall P : S1 -> S2 -> Prop,
(forall (q : S1) (t : S2),
(forall (r : S1) (u : S2), merge_lt r u q t -> P r u) -> P q t) ->
forall (x : S1) (p : S2), P x p.
Proof.
(* Goal: forall (P : forall (_ : wfcrr S1) (_ : wfcrr S2), Prop) (_ : forall (q : wfcrr S1) (t : wfcrr S2) (_ : forall (r : wfcrr S1) (u : wfcrr S2) (_ : merge_lt r u q t), P r u), P q t) (x : wfcrr S1) (p : wfcrr S2), P x p *)
intros.
(* Goal: P x p *)
assert (forall r : S1, (forall r' : S1, O1 r' r -> forall t' : S2, P r' t') -> forall t : S2, P r t).
(* Goal: P x p *)
(* Goal: forall (r : wfcrr S1) (_ : forall (r' : wfcrr S1) (_ : O1 r' r) (t' : wfcrr S2), P r' t') (t : wfcrr S2), P r t *)
clear x p.
(* Goal: P x p *)
(* Goal: forall (r : wfcrr S1) (_ : forall (r' : wfcrr S1) (_ : O1 r' r) (t' : wfcrr S2), P r' t') (t : wfcrr S2), P r t *)
intros x.
(* Goal: P x p *)
(* Goal: forall (_ : forall (r' : wfcrr S1) (_ : O1 r' x) (t' : wfcrr S2), P r' t') (t : wfcrr S2), P x t *)
intros.
(* Goal: P x p *)
(* Goal: P x t *)
set (x_aux := x) in *.
(* Goal: P x p *)
(* Goal: P x_aux t *)
assert (E1 x_aux x).
(* Goal: P x p *)
(* Goal: P x_aux t *)
(* Goal: E1 x_aux x *)
unfold x_aux in |- *.
(* Goal: P x p *)
(* Goal: P x_aux t *)
(* Goal: E1 x x *)
elim (is_eq S1).
(* Goal: P x p *)
(* Goal: P x_aux t *)
(* Goal: forall (_ : forall x : wfcrr S1, equality S1 x x) (_ : and (forall (x y : wfcrr S1) (_ : equality S1 x y), equality S1 y x) (forall (x y z : wfcrr S1) (_ : equality S1 x y) (_ : equality S1 y z), equality S1 x z)), E1 x x *)
intros.
(* Goal: P x p *)
(* Goal: P x_aux t *)
(* Goal: E1 x x *)
apply H1.
(* Goal: P x p *)
(* Goal: P x_aux t *)
generalize H1.
(* Goal: P x p *)
(* Goal: forall _ : E1 x_aux x, P x_aux t *)
generalize x_aux.
(* Goal: P x p *)
(* Goal: forall (x_aux : wfcrr S1) (_ : E1 x_aux x), P x_aux t *)
apply (S2ind_wf (fun p : S2 => forall x_aux : S1, E1 x_aux x -> P x_aux p)).
(* Goal: P x p *)
(* Goal: forall (q : wfcrr S2) (_ : forall (r : wfcrr S2) (_ : order S2 r q) (x_aux : wfcrr S1) (_ : E1 x_aux x), P x_aux r) (x_aux : wfcrr S1) (_ : E1 x_aux x), P x_aux q *)
intros.
(* Goal: P x p *)
(* Goal: P x_aux0 q *)
apply H.
(* Goal: P x p *)
(* Goal: forall (r : wfcrr S1) (u : wfcrr S2) (_ : merge_lt r u x_aux0 q), P r u *)
intros.
(* Goal: P x p *)
(* Goal: P r u *)
case H4.
(* Goal: P x p *)
(* Goal: forall _ : and (E1 r x_aux0) (O2 u q), P r u *)
(* Goal: forall _ : O1 r x_aux0, P r u *)
intro.
(* Goal: P x p *)
(* Goal: forall _ : and (E1 r x_aux0) (O2 u q), P r u *)
(* Goal: P r u *)
apply H0.
(* Goal: P x p *)
(* Goal: forall _ : and (E1 r x_aux0) (O2 u q), P r u *)
(* Goal: O1 r x_aux *)
apply (ord_wd_rht S1) with x_aux0.
(* Goal: P x p *)
(* Goal: forall _ : and (E1 r x_aux0) (O2 u q), P r u *)
(* Goal: equality S1 x_aux0 x_aux *)
(* Goal: order S1 r x_aux0 *)
assumption.
(* Goal: P x p *)
(* Goal: forall _ : and (E1 r x_aux0) (O2 u q), P r u *)
(* Goal: equality S1 x_aux0 x_aux *)
assumption.
(* Goal: P x p *)
(* Goal: forall _ : and (E1 r x_aux0) (O2 u q), P r u *)
intro a.
(* Goal: P x p *)
(* Goal: P r u *)
elim a.
(* Goal: P x p *)
(* Goal: forall (_ : E1 r x_aux0) (_ : O2 u q), P r u *)
intros.
(* Goal: P x p *)
(* Goal: P r u *)
apply H2.
(* Goal: P x p *)
(* Goal: E1 r x *)
(* Goal: order S2 u q *)
assumption.
(* Goal: P x p *)
(* Goal: E1 r x *)
elim (is_eq S1).
(* Goal: P x p *)
(* Goal: forall (_ : forall x : wfcrr S1, equality S1 x x) (_ : and (forall (x y : wfcrr S1) (_ : equality S1 x y), equality S1 y x) (forall (x y z : wfcrr S1) (_ : equality S1 x y) (_ : equality S1 y z), equality S1 x z)), E1 r x *)
intros.
(* Goal: P x p *)
(* Goal: E1 r x *)
elim H8.
(* Goal: P x p *)
(* Goal: forall (_ : forall (x y : wfcrr S1) (_ : equality S1 x y), equality S1 y x) (_ : forall (x y z : wfcrr S1) (_ : equality S1 x y) (_ : equality S1 y z), equality S1 x z), E1 r x *)
intros.
(* Goal: P x p *)
(* Goal: E1 r x *)
apply H10 with x_aux0.
(* Goal: P x p *)
(* Goal: equality S1 x_aux0 x *)
(* Goal: equality S1 r x_aux0 *)
assumption.
(* Goal: P x p *)
(* Goal: equality S1 x_aux0 x *)
assumption.
(* Goal: P x p *)
generalize x.
(* Goal: forall x : wfcrr S1, P x p *)
clear x.
(* Goal: forall x : wfcrr S1, P x p *)
apply (S2ind_wf (fun p : S2 => forall x : S1, P x p)).
(* Goal: forall (q : wfcrr S2) (_ : forall (r : wfcrr S2) (_ : order S2 r q) (x : wfcrr S1), P x r) (x : wfcrr S1), P x q *)
intros.
(* Goal: P x q *)
apply H.
(* Goal: forall (r : wfcrr S1) (u : wfcrr S2) (_ : merge_lt r u x q), P r u *)
clear p.
(* Goal: forall (r : wfcrr S1) (u : wfcrr S2) (_ : merge_lt r u x q), P r u *)
intros x' p.
(* Goal: forall _ : merge_lt x' p x q, P x' p *)
intro.
(* Goal: P x' p *)
case H2.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: forall _ : O1 x' x, P x' p *)
intro.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: P x' p *)
generalize p.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: forall p : wfcrr S2, P x' p *)
assert (S1ind_wf_ : forall P : S1 -> Prop, (forall q : S1, (forall r : S1, O1 r q -> P r) -> P q) -> forall t : S1, P t).
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: forall p : wfcrr S2, P x' p *)
(* Goal: forall (P : forall _ : wfcrr S1, Prop) (_ : forall (q : wfcrr S1) (_ : forall (r : wfcrr S1) (_ : O1 r q), P r), P q) (t : wfcrr S1), P t *)
apply S1ind_wf.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: forall p : wfcrr S2, P x' p *)
apply S1ind_wf_ with (P := fun x : S1 => forall p1 : S2, P x p1).
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: forall (q : wfcrr S1) (_ : forall (r : wfcrr S1) (_ : O1 r q) (p1 : wfcrr S2), P r p1) (p1 : wfcrr S2), P q p1 *)
intros.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: P q0 p1 *)
apply H0.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: forall (r' : wfcrr S1) (_ : O1 r' q0) (t' : wfcrr S2), P r' t' *)
intros.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: P r' t' *)
apply H4.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
(* Goal: O1 r' q0 *)
assumption.
(* Goal: forall _ : and (E1 x' x) (O2 p q), P x' p *)
intro a.
(* Goal: P x' p *)
elim a.
(* Goal: forall (_ : E1 x' x) (_ : O2 p q), P x' p *)
intros.
(* Goal: P x' p *)
apply H1.
(* Goal: order S2 p q *)
assumption.
Qed.
End Merge_Order.
|
Require Export bbv.HexNotation.
Require Import bbv.WordScope.
Notation "'Ox' a" := (NToWord _ (hex a)) (at level 50).
Notation "sz ''h' a" := (NToWord sz (hex a)) (at level 50).
Goal 8'h"a" = WO~0~0~0~0~1~0~1~0.
Goal Ox"41" = WO~1~0~0~0~0~0~1.
Notation "sz ''b' a" := (natToWord sz (bin a)) (at level 50).
Notation "''b' a" := (natToWord _ (bin a)) (at level 50).
Goal 'b"00001010" = WO~0~0~0~0~1~0~1~0.
Goal 'b"1000001" = WO~1~0~0~0~0~0~1.
|
Require Export GeoCoq.Elements.OriginalProofs.euclidean_tactics.
Section Euclid.
Context `{Ax1:area}.
Lemma lemma_rectanglerotate :
forall A B C D,
RE A B C D ->
RE B C D A.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @RE Ax0 A B C D), @RE Ax0 B C D A *)
intros.
(* Goal: @RE Ax0 B C D A *)
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: @RE Ax0 B C D A *)
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: @RE Ax0 B C D A *)
assert (BetS C M A) by (conclude axiom_betweennesssymmetry).
(* Goal: @RE Ax0 B C D A *)
assert (CR B D C A) by (conclude_def CR ).
(* Goal: @RE Ax0 B C D A *)
assert (RE B C D A) by (conclude_def RE ).
(* Goal: @RE Ax0 B C D A *)
close.
Qed.
End Euclid.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Monoid_kernel.
Require Export Free_monoid.
Section Generated_monoid_def.
Variable M : MONOID.
Variable A : part_set M.
Definition generated_monoid : submonoid M :=
image_monoid_hom (FM_lift (inj_part A)).
End Generated_monoid_def.
Lemma generated_monoid_minimal :
forall (M : MONOID) (A : part_set M) (H : submonoid M),
included A H -> included (generated_monoid A) H.
Proof.
(* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))) (H : submonoid M) (_ : @included (sgroup_set (monoid_sgroup M)) A (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))), @included (sgroup_set (monoid_sgroup M)) (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
unfold included in |- *.
(* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))) (H : submonoid M) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) x A), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
simpl in |- *.
(* Goal: forall (M : monoid) (A : Predicate (sgroup_set (monoid_sgroup M))) (H : submonoid M) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) x A), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
intros M A H H' x H'0; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
elim H'0; intros x0; clear H'0.
(* Goal: forall _ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0)), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
generalize x; clear x.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
elim x0.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (c : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) c)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
intros c; try assumption.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) c)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
elim c.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (subtype_elt : Carrier (sgroup_set (monoid_sgroup M))) (subtype_prf : @Pred_fun (sgroup_set (monoid_sgroup M)) A subtype_elt) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A subtype_elt subtype_prf))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
simpl in |- *.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (subtype_elt : Carrier (sgroup_set (monoid_sgroup M))) (_ : @Pred_fun (sgroup_set (monoid_sgroup M)) A subtype_elt) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x subtype_elt)), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
intros y subtype_prf x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
apply in_part_comp_l with y; auto with algebra.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: forall (f : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (f0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) f0))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
intros f H'0 f0 H'1 x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
simpl in H'4.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
apply in_part_comp_l with (sgroup_law M (FM_lift_fun (inj_part A) f) (FM_lift_fun (inj_part A) f0)); auto with algebra.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
simpl in |- *.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : and True (@Equal (sgroup_set (monoid_sgroup M)) x (@monoid_unit (monoid_sgroup M) (monoid_on_def M)))), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
intros x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0.
(* Goal: @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M H)) *)
apply in_part_comp_l with (monoid_unit M); auto with algebra.
Qed.
Lemma generated_monoid_prop_included :
forall (M : MONOID) (A : part_set M), included A (generated_monoid A).
Proof.
(* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))), @included (sgroup_set (monoid_sgroup M)) A (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *)
unfold included in |- *.
(* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) x A), @in_part (sgroup_set (monoid_sgroup M)) x (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *)
simpl in |- *.
(* Goal: forall (M : monoid) (A : Predicate (sgroup_set (monoid_sgroup M))) (x : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) x A), @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0))) *)
intros M A x H'; try assumption.
(* Goal: @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x0 : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x0))) *)
exists (Var (V:=A) (Build_subtype (E:=M) (P:=A) (subtype_elt:=x) H')); split; [ idtac | try assumption ].
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A x H'))) *)
(* Goal: True *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) x (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) (@Build_subtype (sgroup_set (monoid_sgroup M)) A x H'))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup M)) x x *)
auto with algebra.
Qed.
Lemma generated_monoid_prop :
forall (M : MONOID) (A : part_set M) (y : M),
in_part y (generated_monoid A) ->
exists x : FM A, Equal y (FM_lift (inj_part A) x).
Proof.
(* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))) (y : Carrier (sgroup_set (monoid_sgroup M))) (_ : @in_part (sgroup_set (monoid_sgroup M)) y (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A)))), @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@Ap (sgroup_set (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))))) (sgroup_set (monoid_sgroup M)) (@sgroup_map (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))) (monoid_sgroup M) (@monoid_sgroup_hom (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) M (@FM_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A)))) x)) *)
simpl in |- *; auto with algebra.
(* Goal: forall (M : monoid) (A : Predicate (sgroup_set (monoid_sgroup M))) (y : Carrier (sgroup_set (monoid_sgroup M))) (_ : @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x)))), @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x)) *)
intros M A y H'; try assumption.
(* Goal: @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x)) *)
elim H'; intros x E; elim E; intros H'0 H'1; try exact H'1; clear E H'.
(* Goal: @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x)) *)
exists x; try assumption.
Qed.
Lemma generated_monoid_prop_rev :
forall (M : MONOID) (A : part_set M) (y : M),
(exists x : FM A, Equal y (FM_lift (inj_part A) x)) ->
in_part y (generated_monoid A).
Proof.
(* Goal: forall (M : Ob MONOID) (A : Carrier (part_set (sgroup_set (monoid_sgroup M)))) (y : Carrier (sgroup_set (monoid_sgroup M))) (_ : @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => @Equal (sgroup_set (monoid_sgroup M)) y (@Ap (sgroup_set (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))))) (sgroup_set (monoid_sgroup M)) (@sgroup_map (monoid_sgroup (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)))) (monoid_sgroup M) (@monoid_sgroup_hom (FreeMonoid (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) M (@FM_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A)))) x))), @in_part (sgroup_set (monoid_sgroup M)) y (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *)
intros M A y H'; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup M)) y (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *)
elim H'; intros x E; try exact E; clear H'.
(* Goal: @in_part (sgroup_set (monoid_sgroup M)) y (@subsgroup_part (monoid_sgroup M) (@submonoid_subsgroup M (@generated_monoid M A))) *)
simpl in |- *; auto with algebra.
(* Goal: @ex (FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A))) (fun x : FM (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) => and True (@Equal (sgroup_set (monoid_sgroup M)) y (@FM_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup M)) (@part (sgroup_set (monoid_sgroup M)) A)) M (@inj_part (sgroup_set (monoid_sgroup M)) A) x))) *)
exists x; split; [ idtac | try assumption ].
(* Goal: True *)
auto with algebra.
Qed.
Hint Resolve generated_monoid_minimal generated_monoid_prop_included
generated_monoid_prop_rev: algebra.
|
Require Import basis.
Require Import part1.
Require Import part2.
Require Import part3.
Require Import affinity.
Parameter Unort : Line -> Line -> Prop.
Axiom O1 : forall l m : Line, ConLn l m \/ Unort l m.
Axiom O2 : Separating Line (fun l m : Line => ConLn l m /\ Unort l m).
Definition Ort := Negation Line Unort.
Axiom
constructed_orthogonal :
forall (l : Line) (a : Point), {l' : Line | Ort l' l /\ Incident a l'}.
Definition ort : Line -> Point -> Line.
Proof.
(* Goal: forall (_ : Line) (_ : Point), Line *)
intros l a; elim (constructed_orthogonal l a).
(* Goal: forall (x : Line) (_ : and (Ort x l) (Incident a x)), Line *)
intros x H'; exact x.
Qed.
Axiom
constructive_uniqueness_for_orthogonals :
forall (l m n : Line) (a : Point),
DiLn l m -> (Apart a l \/ Apart a m) \/ Unort l n \/ Unort m n.
Theorem O3_i : forall (l : Line) (a : Point), Ort (ort l a) l.
Proof.
(* Goal: forall (l : Line) (a : Point), Ort (ort l a) l *)
intros l a.
(* Goal: Ort (ort l a) l *)
unfold ort at 1 in |- *.
(* Goal: Ort (@sig_rec Line (fun l' : Line => and (Ort l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Ort l' l) (Incident a l')) => Line) (fun (x : Line) (_ : and (Ort x l) (Incident a x)) => x) (constructed_orthogonal l a)) l *)
elim (constructed_orthogonal l a).
(* Goal: forall (x : Line) (p : and (Ort x l) (Incident a x)), Ort (@sig_rec Line (fun l' : Line => and (Ort l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Ort l' l) (Incident a l')) => Line) (fun (x0 : Line) (_ : and (Ort x0 l) (Incident a x0)) => x0) (@exist Line (fun l' : Line => and (Ort l' l) (Incident a l')) x p)) l *)
simpl in |- *; tauto.
Qed.
Theorem O3_ii : forall (l : Line) (a : Point), Incident a (ort l a).
Proof.
(* Goal: forall (l : Line) (a : Point), Incident a (ort l a) *)
intros l a.
(* Goal: Incident a (ort l a) *)
unfold ort at 1 in |- *.
(* Goal: Incident a (@sig_rec Line (fun l' : Line => and (Ort l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Ort l' l) (Incident a l')) => Line) (fun (x : Line) (_ : and (Ort x l) (Incident a x)) => x) (constructed_orthogonal l a)) *)
elim (constructed_orthogonal l a).
(* Goal: forall (x : Line) (p : and (Ort x l) (Incident a x)), Incident a (@sig_rec Line (fun l' : Line => and (Ort l' l) (Incident a l')) (fun _ : @sig Line (fun l' : Line => and (Ort l' l) (Incident a l')) => Line) (fun (x0 : Line) (_ : and (Ort x0 l) (Incident a x0)) => x0) (@exist Line (fun l' : Line => and (Ort l' l) (Incident a l')) x p)) *)
simpl in |- *; tauto.
Qed.
Hint Resolve O3_i O3_ii.
Theorem O4' :
forall (l m n : Line) (a : Point),
(Incident a l /\ Incident a m) /\ Ort l n /\ Ort m n -> EqLn l m.
Proof.
(* Goal: forall (l m n : Line) (a : Point) (_ : and (and (Incident a l) (Incident a m)) (and (Ort l n) (Ort m n))), EqLn l m *)
unfold Incident, Ort, EqLn, Negation in |- *.
(* Goal: forall (l m n : Line) (a : Point) (_ : and (and (not (Apart a l)) (not (Apart a m))) (and (not (Unort l n)) (not (Unort m n)))), not (DiLn l m) *)
intros l m n a.
(* Goal: forall _ : and (and (not (Apart a l)) (not (Apart a m))) (and (not (Unort l n)) (not (Unort m n))), not (DiLn l m) *)
generalize (constructive_uniqueness_for_orthogonals l m n a).
(* Goal: forall (_ : forall _ : DiLn l m, or (or (Apart a l) (Apart a m)) (or (Unort l n) (Unort m n))) (_ : and (and (not (Apart a l)) (not (Apart a m))) (and (not (Unort l n)) (not (Unort m n)))), not (DiLn l m) *)
tauto.
Qed.
Theorem Uniqueness_of_orthogonality :
forall (l m : Line) (a : Point), Incident a l /\ Ort l m -> EqLn l (ort m a).
Proof.
(* Goal: forall (l m : Line) (a : Point) (_ : and (Incident a l) (Ort l m)), EqLn l (ort m a) *)
intros l m a H'; elim H'; intros H'0 H'1; clear H'.
(* Goal: EqLn l (ort m a) *)
apply O4' with (n := m) (a := a); auto.
Qed.
Theorem Unort_reflexive : Reflexive Line Unort.
Proof.
(* Goal: Reflexive Line Unort *)
red in |- *.
(* Goal: forall x : Line, Unort x x *)
intro l.
(* Goal: Unort l l *)
generalize (O1 l l); intro H'.
(* Goal: Unort l l *)
elim H'; [ intro H'0; clear H' | trivial ].
(* Goal: Unort l l *)
elim apart_con.
(* Goal: forall (_ : Irreflexive Line ConLn) (_ : Separating Line ConLn), Unort l l *)
intro H'; elim (H' l); auto.
Qed.
Theorem cmp_unort_con :
forall l m n : Line, Unort l m -> ConLn l n \/ Unort m n.
Proof.
(* Goal: forall (l m n : Line) (_ : Unort l m), or (ConLn l n) (Unort m n) *)
intros l m n H'.
(* Goal: or (ConLn l n) (Unort m n) *)
generalize (O1 m n); intro H'1.
(* Goal: or (ConLn l n) (Unort m n) *)
elim H'1; [ intro H'0; clear H'1 | auto ].
(* Goal: or (ConLn l n) (Unort m n) *)
elim apart_con.
(* Goal: forall (_ : Irreflexive Line ConLn) (_ : Separating Line ConLn), or (ConLn l n) (Unort m n) *)
intros H'1 H'2; red in H'2.
(* Goal: or (ConLn l n) (Unort m n) *)
lapply (H'2 m n l); [ intro H'6 | assumption ].
(* Goal: or (ConLn l n) (Unort m n) *)
elim H'6; [ intro H'3; clear H'6 | auto ].
(* Goal: or (ConLn l n) (Unort m n) *)
generalize O2.
(* Goal: forall _ : Separating Line (fun l m : Line => and (ConLn l m) (Unort l m)), or (ConLn l n) (Unort m n) *)
intro H'4; red in H'4.
(* Goal: or (ConLn l n) (Unort m n) *)
lapply (H'4 l m n); intuition.
Qed.
Theorem cmp_unort_diln :
forall l m n : Line, Unort l m -> DiLn l n \/ Unort m n.
Proof.
(* Goal: forall (l m n : Line) (_ : Unort l m), or (DiLn l n) (Unort m n) *)
intros l m n H'.
(* Goal: or (DiLn l n) (Unort m n) *)
lapply (cmp_unort_con l m n); [ intro H'3 | assumption ]; auto.
(* Goal: or (DiLn l n) (Unort m n) *)
intuition.
Qed.
Theorem Unort_symmetric : Symmetric Line Unort.
Proof.
(* Goal: Symmetric Line Unort *)
unfold Symmetric at 1 in |- *.
(* Goal: forall (x y : Line) (_ : Unort x y), Unort y x *)
intros l m H'.
(* Goal: Unort m l *)
lapply (cmp_unort_con l m l); [ intro H'3; elim H'3; [ intro H'4; clear H'3 | trivial ] | idtac ]; auto.
(* Goal: Unort m l *)
cut (Irreflexive Line ConLn); auto.
(* Goal: Irreflexive Line ConLn *)
(* Goal: forall _ : Irreflexive Line ConLn, Unort m l *)
intro H'0; red in H'0.
(* Goal: Irreflexive Line ConLn *)
(* Goal: Unort m l *)
elim (H'0 l); auto.
(* Goal: Irreflexive Line ConLn *)
elim apart_con; auto.
Qed.
Theorem thm8_6 : forall l m n : Line, ConLn l m -> Unort l n \/ Unort m n.
Proof.
(* Goal: forall (l m n : Line) (_ : ConLn l m), or (Unort l n) (Unort m n) *)
intros l m n H'.
(* Goal: or (Unort l n) (Unort m n) *)
lapply (Convergent_imp_distinct l m); [ intro H'2 | assumption ].
(* Goal: or (Unort l n) (Unort m n) *)
lapply (constructive_uniqueness_for_orthogonals l m n (pt (Twol l m H'))); [ intro H'5 | assumption ].
(* Goal: or (Unort l n) (Unort m n) *)
elim H'5; [ intro H'0; clear H'5 | trivial ].
(* Goal: or (Unort l n) (Unort m n) *)
generalize (inc_pt1 (Twol l m H')); generalize (inc_pt2 (Twol l m H')).
(* Goal: forall (_ : Incident (pt (Twol l m H')) (line2 (Twol l m H'))) (_ : Incident (pt (Twol l m H')) (line1 (Twol l m H'))), or (Unort l n) (Unort m n) *)
simpl in |- *; unfold Incident, Negation in |- *; tauto.
Qed.
Definition Oblique : Relation Line :=
fun l m : Line => ConLn l m /\ Unort l m.
Theorem apart_obl : Apartness Line Oblique.
Proof.
(* Goal: Apartness Line Oblique *)
apply Definition_of_apartness.
(* Goal: Separating Line Oblique *)
(* Goal: Irreflexive Line Oblique *)
unfold Irreflexive, Negation, Oblique in |- *.
(* Goal: Separating Line Oblique *)
(* Goal: forall x : Line, not (and (ConLn x x) (Unort x x)) *)
intro l; red in |- *; intro H'; elim H'; intros H'0 H'1; clear H'.
(* Goal: Separating Line Oblique *)
(* Goal: False *)
elim apart_con.
(* Goal: Separating Line Oblique *)
(* Goal: forall (_ : Irreflexive Line ConLn) (_ : Separating Line ConLn), False *)
intros H' H'2; apply (H' l); assumption.
(* Goal: Separating Line Oblique *)
unfold Oblique in |- *; exact O2.
Qed.
Proof.
apply Definition_of_apartness.
Theorem ort_ort_like_par_i :
forall (l : Line) (a : Point), Incident a (ort (ort l a) a).
Proof.
(* Goal: forall (l : Line) (a : Point), Incident a (ort (ort l a) a) *)
auto.
Qed.
Theorem thm8_8 :
forall (l : Line) (a b : Point),
Incident b (ort l a) -> EqLn (ort l a) (ort l b).
Proof.
(* Goal: forall (l : Line) (a b : Point) (_ : Incident b (ort l a)), EqLn (ort l a) (ort l b) *)
intros l a b H'.
(* Goal: EqLn (ort l a) (ort l b) *)
apply O4' with (n := l) (a := b); auto.
Qed.
Section delicate.
Variable a : Point.
Variable l : Line.
Variable H : ConLn l (ort (ort l a) a).
Let t : Twolines := Twol l (ort (ort l a) a) H.
Let b : Point := pt t.
Theorem thm8_9_aux : False.
Proof.
(* Goal: False *)
generalize (inc_pt1 t); intro H'0; simpl in H'0.
(* Goal: False *)
generalize (inc_pt2 t); intro H'1; simpl in H'1.
(* Goal: False *)
lapply (Convergent_imp_distinct l (ort (ort l a) a)); [ intro H'4 | assumption ].
(* Goal: False *)
lapply (thm8_8 (ort l a) a b); [ intro H'6 | assumption ].
(* Goal: False *)
lapply (cong_eqln_diln l (ort (ort l a) a) (ort (ort l a) b)); [ intro H'7; lapply H'7; [ intro H'8; clear H'7 | clear H'7 ] | idtac ]; auto.
(* Goal: False *)
lapply (constructive_uniqueness_for_orthogonals l (ort (ort l a) b) (ort l a) b); [ intro H'9 | assumption ].
(* Goal: False *)
elim H'9; [ intro H'2; elim H'2; [ intro H'3; clear H'2 H'9 | intro H'3; clear H'2 H'9 ] | intro H'2; clear H'9 ].
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
unfold b at 1 in H'3; elim H'0; auto.
(* Goal: False *)
(* Goal: False *)
elim (O3_ii (ort l a) b); auto.
(* Goal: False *)
generalize Unort_symmetric.
(* Goal: forall _ : Symmetric Line Unort, False *)
intro H'; red in H'.
(* Goal: False *)
elim H'2; (intro H'3; clear H'2).
(* Goal: False *)
(* Goal: False *)
elim (O3_i l a); auto.
(* Goal: False *)
elim (O3_i (ort l a) b); auto.
Qed.
End delicate.
Theorem thm8_9 : forall (l : Line) (a : Point), Par l (ort (ort l a) a).
Proof.
(* Goal: forall (l : Line) (a : Point), Par l (ort (ort l a) a) *)
intros l a; unfold Par, Negation in |- *.
(* Goal: not (ConLn l (ort (ort l a) a)) *)
red in |- *; intro H'; apply (thm8_9_aux a l); trivial.
Qed.
Hint Resolve thm8_9.
Theorem thm8_10 :
forall (l : Line) (a : Point), EqLn (par l a) (ort (ort l a) a).
Proof.
(* Goal: forall (l : Line) (a : Point), EqLn (par l a) (ort (ort l a) a) *)
intros l a; apply sym_EqLn; auto.
Qed.
|
Require Import syntax.
Require Import List.
Require Import utils.
Require Import freevars.
Require Import typecheck.
Require Import environments.
Require Import OSrules.
Goal forall A : OS_env, TE_Dom (OS_Dom_ty A) = OS_Dom A.
simple induction A; intros.
simpl in |- *; reflexivity.
simpl in |- *; elim H; reflexivity.
Save TEDomDomty_OSDom.
Goal
forall (v : vari) (t : ty) (H : ty_env),
mapsto v t H -> member vari v (TE_Dom H).
simple induction H; simpl in |- *.
intro; assumption.
intros; elim H1; intro.
left; elim H2; intros; assumption.
right; elim H2; intro; exact H0.
Save vtinH_vinDomH.
Goal
forall (H : ty_env) (e : tm) (t : ty),
TC H e t -> forall v : vari, FV v e -> member vari v (TE_Dom H).
simple induction 1; simpl in |- *; intros.
absurd (FV v o). apply inv_FV_o. assumption.
absurd (FV v ttt). apply inv_FV_ttt. assumption.
absurd (FV v fff). apply inv_FV_fff. assumption.
apply H3. apply inv_FV_succ; assumption.
apply H3. apply inv_FV_prd; assumption.
apply H3. apply inv_FV_is_o; assumption.
specialize inv_FV_var with (1 := H3); intro Q.
rewrite Q; apply vtinH_vinDomH with t0; assumption.
specialize inv_FV_appl with (1 := H6).
simple induction 1; intro F.
apply H3; assumption.
apply H5; assumption.
specialize inv_FV_abs with (1 := H4); simple induction 1; intros.
elim (H3 v0).
intro; absurd (v0 = v); assumption || symmetry in |- *; assumption.
intro; assumption.
assumption.
specialize inv_FV_cond with (1 := H8); simple induction 1.
intro; apply H3; assumption.
simple induction 1; intro.
apply H5; assumption.
apply H7; assumption.
specialize inv_FV_fix with (1 := H4); simple induction 1; intros.
elim (H3 v0).
intro; absurd (v0 = v); assumption || symmetry in |- *; assumption.
intro; assumption.
assumption.
specialize inv_FV_clos with (1 := H6); simple induction 1; intros.
apply H3; assumption.
elim H8; intros.
elim (H5 v0).
intro; absurd (v0 = v); assumption || symmetry in |- *; assumption.
intro; assumption.
assumption.
Save TCHet_FVeinDomH.
Goal
forall c c' : config,
OSred c c' -> OS_Dom_ty (cfgenv c) = OS_Dom_ty (cfgenv c').
simple induction 1; simpl in |- *; intros.
reflexivity. reflexivity. reflexivity. reflexivity.
assumption. assumption. assumption. assumption. assumption.
elim H2; reflexivity.
elim H3; reflexivity.
transitivity (OS_Dom_ty A'); assumption.
transitivity (OS_Dom_ty A'); assumption.
transitivity (OS_Dom_ty A'); assumption.
assumption.
replace (OS_Dom_ty A) with (tail ((x, t) :: OS_Dom_ty A)).
replace (OS_Dom_ty A') with (tail ((x, t) :: OS_Dom_ty A')).
apply (f_equal (tail (A:=VT))); assumption.
simpl in |- *; reflexivity.
simpl in |- *; reflexivity.
replace (OS_Dom_ty A) with (tail ((x, t) :: OS_Dom_ty A)).
replace (OS_Dom_ty A') with (tail ((x, t) :: OS_Dom_ty A')).
apply (f_equal (tail (A:=VT))); assumption.
simpl in |- *; reflexivity.
simpl in |- *; reflexivity.
Save dom_pres.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Sgroup_facts.
Require Export Parts.
Section Def.
Variable G : SGROUP.
Section Sub_sgroup.
Variable H : part_set G.
Hypothesis
Hprop :
forall x y : G,
in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H.
Definition subsgroup_law : law_of_composition H.
Proof.
(* Goal: Carrier (law_of_composition (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) *)
unfold law_of_composition in |- *.
(* Goal: Carrier (@Hom SET (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) *)
apply (Build_Map (A:=cart (set_of_subtype_image (part H)) (set_of_subtype_image (part H))) (B:=H) (Ap:=fun x : cart (set_of_subtype_image (part H)) (set_of_subtype_image (part H)) => Build_subtype (Hprop (subtype_prf (proj1 x)) (subtype_prf (proj2 x))))).
(* Goal: @fun_compatible (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (fun x : Carrier (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) => @Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (@Hprop (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)))) *)
red in |- *.
(* Goal: forall (x y : Carrier (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)))) (_ : @Equal (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) x y), @Equal (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (@Hprop (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)))) (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) (@Hprop (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_prf (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_prf (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)))) *)
simpl in |- *.
(* Goal: forall (x y : cart_type (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (_ : @cart_eq (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x y), @subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (@Hprop (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)))) (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) (@Hprop (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_prf (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_prf (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)))) *)
unfold cart_eq, subtype_image_equal in |- *.
(* Goal: forall (x y : cart_type (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (_ : and (@Equal (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@Equal (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))), @Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (@Hprop (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_prf (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))))) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) (@Hprop (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_prf (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_prf (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))))) *)
simpl in |- *.
(* Goal: forall (x y : cart_type (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (_ : and (@subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x) (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))), @Equal (sgroup_set G) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) *)
unfold cart_eq, subtype_image_equal in |- *.
(* Goal: forall (x y : cart_type (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (_ : and (@Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@cart_l (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) (@Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@cart_r (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)))), @Equal (sgroup_set G) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x))) (sgroup_law G (@subtype_elt (sgroup_set G) H (@proj1 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y)) (@subtype_elt (sgroup_set G) H (@proj2 (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y))) *)
intuition.
Qed.
Definition subsgroup_sgroup : sgroup.
Proof.
(* Goal: sgroup *)
apply (Build_sgroup (sgroup_set:=H)).
(* Goal: sgroup_on (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) *)
apply (Build_sgroup_on (E:=H) (sgroup_law_map:=subsgroup_law)).
(* Goal: @associative (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) subsgroup_law *)
red in |- *.
(* Goal: forall x y z : Carrier (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)), @Equal (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@Ap (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) subsgroup_law (@couple (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@Ap (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) subsgroup_law (@couple (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x y)) z)) (@Ap (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) subsgroup_law (@couple (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) x (@Ap (cart (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H))) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) subsgroup_law (@couple (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) (@set_of_subtype_image (sgroup_set G) (@part (sgroup_set G) H)) y z)))) *)
simpl in |- *.
(* Goal: forall x y z : @subtype (sgroup_set G) H, @subtype_image_equal (sgroup_set G) (@subtype (sgroup_set G) H) (@subtype_elt (sgroup_set G) H) (@Build_subtype (sgroup_set G) H (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (@Hprop (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z) (@Hprop (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H x) (@subtype_prf (sgroup_set G) H y)) (@subtype_prf (sgroup_set G) H z))) (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) (@Hprop (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z)) (@subtype_prf (sgroup_set G) H x) (@Hprop (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z) (@subtype_prf (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H z)))) *)
unfold subtype_image_equal in |- *.
(* Goal: forall x y z : @subtype (sgroup_set G) H, @Equal (sgroup_set G) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (@Hprop (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z) (@Hprop (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H x) (@subtype_prf (sgroup_set G) H y)) (@subtype_prf (sgroup_set G) H z)))) (@subtype_elt (sgroup_set G) H (@Build_subtype (sgroup_set G) H (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) (@Hprop (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z)) (@subtype_prf (sgroup_set G) H x) (@Hprop (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z) (@subtype_prf (sgroup_set G) H y) (@subtype_prf (sgroup_set G) H z))))) *)
simpl in |- *.
(* Goal: forall x y z : @subtype (sgroup_set G) H, @Equal (sgroup_set G) (sgroup_law G (sgroup_law G (@subtype_elt (sgroup_set G) H x) (@subtype_elt (sgroup_set G) H y)) (@subtype_elt (sgroup_set G) H z)) (sgroup_law G (@subtype_elt (sgroup_set G) H x) (sgroup_law G (@subtype_elt (sgroup_set G) H y) (@subtype_elt (sgroup_set G) H z))) *)
auto with algebra.
Qed.
End Sub_sgroup.
Record subsgroup : Type :=
{subsgroup_part : Predicate G;
subsgroup_prop :
forall x y : G,
in_part x subsgroup_part ->
in_part y subsgroup_part -> in_part (sgroup_law _ x y) subsgroup_part}.
Definition sgroup_of_subsgroup (H : subsgroup) :=
subsgroup_sgroup (subsgroup_prop (s:=H)).
End Def.
Coercion sgroup_of_subsgroup : subsgroup >-> sgroup.
Coercion subsgroup_part : subsgroup >-> Predicate.
Section Injection.
Variable G : SGROUP.
Variable H : subsgroup G.
Lemma subsgroup_in_prop :
forall x y : G, in_part x H -> in_part y H -> in_part (sgroup_law _ x y) H.
Proof.
(* Goal: forall (x y : Carrier (sgroup_set G)) (_ : @in_part (sgroup_set G) x (@subsgroup_part G H)) (_ : @in_part (sgroup_set G) y (@subsgroup_part G H)), @in_part (sgroup_set G) (sgroup_law G x y) (@subsgroup_part G H) *)
intros x y H' H'0; try assumption.
(* Goal: @in_part (sgroup_set G) (sgroup_law G x y) (@subsgroup_part G H) *)
apply (subsgroup_prop (G:=G) (s:=H)); auto with algebra.
Qed.
Definition inj_subsgroup : Hom (H:SGROUP) G.
Proof.
(* Goal: Carrier (@Hom SGROUP (@sgroup_of_subsgroup G H : Ob SGROUP) G) *)
apply (Build_sgroup_hom (E:=H) (F:=G) (sgroup_map:=inj_part H)).
(* Goal: @sgroup_hom_prop (@sgroup_of_subsgroup G H) G (@inj_part (sgroup_set G) (@subsgroup_part G H)) *)
red in |- *.
(* Goal: forall x y : Carrier (sgroup_set (@sgroup_of_subsgroup G H)), @Equal (sgroup_set G) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@inj_part (sgroup_set G) (@subsgroup_part G H)) (sgroup_law (@sgroup_of_subsgroup G H) x y)) (sgroup_law G (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@inj_part (sgroup_set G) (@subsgroup_part G H)) x) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@inj_part (sgroup_set G) (@subsgroup_part G H)) y)) *)
auto with algebra.
Qed.
Lemma inj_subgroup_injective : injective inj_subsgroup.
Proof.
(* Goal: @injective (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) *)
red in |- *.
(* Goal: forall (x y : Carrier (sgroup_set (@sgroup_of_subsgroup G H))) (_ : @Equal (sgroup_set G) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) x) (@Ap (sgroup_set (@sgroup_of_subsgroup G H)) (sgroup_set G) (@sgroup_map (@sgroup_of_subsgroup G H) G inj_subsgroup) y)), @Equal (sgroup_set (@sgroup_of_subsgroup G H)) x y *)
auto with algebra.
Qed.
End Injection.
Hint Resolve subsgroup_in_prop inj_subgroup_injective: algebra. |
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCorder.
Section Euclid.
Context `{Ax:euclidean_neutral}.
Lemma lemma_samesidesymmetric :
forall A B P Q,
OS P Q A B ->
OS Q P A B /\ OS P Q B A /\ OS Q P B A.
Proof.
(* Goal: forall (A B P Q : @Point Ax) (_ : @OS Ax P Q A B), and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
intros.
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
let Tf:=fresh in assert (Tf:exists E F G, (Col A B E /\ Col A B F /\ BetS P E G /\ BetS Q F G /\ nCol A B P /\ nCol A B Q)) by (conclude_def OS );destruct Tf as [E[F[G]]];spliter.
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
assert (OS Q P A B) by (conclude_def OS ).
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
assert (Col B A E) by (forward_using lemma_collinearorder).
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
assert (Col B A F) by (forward_using lemma_collinearorder).
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
assert (nCol B A P) by (forward_using lemma_NCorder).
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
assert (nCol B A Q) by (forward_using lemma_NCorder).
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
assert (OS P Q B A) by (conclude_def OS ).
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
assert (OS Q P B A) by (conclude_def OS ).
(* Goal: and (@OS Ax Q P A B) (and (@OS Ax P Q B A) (@OS Ax Q P B A)) *)
close.
Qed.
End Euclid.
|
Require Import Le.
Require Import Lt.
Require Import Plus.
Require Import Gt.
Require Import Minus.
Require Import Mult.
Require Import sur_les_relations.
Require Import TS.
Require Import sigma_lift.
Require Import comparith.
Require Import Pol1.
Require Import Pol2.
Section ordre.
Variable A : Set.
Variable f g : A -> nat.
Definition e_lexfg (a b : A) := f a > f b \/ f a = f b /\ g a > g b.
Lemma lexfg_notherian : explicit_noetherian _ e_lexfg.
Proof.
(* Goal: explicit_noetherian A e_lexfg *)
unfold explicit_noetherian in |- *; unfold universal in |- *; unfold hereditary in |- *; unfold adjoint in |- *; unfold sub in |- *; unfold a_set in |- *.
(* Goal: forall (A0 : forall _ : A, Prop) (_ : forall (x : A) (_ : forall (x0 : A) (_ : e_lexfg x x0), A0 x0), A0 x) (x : A), A0 x *)
intros P H.
(* Goal: forall x : A, P x *)
cut (forall (n m : nat) (a : A), n > f a \/ n = f a /\ m > g a -> P a).
(* Goal: forall (n m : nat) (a : A) (_ : or (gt n (f a)) (and (@eq nat n (f a)) (gt m (g a)))), P a *)
(* Goal: forall (_ : forall (n m : nat) (a : A) (_ : or (gt n (f a)) (and (@eq nat n (f a)) (gt m (g a)))), P a) (x : A), P x *)
intros H0 x; apply (H0 (S (f x)) 0).
(* Goal: forall (n m : nat) (a : A) (_ : or (gt n (f a)) (and (@eq nat n (f a)) (gt m (g a)))), P a *)
(* Goal: or (gt (S (f x)) (f x)) (and (@eq nat (S (f x)) (f x)) (gt O (g x))) *)
auto with arith.
(* Goal: forall (n m : nat) (a : A) (_ : or (gt n (f a)) (and (@eq nat n (f a)) (gt m (g a)))), P a *)
simple induction n; simple induction m.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt O (g a)))), P a *)
simple induction 1; intro H1.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *)
(* Goal: P a *)
(* Goal: P a *)
absurd (0 > f a); auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *)
(* Goal: P a *)
elim H1; intros.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *)
(* Goal: P a *)
absurd (0 > g a); auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt O (f a)) (and (@eq nat O (f a)) (gt (S n) (g a)))), P a *)
intros y H' a H0.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: P a *)
apply H; intros b lexfgab.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: P b *)
apply H'; right.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
elim H0; intro H1.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
absurd (0 > f a); auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
elim H1; intros H2 H3; elim lexfgab; intro H4.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
absurd (0 > f b).
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
(* Goal: gt O (f b) *)
(* Goal: not (gt O (f b)) *)
auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
(* Goal: gt O (f b) *)
rewrite H2; assumption.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
elim H4; intros.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: and (@eq nat O (f b)) (gt y (g b)) *)
split.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: gt y (g b) *)
(* Goal: @eq nat O (f b) *)
rewrite H2; assumption.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
(* Goal: gt y (g b) *)
apply le_gt_trans with (g a); auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt O (g a)))), P a *)
intros a H0'; apply H; intros b lexfgab.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: P b *)
apply (H0 (g a) b); elim H0'; intro H1.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
elim lexfgab; intro H2.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
left; apply le_gt_trans with (f a); auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
elim H2; intros H3 H4; elim (gt_S n0 (f a) H1); intro H5.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
left; elim H3; assumption.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
right; split.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: gt (g a) (g b) *)
(* Goal: @eq nat n0 (f b) *)
elim H3; auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
(* Goal: gt (g a) (g b) *)
assumption.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
elim H1; intros H2 H3.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
(* Goal: or (gt n0 (f b)) (and (@eq nat n0 (f b)) (gt (g a) (g b))) *)
absurd (0 > g a); auto with arith.
(* Goal: forall (n : nat) (_ : forall (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt n (g a)))), P a) (a : A) (_ : or (gt (S n0) (f a)) (and (@eq nat (S n0) (f a)) (gt (S n) (g a)))), P a *)
intros y0 H0' a H1; apply H; intros b lexfgab.
(* Goal: P b *)
apply H0'; elim H1; elim lexfgab; intros H2 H3.
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
left; apply le_gt_trans with (f a); auto with arith.
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
elim H2; intros H4 H5; left; elim H4; assumption.
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
elim H3; intros H4 H5; left; rewrite H4; assumption.
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
elim H2; intros H4 H5; elim H3; intros H6 H7.
(* Goal: or (gt (S n0) (f b)) (and (@eq nat (S n0) (f b)) (gt y0 (g b))) *)
right; split.
(* Goal: gt y0 (g b) *)
(* Goal: @eq nat (S n0) (f b) *)
apply trans_equal with (f a); assumption.
(* Goal: gt y0 (g b) *)
apply le_gt_trans with (g a); auto with arith.
Qed.
End ordre.
Notation lexfg := (e_lexfg _) (only parsing).
Theorem lexfg_systemSL :
forall (b : wsort) (M N : TS b),
e_systemSL _ M N -> e_lexfg _ (e_P1 b) (e_P2 b) M N.
Proof.
(* Goal: forall (b : wsort) (M N : TS b) (_ : e_systemSL b M N), e_lexfg (TS b) (e_P1 b) (e_P2 b) M N *)
red in |- *; simple induction 1; auto with arith.
Qed.
Hint Resolve lexfg_systemSL.
Theorem lexfg_app_l :
forall a a' b : terms,
e_lexfg _ (e_P1 wt) (e_P2 wt) a a' ->
e_lexfg _ (e_P1 wt) (e_P2 wt) (app a b) (app a' b).
Proof.
(* Goal: forall (a a' b : terms) (_ : e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) a a'), e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) (app a b) (app a' b) *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 wt a) (e_P1 wt a')) (gt (e_P2 wt a) (e_P2 wt a')), or (gt (Nat.add (e_P1 wt a) (e_P1 wt b)) (Nat.add (e_P1 wt a') (e_P1 wt b))) (and (@eq nat (Nat.add (e_P1 wt a) (e_P1 wt b)) (Nat.add (e_P1 wt a') (e_P1 wt b))) (gt (S (Nat.add (e_P2 wt a) (e_P2 wt b))) (S (Nat.add (e_P2 wt a') (e_P2 wt b))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_app_l.
Theorem lexfg_app_r :
forall a b b' : terms,
e_lexfg _ (e_P1 wt) (e_P2 wt) b b' ->
e_lexfg _ (e_P1 wt) (e_P2 wt) (app a b) (app a b').
Proof.
(* Goal: forall (a b b' : terms) (_ : e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) b b'), e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) (app a b) (app a b') *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 wt b) (e_P1 wt b')) (gt (e_P2 wt b) (e_P2 wt b')), or (gt (Nat.add (e_P1 wt a) (e_P1 wt b)) (Nat.add (e_P1 wt a) (e_P1 wt b'))) (and (@eq nat (Nat.add (e_P1 wt a) (e_P1 wt b)) (Nat.add (e_P1 wt a) (e_P1 wt b'))) (gt (S (Nat.add (e_P2 wt a) (e_P2 wt b))) (S (Nat.add (e_P2 wt a) (e_P2 wt b'))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_app_r.
Theorem lexfg_lambda :
forall a a' : terms,
e_lexfg _ (e_P1 wt) (e_P2 wt) a a' ->
e_lexfg _ (e_P1 wt) (e_P2 wt) (lambda a) (lambda a').
Proof.
(* Goal: forall (a a' : terms) (_ : e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) a a'), e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) (lambda a) (lambda a') *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 wt a) (e_P1 wt a')) (gt (e_P2 wt a) (e_P2 wt a')), or (gt (Nat.add (e_P1 wt a) (S (S O))) (Nat.add (e_P1 wt a') (S (S O)))) (and (@eq nat (Nat.add (e_P1 wt a) (S (S O))) (Nat.add (e_P1 wt a') (S (S O)))) (gt (Nat.add (e_P2 wt a) (Nat.add (e_P2 wt a) O)) (Nat.add (e_P2 wt a') (Nat.add (e_P2 wt a') O)))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_lambda.
Theorem lexfg_env_t :
forall (a a' : terms) (s : sub_explicits),
e_lexfg _ (e_P1 wt) (e_P2 wt) a a' ->
e_lexfg _ (e_P1 wt) (e_P2 wt) (env a s) (env a' s).
Proof.
(* Goal: forall (a a' : terms) (s : sub_explicits) (_ : e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) a a'), e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) (env a s) (env a' s) *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 wt a) (e_P1 wt a')) (gt (e_P2 wt a) (e_P2 wt a')), or (gt (Nat.mul (e_P1 wt a) (e_P1 ws s)) (Nat.mul (e_P1 wt a') (e_P1 ws s))) (and (@eq nat (Nat.mul (e_P1 wt a) (e_P1 ws s)) (Nat.mul (e_P1 wt a') (e_P1 ws s))) (gt (Nat.mul (e_P2 wt a) (S (e_P2 ws s))) (Nat.mul (e_P2 wt a') (S (e_P2 ws s))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_env_t.
Theorem lexfg_env_s :
forall (a : terms) (s s' : sub_explicits),
e_lexfg _ (e_P1 ws) (e_P2 ws) s s' ->
e_lexfg _ (e_P1 wt) (e_P2 wt) (env a s) (env a s').
Proof.
(* Goal: forall (a : terms) (s s' : sub_explicits) (_ : e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) s s'), e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) (env a s) (env a s') *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 ws s) (e_P1 ws s')) (gt (e_P2 ws s) (e_P2 ws s')), or (gt (Nat.mul (e_P1 wt a) (e_P1 ws s)) (Nat.mul (e_P1 wt a) (e_P1 ws s'))) (and (@eq nat (Nat.mul (e_P1 wt a) (e_P1 ws s)) (Nat.mul (e_P1 wt a) (e_P1 ws s'))) (gt (Nat.mul (e_P2 wt a) (S (e_P2 ws s))) (Nat.mul (e_P2 wt a) (S (e_P2 ws s'))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_env_s.
Theorem lexfg_cons_t :
forall (a a' : terms) (s : sub_explicits),
e_lexfg _ (e_P1 wt) (e_P2 wt) a a' ->
e_lexfg _ (e_P1 ws) (e_P2 ws) (cons a s) (cons a' s).
Proof.
(* Goal: forall (a a' : terms) (s : sub_explicits) (_ : e_lexfg (TS wt) (e_P1 wt) (e_P2 wt) a a'), e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) (cons a s) (cons a' s) *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 wt a) (e_P1 wt a')) (gt (e_P2 wt a) (e_P2 wt a')), or (gt (Nat.add (e_P1 wt a) (e_P1 ws s)) (Nat.add (e_P1 wt a') (e_P1 ws s))) (and (@eq nat (Nat.add (e_P1 wt a) (e_P1 ws s)) (Nat.add (e_P1 wt a') (e_P1 ws s))) (gt (S (Nat.add (e_P2 wt a) (e_P2 ws s))) (S (Nat.add (e_P2 wt a') (e_P2 ws s))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_cons_t.
Theorem lexfg_cons_s :
forall (a : terms) (s s' : sub_explicits),
e_lexfg _ (e_P1 ws) (e_P2 ws) s s' ->
e_lexfg _ (e_P1 ws) (e_P2 ws) (cons a s) (cons a s').
Proof.
(* Goal: forall (a : terms) (s s' : sub_explicits) (_ : e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) s s'), e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) (cons a s) (cons a s') *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 ws s) (e_P1 ws s')) (gt (e_P2 ws s) (e_P2 ws s')), or (gt (Nat.add (e_P1 wt a) (e_P1 ws s)) (Nat.add (e_P1 wt a) (e_P1 ws s'))) (and (@eq nat (Nat.add (e_P1 wt a) (e_P1 ws s)) (Nat.add (e_P1 wt a) (e_P1 ws s'))) (gt (S (Nat.add (e_P2 wt a) (e_P2 ws s))) (S (Nat.add (e_P2 wt a) (e_P2 ws s'))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_cons_s.
Theorem lexfg_comp_l :
forall s s' t : sub_explicits,
e_lexfg _ (e_P1 ws) (e_P2 ws) s s' ->
e_lexfg _ (e_P1 ws) (e_P2 ws) (comp s t) (comp s' t).
Proof.
(* Goal: forall (s s' t : sub_explicits) (_ : e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) s s'), e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) (comp s t) (comp s' t) *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 ws s) (e_P1 ws s')) (gt (e_P2 ws s) (e_P2 ws s')), or (gt (Nat.mul (e_P1 ws s) (e_P1 ws t)) (Nat.mul (e_P1 ws s') (e_P1 ws t))) (and (@eq nat (Nat.mul (e_P1 ws s) (e_P1 ws t)) (Nat.mul (e_P1 ws s') (e_P1 ws t))) (gt (Nat.mul (e_P2 ws s) (S (e_P2 ws t))) (Nat.mul (e_P2 ws s') (S (e_P2 ws t))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_comp_l.
Theorem lexfg_comp_r :
forall s t t' : sub_explicits,
e_lexfg _ (e_P1 ws) (e_P2 ws) t t' ->
e_lexfg _ (e_P1 ws) (e_P2 ws) (comp s t) (comp s t').
Proof.
(* Goal: forall (s t t' : sub_explicits) (_ : e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) t t'), e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) (comp s t) (comp s t') *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; auto with arith.
(* Goal: forall _ : and (@eq nat (e_P1 ws t) (e_P1 ws t')) (gt (e_P2 ws t) (e_P2 ws t')), or (gt (Nat.mul (e_P1 ws s) (e_P1 ws t)) (Nat.mul (e_P1 ws s) (e_P1 ws t'))) (and (@eq nat (Nat.mul (e_P1 ws s) (e_P1 ws t)) (Nat.mul (e_P1 ws s) (e_P1 ws t'))) (gt (Nat.mul (e_P2 ws s) (S (e_P2 ws t))) (Nat.mul (e_P2 ws s) (S (e_P2 ws t'))))) *)
intros; elim H0; auto with arith.
Qed.
Hint Resolve lexfg_comp_r.
Theorem lexfg_lift :
forall s s' : sub_explicits,
e_lexfg _ (e_P1 ws) (e_P2 ws) s s' ->
e_lexfg _ (e_P1 ws) (e_P2 ws) (lift s) (lift s').
Proof.
(* Goal: forall (s s' : sub_explicits) (_ : e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) s s'), e_lexfg (TS ws) (e_P1 ws) (e_P2 ws) (lift s) (lift s') *)
unfold e_lexfg in |- *; simple induction 1; simpl in |- *; intros.
(* Goal: or (gt (e_P1 ws s) (e_P1 ws s')) (and (@eq nat (e_P1 ws s) (e_P1 ws s')) (gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))))) *)
(* Goal: or (gt (e_P1 ws s) (e_P1 ws s')) (and (@eq nat (e_P1 ws s) (e_P1 ws s')) (gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))))) *)
auto with arith.
(* Goal: or (gt (e_P1 ws s) (e_P1 ws s')) (and (@eq nat (e_P1 ws s) (e_P1 ws s')) (gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))))) *)
elim H0; intros; right; split.
(* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *)
(* Goal: @eq nat (e_P1 ws s) (e_P1 ws s') *)
assumption.
(* Goal: gt (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) (Nat.add (e_P2 ws s) O)))) (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') (Nat.add (e_P2 ws s') O)))) *)
change (4 * e_P2 _ s > 4 * e_P2 _ s') in |- *.
(* Goal: gt (Nat.mul (S (S (S (S O)))) (e_P2 ws s)) (Nat.mul (S (S (S (S O)))) (e_P2 ws s')) *)
auto with arith.
Qed.
Hint Resolve lexfg_lift.
Theorem lexfg_relSL :
forall (b : wsort) (M N : TS b),
e_relSL _ M N -> e_lexfg _ (e_P1 b) (e_P2 b) M N.
Proof.
(* Goal: forall (b : wsort) (M N : TS b) (_ : e_relSL b M N), e_lexfg (TS b) (e_P1 b) (e_P2 b) M N *)
simple induction 1; auto with arith.
Qed.
Theorem relSL_noetherian :
forall b : wsort, explicit_noetherian _ (e_relSL b).
Proof.
(* Goal: forall b : wsort, explicit_noetherian (TS b) (e_relSL b) *)
intro b; apply noether_inclus with (e_lexfg _ (e_P1 b) (e_P2 b)).
(* Goal: forall (x y : TS b) (_ : e_relSL b x y), e_lexfg (TS b) (e_P1 b) (e_P2 b) x y *)
(* Goal: explicit_noetherian (TS b) (e_lexfg (TS b) (e_P1 b) (e_P2 b)) *)
apply lexfg_notherian.
(* Goal: forall (x y : TS b) (_ : e_relSL b x y), e_lexfg (TS b) (e_P1 b) (e_P2 b) x y *)
exact (lexfg_relSL b).
Qed.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrbool ssrfun eqtype ssrnat seq choice div fintype.
From mathcomp
Require Import finfun bigop finset prime binomial fingroup morphism perm.
From mathcomp
Require Import automorphism quotient action commutator gproduct gfunctor.
From mathcomp
Require Import ssralg finalg zmodp cyclic pgroup center gseries.
From mathcomp
Require Import nilpotent sylow abelian finmodule.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GroupScope.
Section Defs.
Variable gT : finGroupType.
Implicit Types (A B D : {set gT}) (G : {group gT}).
Definition charsimple A := [min A of G | G :!=: 1 & G \char A].
Definition Frattini A := \bigcap_(G : {group gT} | maximal_eq G A) G.
Canonical Frattini_group A : {group gT} := Eval hnf in [group of Frattini A].
Definition Fitting A := \big[dprod/1]_(p <- primes #|A|) 'O_p(A).
Lemma Fitting_group_set G : group_set (Fitting G).
Proof.
(* Goal: is_true (@group_set gT (Fitting (@gval gT G))) *)
suffices [F ->]: exists F : {group gT}, Fitting G = F by apply: groupP.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Fitting (@gval gT G)) (@gval gT F)) *)
rewrite /Fitting; elim: primes (primes_uniq #|G|) => [_|p r IHr] /=.
(* Goal: forall _ : is_true (andb (negb (@in_mem nat p (@mem nat (seq_predType nat_eqType) r))) (@uniq nat_eqType r)), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons nat p r) (fun p : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat p (direct_product gT) true (@pcore (nat_pred_of_nat p) gT (@gval gT G)))) (@gval gT F)) *)
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@nil nat) (fun p : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat p (direct_product gT) true (@pcore (nat_pred_of_nat p) gT (@gval gT G)))) (@gval gT F)) *)
by exists [1 gT]%G; rewrite big_nil.
(* Goal: forall _ : is_true (andb (negb (@in_mem nat p (@mem nat (seq_predType nat_eqType) r))) (@uniq nat_eqType r)), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons nat p r) (fun p : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat p (direct_product gT) true (@pcore (nat_pred_of_nat p) gT (@gval gT G)))) (@gval gT F)) *)
case/andP=> rp /IHr[F defF]; rewrite big_cons defF.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F0 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)) (@gval gT F)) (@gval gT F0)) *)
suffices{IHr} /and3P[p'F sFG nFG]: p^'.-group F && (F <| G).
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@gval gT F)) (@normal gT (@gval gT F) (@gval gT G))) *)
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F0 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)) (@gval gT F)) (@gval gT F0)) *)
have nFGp: 'O_p(G) \subset 'N(F) := gFsub_trans _ nFG.
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@gval gT F)) (@normal gT (@gval gT F) (@gval gT G))) *)
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F0 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)) (@gval gT F)) (@gval gT F0)) *)
have pGp: p.-group('O_p(G)) := pcore_pgroup p G.
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@gval gT F)) (@normal gT (@gval gT F) (@gval gT G))) *)
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F0 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)) (@gval gT F)) (@gval gT F0)) *)
have{pGp} tiGpF: 'O_p(G) :&: F = 1 by rewrite coprime_TIg ?(pnat_coprime pGp).
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@gval gT F)) (@normal gT (@gval gT F) (@gval gT G))) *)
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun F0 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@pcore (nat_pred_of_nat p) gT (@gval gT G)) (@gval gT F)) (@gval gT F0)) *)
exists ('O_p(G) <*> F)%G; rewrite dprodEY // (sameP commG1P trivgP) -tiGpF.
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@gval gT F)) (@normal gT (@gval gT F) (@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 (@commutator_group gT (@gval gT F) (@gval gT (@pcore_group (nat_pred_of_nat p) 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) gT (@gval gT G)) (@gval gT F))))) *)
by rewrite subsetI commg_subl commg_subr (subset_trans sFG) // gFnorm.
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@gval gT F)) (@normal gT (@gval gT F) (@gval gT G))) *)
move/bigdprodWY: defF => <- {F}; elim: r rp => [_|q r IHr] /=.
(* Goal: forall _ : is_true (negb (@in_mem nat p (@mem nat (seq_predType nat_eqType) (@cons nat q r)))), is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@cons nat q r) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G)))))) (@normal gT (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@cons nat q r) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G))))) (@gval gT G))) *)
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@nil nat) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G)))))) (@normal gT (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@nil nat) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G))))) (@gval gT G))) *)
by rewrite big_nil gen0 pgroup1 normal1.
(* Goal: forall _ : is_true (negb (@in_mem nat p (@mem nat (seq_predType nat_eqType) (@cons nat q r)))), is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@cons nat q r) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G)))))) (@normal gT (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@cons nat q r) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G))))) (@gval gT G))) *)
rewrite inE eq_sym big_cons -joingE -joing_idr => /norP[qp /IHr {IHr}].
(* Goal: forall _ : is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) r (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G)))))) (@normal gT (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) r (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G))))) (@gval gT G))), is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@joing gT (@pcore (nat_pred_of_nat q) gT (@gval gT G)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) r (fun j : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat j (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat j) gT (@gval gT G))))))) (@normal gT (@joing gT (@pcore (nat_pred_of_nat q) gT (@gval gT G)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) r (fun j : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) nat j (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat j) gT (@gval gT G)))))) (@gval gT G))) *)
set F := <<_>> => /andP[p'F nsFG].
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@joing gT (@pcore (nat_pred_of_nat q) gT (@gval gT G)) F)) (@normal gT (@joing gT (@pcore (nat_pred_of_nat q) gT (@gval gT G)) F) (@gval gT G))) *)
rewrite norm_joinEl /= -/F; last exact/gFsub_trans/normal_norm.
(* Goal: is_true (andb (@pgroup gT (negn (nat_pred_of_nat p)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@pcore (nat_pred_of_nat q) gT (@gval gT G)) F)) (@normal gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@pcore (nat_pred_of_nat q) gT (@gval gT G)) F) (@gval gT G))) *)
by rewrite pgroupM p'F normalM ?pcore_normal //= (pi_pgroup (pcore_pgroup q G)).
Qed.
Canonical Fitting_group G := group (Fitting_group_set G).
Definition critical A B :=
[/\ A \char B,
Frattini A \subset 'Z(A),
[~: B, A] \subset 'Z(A)
& 'C_B(A) = 'Z(A)].
Definition special A := Frattini A = 'Z(A) /\ A^`(1) = 'Z(A).
Definition extraspecial A := special A /\ prime #|'Z(A)|.
Definition SCN B := [set A : {group gT} | A <| B & 'C_B(A) == A].
Definition SCN_at n B := [set A in SCN B | n <= 'r(A)].
End Defs.
Arguments charsimple {gT} A%g.
Arguments Frattini {gT} A%g.
Arguments Fitting {gT} A%g.
Arguments critical {gT} A%g B%g.
Arguments special {gT} A%g.
Arguments extraspecial {gT} A%g.
Arguments SCN {gT} B%g.
Arguments SCN_at {gT} n%N B%g.
Notation "''Phi' ( A )" := (Frattini A)
(at level 8, format "''Phi' ( A )") : group_scope.
Notation "''Phi' ( G )" := (Frattini_group G) : Group_scope.
Notation "''F' ( G )" := (Fitting G)
(at level 8, format "''F' ( G )") : group_scope.
Notation "''F' ( G )" := (Fitting_group G) : Group_scope.
Notation "''SCN' ( B )" := (SCN B)
(at level 8, format "''SCN' ( B )") : group_scope.
Notation "''SCN_' n ( B )" := (SCN_at n B)
(at level 8, n at level 2, format "''SCN_' n ( B )") : group_scope.
Section PMax.
Variables (gT : finGroupType) (p : nat) (P M : {group gT}).
Hypothesis pP : p.-group P.
Lemma p_maximal_normal : maximal M P -> M <| P.
Proof.
(* Goal: forall _ : is_true (@maximal gT (@gval gT M) (@gval gT P)), is_true (@normal gT (@gval gT M) (@gval gT P)) *)
case/maxgroupP=> /andP[sMP sPM] maxM; rewrite /normal sMP.
(* 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)) (@gval gT P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT M)))))) *)
have:= subsetIl P 'N(M); rewrite subEproper.
(* Goal: forall _ : is_true (orb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT P) (@normaliser gT (@gval gT M))) (@gval gT P)) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT P) (@normaliser gT (@gval gT M))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT P))))), 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)) (@gval gT P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT M)))))) *)
case/predU1P=> [/setIidPl-> // | /maxM/= SNM]; case/negP: sPM.
(* 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 P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M)))) *)
rewrite (nilpotent_sub_norm (pgroup_nil pP) sMP) //.
(* 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 P) (@normaliser gT (@gval gT M))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M)))) *)
by rewrite SNM // subsetI sMP normG.
Qed.
Lemma p_maximal_index : maximal M P -> #|P : M| = p.
Proof.
(* Goal: forall _ : is_true (@maximal gT (@gval gT M) (@gval gT P)), @eq nat (@indexg gT (@gval gT P) (@gval gT M)) p *)
move=> maxM; have nM := p_maximal_normal maxM.
(* Goal: @eq nat (@indexg gT (@gval gT P) (@gval gT M)) p *)
rewrite -card_quotient ?normal_norm //.
(* Goal: @eq nat (@card (@coset_finType gT (@gval gT M)) (@mem (Finite.sort (@coset_finType gT (@gval gT M))) (predPredType (Finite.sort (@coset_finType gT (@gval gT M)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT M)) (@quotient gT (@gval gT P) (@gval gT M))))) p *)
rewrite -(quotient_maximal _ nM) ?normal_refl // trivg_quotient in maxM.
(* Goal: @eq nat (@card (@coset_finType gT (@gval gT M)) (@mem (Finite.sort (@coset_finType gT (@gval gT M))) (predPredType (Finite.sort (@coset_finType gT (@gval gT M)))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT M)) (@quotient gT (@gval gT P) (@gval gT M))))) p *)
case/maxgroupP: maxM; rewrite properEneq eq_sym sub1G andbT /=.
(* Goal: forall (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M)))) (@quotient gT (@gval gT P) (@gval gT M)) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT M))))))) (_ : forall (H : @group_of (@coset_groupType gT (@gval gT M)) (Phant (@coset_of gT (@gval gT M)))) (_ : is_true (@proper (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@gval (@coset_groupType gT (@gval gT M)) H))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@quotient gT (@gval gT P) (@gval gT M)))))) (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT M)))))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@gval (@coset_groupType gT (@gval gT M)) H))))), @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (Phant (@coset_of gT (@gval gT M)))) (@gval (@coset_groupType gT (@gval gT M)) H) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT M))))), @eq nat (@card (@coset_finType gT (@gval gT M)) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT M)) (@quotient gT (@gval gT P) (@gval gT M))))) p *)
case/(pgroup_pdiv (quotient_pgroup M pP)) => p_pr /Cauchy[] // xq.
(* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M))))) xq (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M)))) (@gval (@coset_groupType gT (@gval gT M)) (@quotient_group gT P (@gval gT M))))))) (_ : @eq nat (@order (@coset_groupType gT (@gval gT M)) xq) p) (_ : @ex nat (fun m : nat => @eq nat (@card (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M)))) (@gval (@coset_groupType gT (@gval gT M)) (@quotient_group gT P (@gval gT M)))))) (expn p (S m)))) (_ : forall (H : @group_of (@coset_groupType gT (@gval gT M)) (Phant (@coset_of gT (@gval gT M)))) (_ : is_true (@proper (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@gval (@coset_groupType gT (@gval gT M)) H))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@quotient gT (@gval gT P) (@gval gT M)))))) (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT M)))))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@gval (@coset_groupType gT (@gval gT M)) H))))), @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (Phant (@coset_of gT (@gval gT M)))) (@gval (@coset_groupType gT (@gval gT M)) H) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT M))))), @eq nat (@card (@coset_finType gT (@gval gT M)) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT M)) (@quotient gT (@gval gT P) (@gval gT M))))) p *)
rewrite /order -cycle_subG subEproper => /predU1P[-> // | sxPq oxq_p _].
(* Goal: forall _ : forall (H : @group_of (@coset_groupType gT (@gval gT M)) (Phant (@coset_of gT (@gval gT M)))) (_ : is_true (@proper (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@gval (@coset_groupType gT (@gval gT M)) H))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@quotient gT (@gval gT P) (@gval gT M)))))) (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT M)))))) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (@gval (@coset_groupType gT (@gval gT M)) H))))), @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT M))) (Phant (@coset_of gT (@gval gT M)))) (@gval (@coset_groupType gT (@gval gT M)) H) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT M)))), @eq nat (@card (@coset_finType gT (@gval gT M)) (@mem (@coset_of gT (@gval gT M)) (predPredType (@coset_of gT (@gval gT M))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT M)) (@quotient gT (@gval gT P) (@gval gT M))))) p *)
by move/(_ _ sxPq (sub1G _)) => xq1; rewrite -oxq_p xq1 cards1 in p_pr.
Qed.
Lemma p_index_maximal : M \subset P -> prime #|P : M| -> maximal M 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 M))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT P))))) (_ : is_true (prime (@indexg gT (@gval gT P) (@gval gT M)))), is_true (@maximal gT (@gval gT M) (@gval gT P)) *)
move=> sMP /primeP[lt1PM pr_PM].
(* Goal: is_true (@maximal gT (@gval gT M) (@gval gT P)) *)
apply/maxgroupP; rewrite properEcard sMP -(Lagrange sMP).
(* Goal: and (is_true (andb true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M))))) (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 M)))) (@indexg gT (@gval gT P) (@gval gT M)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (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)) (@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 P))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (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))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 M)) *)
rewrite -{1}(muln1 #|M|) ltn_pmul2l //; split=> // H sHP sMH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT M) *)
apply/eqP; rewrite eq_sym eqEcard sMH.
(* Goal: is_true (andb 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 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 M)))))) *)
case/orP: (pr_PM _ (indexSg sMH (proper_sub sHP))) => /eqP iM.
(* Goal: is_true (andb 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 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 M)))))) *)
(* Goal: is_true (andb 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 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 M)))))) *)
by rewrite -(Lagrange sMH) iM muln1 /=.
(* Goal: is_true (andb 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 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 M)))))) *)
by have:= proper_card sHP; rewrite -(Lagrange sMH) iM Lagrange ?ltnn.
Qed.
End PMax.
Section Frattini.
Variables gT : finGroupType.
Implicit Type G M : {group gT}.
Lemma Phi_sub G : 'Phi(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)) (@Frattini gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
by rewrite bigcap_inf // /maximal_eq eqxx.
Qed.
Lemma Phi_sub_max G M : maximal M G -> 'Phi(G) \subset M.
Proof.
(* Goal: forall _ : is_true (@maximal gT (@gval gT M) (@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)) (@Frattini 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 M)))) *)
by move=> maxM; rewrite bigcap_inf // /maximal_eq predU1r.
Qed.
Lemma Phi_proper G : G :!=: 1 -> 'Phi(G) \proper G.
Proof.
(* Goal: forall _ : 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 (@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)) (@Frattini 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)))) *)
move/eqP; case/maximal_exists: (sub1G G) => [<- //| [M maxM _] _].
(* 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)) (@Frattini 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: sub_proper_trans (Phi_sub_max maxM) (maxgroupp maxM).
Qed.
Lemma Phi_nongen G X : 'Phi(G) <*> X = G -> <<X>> = G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT (@Frattini gT (@gval gT G)) X) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT X) (@gval gT G) *)
move=> defG; have: <<X>> \subset G by rewrite -{1}defG genS ?subsetUr.
(* 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)) (@generated gT X))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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))))) (@generated gT X) (@gval gT G) *)
case/maximal_exists=> //= [[M maxM]]; rewrite gen_subG => sXM.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@generated gT X) (@gval gT G) *)
case/andP: (maxgroupp maxM) => _ /negP[].
(* 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)) (@gval gT M)))) *)
by rewrite -defG gen_subG subUset Phi_sub_max.
Qed.
Lemma Frattini_continuous (rT : finGroupType) G (f : {morphism G >-> rT}) :
f @* 'Phi(G) \subset 'Phi(f @* G).
Proof.
(* Goal: is_true (@subset (FinGroup.finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@Frattini gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Frattini rT (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G)))))) *)
apply/bigcapsP=> M maxM; rewrite sub_morphim_pre ?Phi_sub // bigcap_inf //.
(* Goal: is_true (@maximal_eq gT (@gval gT (@morphpre_group gT rT G f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) M)) (@gval gT G)) *)
have {2}<-: f @*^-1 (f @* G) = G by rewrite morphimGK ?subsetIl.
(* Goal: is_true (@maximal_eq gT (@gval gT (@morphpre_group gT rT G f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) M)) (@morphpre gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@morphim gT rT (@gval gT G) f (@MorPhantom gT rT (@mfun gT rT (@gval gT G) f)) (@gval gT G)))) *)
by rewrite morphpre_maximal_eq ?maxM //; case/maximal_eqP: maxM.
Qed.
End Frattini.
Canonical Frattini_igFun := [igFun by Phi_sub & Frattini_continuous].
Canonical Frattini_gFun := [gFun by Frattini_continuous].
Section Frattini0.
Variable gT : finGroupType.
Implicit Types (rT : finGroupType) (D G : {group gT}).
Lemma Phi_char G : 'Phi(G) \char G.
Proof.
(* Goal: is_true (@characteristic gT (@Frattini gT (@gval gT G)) (@gval gT G)) *)
exact: gFchar.
Qed.
Lemma Phi_normal G : 'Phi(G) <| G.
Proof.
(* Goal: is_true (@normal gT (@Frattini gT (@gval gT G)) (@gval gT G)) *)
exact: gFnormal.
Qed.
Lemma injm_Phi rT D G (f : {morphism D >-> rT}) :
'injm f -> G \subset D -> f @* 'Phi(G) = 'Phi(f @* G).
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Frattini gT (@gval gT G))) (@Frattini rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) *)
exact: injmF.
Qed.
Lemma isog_Phi rT G (H : {group rT}) : G \isog H -> 'Phi(G) \isog 'Phi(H).
Proof.
(* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT H)), is_true (@isog gT rT (@Frattini gT (@gval gT G)) (@Frattini rT (@gval rT H))) *)
exact: gFisog.
Qed.
Lemma PhiJ G x : 'Phi(G :^ x) = 'Phi(G) :^ x.
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@conjugate gT (@gval gT G) x)) (@conjugate gT (@Frattini gT (@gval gT G)) x) *)
rewrite -{1}(setIid G) -(setIidPr (Phi_sub G)) -!morphim_conj.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@morphim gT gT (@gval gT G) (@conjgm_morphism gT (@gval gT G) x) (@MorPhantom gT gT (@conjgm gT (@gval gT G) x)) (@gval gT G))) (@morphim gT gT (@gval gT G) (@conjgm_morphism gT (@gval gT G) x) (@MorPhantom gT gT (@conjgm gT (@gval gT G) x)) (@Frattini gT (@gval gT G))) *)
by rewrite injm_Phi ?injm_conj.
Qed.
End Frattini0.
Section Frattini2.
Variables gT : finGroupType.
Implicit Type G : {group gT}.
Lemma Phi_quotient_id G : 'Phi (G / 'Phi(G)) = 1.
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@Frattini gT (@gval gT G))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@Frattini gT (@gval gT G)))))))) (@Frattini (@coset_groupType gT (@Frattini gT (@gval gT G))) (@quotient gT (@gval gT G) (@Frattini gT (@gval gT G)))) (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType gT (@Frattini gT (@gval gT G)))))) *)
apply/trivgP; rewrite -cosetpreSK cosetpre1 /=; apply/bigcapsP=> M maxM.
(* 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)) (@morphpre gT (@coset_groupType gT (@Frattini gT (@gval gT G))) (@normaliser gT (@Frattini gT (@gval gT G))) (@coset_morphism gT (@Frattini gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@Frattini gT (@gval gT G))) (@coset gT (@Frattini gT (@gval gT G)))) (@Frattini (@coset_groupType gT (@Frattini gT (@gval gT G))) (@quotient gT (@gval gT G) (@Frattini 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 M)))) *)
have nPhi := Phi_normal G; have nPhiM: 'Phi(G) <| M.
(* 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)) (@morphpre gT (@coset_groupType gT (@Frattini gT (@gval gT G))) (@normaliser gT (@Frattini gT (@gval gT G))) (@coset_morphism gT (@Frattini gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@Frattini gT (@gval gT G))) (@coset gT (@Frattini gT (@gval gT G)))) (@Frattini (@coset_groupType gT (@Frattini gT (@gval gT G))) (@quotient gT (@gval gT G) (@Frattini 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 M)))) *)
(* Goal: is_true (@normal gT (@Frattini gT (@gval gT G)) (@gval gT M)) *)
by apply: normalS nPhi; [apply: bigcap_inf | case/maximal_eqP: maxM].
(* 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)) (@morphpre gT (@coset_groupType gT (@Frattini gT (@gval gT G))) (@normaliser gT (@Frattini gT (@gval gT G))) (@coset_morphism gT (@Frattini gT (@gval gT G))) (@MorPhantom gT (@coset_groupType gT (@Frattini gT (@gval gT G))) (@coset gT (@Frattini gT (@gval gT G)))) (@Frattini (@coset_groupType gT (@Frattini gT (@gval gT G))) (@quotient gT (@gval gT G) (@Frattini 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 M)))) *)
by rewrite sub_cosetpre_quo ?bigcap_inf // quotient_maximal_eq.
Qed.
Lemma Phi_quotient_cyclic G : cyclic (G / 'Phi(G)) -> cyclic G.
Variables (p : nat) (P : {group gT}).
Lemma trivg_Phi : p.-group P -> ('Phi(P) == 1) = p.-abelem P.
End Frattini2.
Section Frattini3.
Variables (gT : finGroupType) (p : nat) (P : {group gT}).
Hypothesis pP : p.-group P.
Lemma Phi_quotient_abelem : p.-abelem (P / 'Phi(P)).
Proof.
(* Goal: is_true (@abelem (@coset_groupType gT (@Frattini gT (@gval gT P))) p (@quotient gT (@gval gT P) (@Frattini gT (@gval gT P)))) *)
by rewrite -trivg_Phi ?morphim_pgroup //= Phi_quotient_id.
Qed.
Lemma Phi_joing : 'Phi(P) = P^`(1) <*> 'Mho^1(P).
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT P)) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))) *)
have [sPhiP nPhiP] := andP (Phi_normal P).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT P)) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))) *)
apply/eqP; rewrite eqEsubset join_subG.
(* 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)) (@Frattini gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))))) (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)) (@derived_at (S O) gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P)))))))) *)
case: (eqsVneq P 1) => [-> | ntP] in sPhiP *.
by rewrite /= (trivgP sPhiP) sub1G der_subS Mho_sub.
have [p_pr _ _] := pgroup_pdiv pP ntP.
have [abP x1P] := abelemP p_pr Phi_quotient_abelem.
apply/andP; split.
(* 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)) (@derived_at (S O) gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P))))))) *)
(* 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)) (@Frattini gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))))) *)
have nMP: P \subset 'N(P^`(1) <*> 'Mho^1(P)) by rewrite normsY // !gFnorm.
(* 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)) (@derived_at (S O) gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P))))))) *)
(* 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)) (@Frattini gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))))) *)
rewrite -quotient_sub1 ?gFsub_trans //=.
(* 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)) (@derived_at (S O) gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P))))))) *)
(* Goal: is_true (@subset (@coset_finType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))) (@mem (@coset_of gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))) (predPredType (@coset_of gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))) (@SetDef.pred_of_set (@coset_finType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))) (@quotient gT (@Frattini gT (@gval gT P)) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))))) (@mem (@coset_of gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))) (predPredType (@coset_of gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))))))) *)
suffices <-: 'Phi(P / (P^`(1) <*> 'Mho^1(P))) = 1 by apply: morphimF.
(* 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)) (@derived_at (S O) gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P))))))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))))))) (@Frattini (@coset_groupType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))) (@quotient gT (@gval gT P) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))) (oneg (group_set_of_baseGroupType (FinGroup.base (@coset_groupType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))))) *)
apply/eqP; rewrite (trivg_Phi (morphim_pgroup _ pP)) /= -quotientE.
(* 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)) (@derived_at (S O) gT (@gval gT P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P)))))) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 P)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Frattini_group gT (@gval gT P))))))) *)
(* Goal: is_true (@abelem (@coset_groupType gT (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))) p (@quotient gT (@gval gT P) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P))))) *)
apply/abelemP=> //; rewrite [abelian _]quotient_cents2 ?joing_subl //.
split=> // _ /morphimP[x Nx Px ->] /=.
rewrite -morphX //= coset_id // (MhoE 1 pP) joing_idr expn1.
by rewrite mem_gen //; apply/setUP; right; apply: mem_imset.
rewrite -quotient_cents2 // [_ \subset 'C(_)]abP (MhoE 1 pP) gen_subG /=.
apply/subsetP=> _ /imsetP[x Px ->]; rewrite expn1.
have nPhi_x: x \in 'N('Phi(P)) by apply: (subsetP nPhiP).
by rewrite coset_idr ?groupX ?morphX ?x1P ?mem_morphim.
Qed.
Qed.
Lemma Phi_Mho : abelian P -> 'Phi(P) = 'Mho^1(P).
Proof.
(* Goal: forall _ : is_true (@abelian gT (@gval gT P)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)) *)
by move=> cPP; rewrite Phi_joing (derG1P cPP) joing1G.
Qed.
End Frattini3.
Section Frattini4.
Variables (p : nat) (gT : finGroupType).
Implicit Types (rT : finGroupType) (P G H K D : {group gT}).
Lemma PhiS G H : p.-group H -> G \subset H -> 'Phi(G) \subset 'Phi(H).
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT H))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@Frattini 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)) (@Frattini gT (@gval gT H))))) *)
move=> pH sGH; rewrite (Phi_joing pH) (Phi_joing (pgroupS sGH pH)).
(* 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 (@derived_at (S O) gT (@gval gT G)) (@Mho (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)) (@joing gT (@derived_at (S O) gT (@gval gT H)) (@Mho (S O) gT (@gval gT H)))))) *)
by rewrite genS // setUSS ?dergS ?MhoS.
Qed.
Lemma morphim_Phi rT P D (f : {morphism D >-> rT}) :
p.-group P -> P \subset D -> f @* 'Phi(P) = 'Phi(f @* P).
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT P))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Frattini gT (@gval gT P))) (@Frattini rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT P))) *)
move=> pP sPD; rewrite !(@Phi_joing _ p) ?morphim_pgroup //.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@joing gT (@derived_at (S O) gT (@gval gT P)) (@Mho (S O) gT (@gval gT P)))) (@joing rT (@derived_at (S O) rT (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) P))) (@Mho (S O) rT (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) P)))) *)
rewrite morphim_gen ?subUset ?gFsub_trans // morphimU -joingE.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@joing rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@derived_at (S O) gT (@gval gT P))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Mho (S O) gT (@gval gT P)))) (@joing rT (@derived_at (S O) rT (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) P))) (@Mho (S O) rT (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) P)))) *)
by rewrite morphimR ?morphim_Mho.
Qed.
Lemma quotient_Phi P H :
p.-group P -> P \subset 'N(H) -> 'Phi(P) / H = 'Phi(P / H).
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT P))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H)))))), @eq (@set_of (@coset_finType gT (@gval gT H)) (Phant (@coset_of gT (@gval gT H)))) (@quotient gT (@Frattini gT (@gval gT P)) (@gval gT H)) (@Frattini (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT P) (@gval gT H))) *)
exact: morphim_Phi.
Qed.
Lemma Phi_min G H :
p.-group G -> G \subset 'N(H) -> p.-abelem (G / H) -> 'Phi(G) \subset H.
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT H)))))) (_ : is_true (@abelem (@coset_groupType gT (@gval gT H)) p (@quotient gT (@gval gT G) (@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)) (@Frattini 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)))) *)
move=> pG nHG; rewrite -trivg_Phi ?quotient_pgroup // -subG1 /=.
(* Goal: forall _ : 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))) (@Frattini (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))))) (@mem (@coset_of gT (@gval gT H)) (predPredType (@coset_of 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))))))), 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)) (@Frattini 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)))) *)
by rewrite -(quotient_Phi pG) ?quotient_sub1 // gFsub_trans.
Qed.
Lemma Phi_cprod G H K :
p.-group G -> H \* K = G -> 'Phi(H) \* 'Phi(K) = 'Phi(G).
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT H) (@gval gT K)) (@gval gT G)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@Frattini gT (@gval gT H)) (@Frattini gT (@gval gT K))) (@Frattini gT (@gval gT G)) *)
move=> pG defG; have [_ /mulG_sub[sHG sKG] cHK] := cprodP defG.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@Frattini gT (@gval gT H)) (@Frattini gT (@gval gT K))) (@Frattini gT (@gval gT G)) *)
rewrite cprodEY /=; last by rewrite (centSS (Phi_sub _) (Phi_sub _)).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@Frattini gT (@gval gT H)) (@Frattini gT (@gval gT K))) (@Frattini gT (@gval gT G)) *)
rewrite !(Phi_joing (pgroupS _ pG)) //=.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT (@derived_at (S O) gT (@gval gT H)) (@Mho (S O) gT (@gval gT H))) (@joing gT (@derived_at (S O) gT (@gval gT K)) (@Mho (S O) gT (@gval gT K)))) (@joing gT (@derived_at (S O) gT (@gval gT G)) (@Mho (S O) gT (@gval gT G))) *)
have /cprodP[_ <- /cent_joinEr <-] := der_cprod 1 defG.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT (@derived_at (S O) gT (@gval gT H)) (@Mho (S O) gT (@gval gT H))) (@joing gT (@derived_at (S O) gT (@gval gT K)) (@Mho (S O) gT (@gval gT K)))) (@joing gT (@joing gT (@gval gT (@derived_at_group gT H (S O))) (@gval gT (@derived_at_group gT K (S O)))) (@Mho (S O) gT (@gval gT G))) *)
have /cprodP[_ <- /cent_joinEr <-] := Mho_cprod 1 defG.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT (@derived_at (S O) gT (@gval gT H)) (@Mho (S O) gT (@gval gT H))) (@joing gT (@derived_at (S O) gT (@gval gT K)) (@Mho (S O) gT (@gval gT K)))) (@joing gT (@joing gT (@gval gT (@derived_at_group gT H (S O))) (@gval gT (@derived_at_group gT K (S O)))) (@joing gT (@gval gT (@Mho_group (S O) gT (@gval gT H))) (@gval gT (@Mho_group (S O) gT (@gval gT K))))) *)
by rewrite !joingA /= -!(joingA H^`(1)) (joingC K^`(1)).
Qed.
Lemma Phi_mulg H K :
p.-group H -> p.-group K -> K \subset 'C(H) ->
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT H))) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@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)) (@centraliser gT (@gval gT H)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@Frattini gT (@gval gT H)) (@Frattini gT (@gval gT K))) *)
move=> pH pK cHK; have defHK := cprodEY cHK.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@Frattini gT (@gval gT H)) (@Frattini gT (@gval gT K))) *)
have [|_ ->] /= := cprodP (Phi_cprod _ defHK); rewrite cent_joinEr //.
(* Goal: is_true (@pgroup gT (nat_pred_of_nat p) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))) *)
by rewrite pgroupM pH.
Qed.
Lemma charsimpleP G :
reflect (G :!=: 1 /\ forall K, K :!=: 1 -> K \char G -> K :=: G)
(charsimple G).
Proof.
(* Goal: Bool.reflect (and (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)))))))) (forall (K : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))) (_ : is_true (@characteristic gT (@gval gT K) (@gval gT G))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G))) (@charsimple gT (@gval gT G)) *)
apply: (iffP mingroupP); rewrite char_refl andbT => -[ntG simG].
(* Goal: and (is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@characteristic gT (@gval gT H) (@gval gT G)))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) *)
(* Goal: and (is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (forall (K : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (_ : is_true (@characteristic gT (@gval gT K) (@gval gT G))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G)) *)
by split=> // K ntK chK; apply: simG; rewrite ?ntK // char_sub.
(* Goal: and (is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (andb (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) (@characteristic gT (@gval gT H) (@gval gT G)))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) *)
by split=> // K /andP[ntK chK] _; apply: simG.
Qed.
End Frattini4.
Section Fitting.
Variable gT : finGroupType.
Implicit Types (p : nat) (G H : {group gT}).
Lemma Fitting_normal G : 'F(G) <| G.
Proof.
(* Goal: is_true (@normal gT (@Fitting gT (@gval gT G)) (@gval gT G)) *)
rewrite -['F(G)](bigdprodWY (erefl 'F(G))).
(* Goal: is_true (@normal gT (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G))))) (@gval gT G)) *)
elim/big_rec: _ => [|p H _ nsHG]; first by rewrite gen0 normal1.
(* Goal: is_true (@normal gT (@generated gT (@setU (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) gT (@gval gT G)) H)) (@gval gT G)) *)
by rewrite -[<<_>>]joing_idr normalY ?pcore_normal.
Qed.
Lemma Fitting_sub G : 'F(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)) (@Fitting gT (@gval gT G)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
by rewrite normal_sub ?Fitting_normal.
Qed.
Lemma Fitting_nil G : nilpotent 'F(G).
Proof.
(* Goal: is_true (@nilpotent gT (@Fitting gT (@gval gT G))) *)
apply: (bigdprod_nil (erefl 'F(G))) => p _.
(* Goal: is_true (@nilpotent gT (@pcore (nat_pred_of_nat p) gT (@gval gT G))) *)
exact: pgroup_nil (pcore_pgroup p G).
Qed.
Lemma Fitting_max G H : H <| G -> nilpotent H -> H \subset 'F(G).
Proof.
(* Goal: forall (_ : is_true (@normal gT (@gval gT H) (@gval gT G))) (_ : is_true (@nilpotent 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)) (@Fitting gT (@gval gT G))))) *)
move=> nsHG nilH; rewrite -(Sylow_gen H) gen_subG.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort (group_of_finType gT)) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (group_of_finType gT)) (fun P : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) P (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@Sylow gT (@gval gT H) (@gval gT P)) (@gval gT P))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group gT G))))) *)
apply/bigcupsP=> P /SylowP[p _ sylP].
(* 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 P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group gT G))))) *)
case Gp: (p \in \pi(G)); last first.
(* 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 P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group 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 P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group gT G))))) *)
rewrite card1_trivg ?sub1G // (card_Hall sylP).
(* 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 P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group gT G))))) *)
(* Goal: @eq nat (partn (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))) (nat_pred_of_nat p)) (S O) *)
rewrite part_p'nat // (pnat_dvd (cardSg (normal_sub nsHG))) //.
(* 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 P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group gT G))))) *)
(* Goal: is_true (pnat (negn (nat_pred_of_nat p)) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *)
by rewrite /pnat cardG_gt0 all_predC has_pred1 Gp.
(* 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 P))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group gT G))))) *)
rewrite {P sylP}(nilpotent_Hall_pcore nilH sylP).
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) gT (@gval gT 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 (@Fitting_group gT G))))) *)
rewrite -(bigdprodWY (erefl 'F(G))) sub_gen //.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (fun i : nat => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) nat i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat i) gT (@gval gT G))))))) *)
rewrite -(filter_pi_of (ltnSn _)) big_filter big_mkord.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@pcore (nat_pred_of_nat p) gT (@gval gT 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun i : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) i (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@fun_of_simpl nat bool (pi_of (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) i)) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) i)) gT (@gval gT G))))))) *)
apply: (bigcup_max (Sub p _)) => //= [|_].
(* 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)) (@pcore (nat_pred_of_nat p) 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)) (@pcore (nat_pred_of_nat p) gT (@gval gT G))))) *)
(* Goal: is_true (leq (S p) (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) *)
by have:= Gp; rewrite ltnS mem_primes => /and3P[_ ntG /dvdn_leq->].
(* 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)) (@pcore (nat_pred_of_nat p) 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)) (@pcore (nat_pred_of_nat p) gT (@gval gT G))))) *)
by rewrite pcore_max ?pcore_pgroup ?gFnormal_trans.
Qed.
Lemma pcore_Fitting pi G : 'O_pi('F(G)) \subset 'O_pi(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)) (@pcore pi gT (@Fitting 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)) (@pcore pi gT (@gval gT G))))) *)
by rewrite pcore_max ?pcore_pgroup ?gFnormal_trans ?Fitting_normal.
Qed.
Lemma p_core_Fitting p G : 'O_p('F(G)) = 'O_p(G).
Lemma nilpotent_Fitting G : nilpotent G -> 'F(G) = G.
Proof.
(* Goal: forall _ : is_true (@nilpotent gT (@gval gT G)), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@Fitting gT (@gval gT G)) (@gval gT G) *)
by move=> nilG; apply/eqP; rewrite eqEsubset Fitting_sub Fitting_max.
Qed.
Lemma Fitting_eq_pcore p G : 'O_p^'(G) = 1 -> 'F(G) = 'O_p(G).
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@pcore (negn (nat_pred_of_nat p)) gT (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@Fitting gT (@gval gT G)) (@pcore (nat_pred_of_nat p) gT (@gval gT G)) *)
move=> p'G1; have /dprodP[_ /= <- _ _] := nilpotent_pcoreC p (Fitting_nil G).
(* 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)) (@pcore (nat_pred_of_nat p) gT (@Fitting gT (@gval gT G))) (@pcore (negn (nat_pred_of_nat p)) gT (@Fitting gT (@gval gT G)))) (@pcore (nat_pred_of_nat p) gT (@gval gT G)) *)
by rewrite p_core_Fitting ['O_p^'(_)](trivgP _) ?mulg1 // -p'G1 pcore_Fitting.
Qed.
Lemma FittingEgen G :
'F(G) = <<\bigcup_(p < #|G|.+1 | (p : nat) \in \pi(G)) 'O_p(G)>>.
Proof.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@Fitting gT (@gval gT G)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p : 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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) gT (@gval gT G))))) *)
apply/eqP; rewrite eqEsubset gen_subG /=.
(* 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)) (@Fitting 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)) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) 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)) (@Fitting gT (@gval gT G)))))) *)
rewrite -{1}(bigdprodWY (erefl 'F(G))) (big_nth 0) big_mkord genS.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort (ordinal_finType (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))))) (fun i : ordinal (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (ordinal (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat (@nth nat O (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@nat_of_ord (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) gT (@gval gT G))))))) *)
(* Goal: is_true (andb 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 (@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)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) 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)) (@Fitting gT (@gval gT G)))))) *)
by apply/bigcupsP=> p _; rewrite -p_core_Fitting pcore_sub.
(* 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.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (Finite.sort (ordinal_finType (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))))) (fun i : ordinal (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (ordinal (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) i (@setU (FinGroup.arg_finType (FinGroup.base gT))) true (@pcore (nat_pred_of_nat (@nth nat O (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) (@nat_of_ord (@size nat (primes (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) gT (@gval gT G))))))) *)
apply/bigcupsP=> [[i /= lti]] _; set p := nth _ _ i.
(* 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)) (@pcore (nat_pred_of_nat p) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) gT (@gval gT G))))))) *)
have pi_p: p \in \pi(G) by rewrite mem_nth.
(* 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)) (@pcore (nat_pred_of_nat p) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) gT (@gval gT G))))))) *)
have p_dv_G: p %| #|G| by rewrite mem_primes in pi_p; case/and3P: pi_p.
(* 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)) (@pcore (nat_pred_of_nat p) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) gT (@gval gT G))))))) *)
have lepG: p < #|G|.+1 by rewrite ltnS dvdn_leq.
(* 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)) (@pcore (nat_pred_of_nat p) 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)) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (index_enum (ordinal_finType (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))))) (fun p : ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) p (@setU (FinGroup.arg_finType (FinGroup.base gT))) (@in_mem nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p) (@mem nat nat_pred_pred (pi_of (@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))))))) (@pcore (nat_pred_of_nat (@nat_of_ord (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) p)) gT (@gval gT G))))))) *)
by rewrite (bigcup_max (Ordinal lepG)).
Qed.
End Fitting.
Section FittingFun.
Implicit Types gT rT : finGroupType.
Lemma morphim_Fitting : GFunctor.pcontinuous (@Fitting).
Lemma FittingS gT (G H : {group gT}) : H \subset G -> H :&: 'F(G) \subset 'F(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 (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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) (@Fitting 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)) (@Fitting gT (@gval gT H))))) *)
move=> sHG; rewrite -{2}(setIidPl sHG).
(* 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) (@Fitting 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)) (@Fitting gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT G)))))) *)
do 2!rewrite -(morphim_idm (subsetIl H _)) morphimIdom; apply: morphim_Fitting.
Qed.
Lemma FittingJ gT (G : {group gT}) x : 'F(G :^ x) = 'F(G) :^ x.
Lemma injm_Fitting : 'injm f -> G \subset D -> f @* 'F(G) = 'F(f @* G).
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@Fitting gT (@gval gT G))) (@Fitting rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))) *)
exact: injmF.
Qed.
Lemma isog_Fitting (H : {group rT}) : G \isog H -> 'F(G) \isog 'F(H).
Proof.
(* Goal: forall _ : is_true (@isog gT rT (@gval gT G) (@gval rT H)), is_true (@isog gT rT (@Fitting gT (@gval gT G)) (@Fitting rT (@gval rT H))) *)
exact: gFisog.
Qed.
End IsoFitting.
Section CharSimple.
Variable gT : finGroupType.
Implicit Types (rT : finGroupType) (G H K L : {group gT}) (p : nat).
Lemma minnormal_charsimple G H : minnormal H G -> charsimple H.
Proof.
(* Goal: forall _ : is_true (@minnormal gT (@gval gT H) (@gval gT G)), is_true (@charsimple gT (@gval gT H)) *)
case/mingroupP=> /andP[ntH nHG] minH.
(* Goal: is_true (@charsimple gT (@gval gT H)) *)
apply/charsimpleP; split=> // K ntK chK.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT H) *)
by apply: minH; rewrite ?ntK (char_sub chK, char_norm_trans chK).
Qed.
Lemma maxnormal_charsimple G H L :
G <| L -> maxnormal H G L -> charsimple (G / H).
Proof.
(* Goal: forall (_ : is_true (@normal gT (@gval gT G) (@gval gT L))) (_ : is_true (@maxnormal gT (@gval gT H) (@gval gT G) (@gval gT L))), is_true (@charsimple (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *)
case/andP=> sGL nGL /maxgroupP[/andP[/andP[sHG not_sGH] nHL] maxH].
(* Goal: is_true (@charsimple (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *)
have nHG: G \subset 'N(H) := subset_trans sGL nHL.
(* Goal: is_true (@charsimple (@coset_groupType gT (@gval gT H)) (@quotient gT (@gval gT G) (@gval gT H))) *)
apply/charsimpleP; rewrite -subG1 quotient_sub1 //; split=> // HK ntHK chHK.
(* 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))))))) (@gval (@coset_groupType gT (@gval gT H)) HK) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT G (@gval gT H))) *)
case/(inv_quotientN _): (char_normal chHK) => [|K defHK sHK]; first exact/andP.
(* Goal: forall _ : is_true (@normal gT (@gval gT K) (@gval gT G)), @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))))))) (@gval (@coset_groupType gT (@gval gT H)) HK) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT G (@gval gT H))) *)
case/andP; rewrite subEproper defHK => /predU1P[-> // | ltKG] nKG.
(* 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))))))) (@quotient gT (@gval gT K) (@gval gT H)) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT G (@gval gT H))) *)
have nHK: H <| K by rewrite /normal sHK (subset_trans (proper_sub ltKG)).
(* 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))))))) (@quotient gT (@gval gT K) (@gval gT H)) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT G (@gval gT H))) *)
case/negP: ntHK; rewrite defHK -subG1 quotient_sub1 ?normal_norm //.
(* 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 (maxH K) // ltKG -(quotientGK nHK) -defHK norm_quotient_pre //.
(* 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 (@gval gT L) (@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)) (@gval (@coset_groupType gT (@gval gT H)) HK))))) *)
by rewrite (char_norm_trans chHK) ?quotient_norms.
Qed.
Lemma abelem_split_dprod rT p (A B : {group rT}) :
p.-abelem A -> B \subset A -> exists C : {group rT}, B \x C = A.
Proof.
(* Goal: forall (_ : is_true (@abelem rT p (@gval rT A))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT B))) (@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 A))))), @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun C : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@gval rT B) (@gval rT C)) (@gval rT A)) *)
move=> abelA sBA; have [_ cAA _]:= and3P abelA.
(* Goal: @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun C : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@gval rT B) (@gval rT C)) (@gval rT A)) *)
case/splitsP: (abelem_splits abelA sBA) => C /complP[tiBC defA].
(* Goal: @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun C : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@gval rT B) (@gval rT C)) (@gval rT A)) *)
by exists C; rewrite dprodE // (centSS _ sBA cAA) // -defA mulG_subr.
Qed.
Lemma p_abelem_split1 rT p (A : {group rT}) x :
p.-abelem A -> x \in A ->
Proof.
(* Goal: forall (_ : is_true (@abelem rT p (@gval rT A))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT A))))), @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun B : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => and3 (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 B))) (@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 A))))) (@eq nat (@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 B)))) (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 A)))) (@order rT x))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@cycle rT x) (@gval rT B)) (@gval rT A))) *)
move=> abelA Ax; have sxA: <[x]> \subset A by rewrite cycle_subG.
(* Goal: @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun B : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => and3 (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 B))) (@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 A))))) (@eq nat (@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 B)))) (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 A)))) (@order rT x))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@cycle rT x) (@gval rT B)) (@gval rT A))) *)
have [B defA] := abelem_split_dprod abelA sxA.
(* Goal: @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun B : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => and3 (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 B))) (@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 A))))) (@eq nat (@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 B)))) (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 A)))) (@order rT x))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@cycle rT x) (@gval rT B)) (@gval rT A))) *)
have [_ defxB _ ti_xB] := dprodP defA.
(* Goal: @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun B : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => and3 (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 B))) (@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 A))))) (@eq nat (@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 B)))) (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 A)))) (@order rT x))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@cycle rT x) (@gval rT B)) (@gval rT A))) *)
have sBA: B \subset A by rewrite -defxB mulG_subr.
(* Goal: @ex (@group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (fun B : @group_of rT (Phant (FinGroup.arg_sort (FinGroup.base rT))) => and3 (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 B))) (@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 A))))) (@eq nat (@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 B)))) (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 A)))) (@order rT x))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@cycle rT x) (@gval rT B)) (@gval rT A))) *)
by exists B; split; rewrite // -defxB (TI_cardMg ti_xB) mulKn ?order_gt0.
Qed.
Lemma abelem_charsimple p G : p.-abelem G -> G :!=: 1 -> charsimple G.
Proof.
(* Goal: forall (_ : is_true (@abelem gT p (@gval gT G))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), is_true (@charsimple gT (@gval gT G)) *)
move=> abelG ntG; apply/charsimpleP; split=> // K ntK /charP[sKG chK].
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
case/eqVproper: sKG => // /properP[sKG [x Gx notKx]].
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
have ox := abelem_order_p abelG Gx (group1_contra notKx).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
have [A [sAG oA defA]] := p_abelem_split1 abelG Gx.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
case/trivgPn: ntK => y Ky nty; have Gy := subsetP sKG y Ky.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
have{nty} oy := abelem_order_p abelG Gy nty.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
have [B [sBG oB defB]] := p_abelem_split1 abelG Gy.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
have: isog A B; last case/isogP=> fAB injAB defAB.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
(* Goal: is_true (@isog gT gT (@gval gT A) (@gval gT B)) *)
rewrite (isog_abelem_card _ (abelemS sAG abelG)) (abelemS sBG) //=.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
(* Goal: is_true (@eq_op nat_eqType (@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 B)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A))))) *)
by rewrite oA oB ox oy.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT K) (@gval gT G) *)
have: isog <[x]> <[y]>; last case/isogP=> fxy injxy /= defxy.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT K) (@gval gT G) *)
(* Goal: is_true (@isog gT gT (@cycle gT x) (@cycle gT y)) *)
by rewrite isog_cyclic_card ?cycle_cyclic // [#|_|]oy -ox eqxx.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT K) (@gval gT G) *)
have cfxA: fAB @* A \subset 'C(fxy @* <[x]>).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT K) (@gval gT G) *)
(* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim gT gT (@gval gT A) fAB (@MorPhantom gT gT (@mfun gT gT (@gval gT A) fAB)) (@gval 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 (@morphim gT gT (@gval gT (@cycle_group gT x)) fxy (@MorPhantom gT gT (@mfun gT gT (@gval gT (@cycle_group gT x)) fxy)) (@cycle gT x)))))) *)
by rewrite defAB defxy; case/dprodP: defB.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT K) (@gval gT G) *)
have injf: 'injm (dprodm defA cfxA).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT K) (@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)) (@ker gT gT (@gval gT G) (@dprodm_morphism gT gT G (@cycle_group gT x) A fxy fAB defA cfxA) (@MorPhantom gT gT (@dprodm gT gT G (@cycle_group gT x) A fxy fAB defA cfxA))))) (@mem (Finite.sort (FinGroup.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 injm_dprodm injAB injxy defAB defxy; apply/eqP; case/dprodP: defB.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@gval gT K) (@gval gT G) *)
case/negP: notKx; rewrite -cycle_subG -(injmSK injf) ?cycle_subG //=.
(* Goal: is_true (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim gT gT (@gval gT G) (@dprodm_morphism gT gT G (@cycle_group gT x) A fxy fAB defA cfxA) (@MorPhantom gT gT (@dprodm gT gT G (@cycle_group gT x) A fxy fAB defA cfxA)) (@cycle gT x)))) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@morphim gT gT (@gval gT G) (@dprodm_morphism gT gT G (@cycle_group gT x) A fxy fAB defA cfxA) (@MorPhantom gT gT (@dprodm gT gT G (@cycle_group gT x) A fxy fAB defA cfxA)) (@gval gT K))))) *)
rewrite morphim_dprodml // defxy cycle_subG /= chK //.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) (@dprodm_morphism gT gT G (@cycle_group gT x) A fxy fAB defA cfxA) (@MorPhantom gT gT (@mfun gT gT (@gval gT G) (@dprodm_morphism gT gT G (@cycle_group gT x) A fxy fAB defA cfxA))) (@gval gT G)) (@gval gT G) *)
have [_ {4}<- _ _] := dprodP defB; have [_ {3}<- _ _] := dprodP defA.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@morphim gT gT (@gval gT G) (@dprodm_morphism gT gT G (@cycle_group gT x) A fxy fAB defA cfxA) (@MorPhantom gT gT (@mfun gT gT (@gval gT G) (@dprodm_morphism gT gT G (@cycle_group gT x) A fxy fAB defA cfxA))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@gval gT A))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT y) (@gval gT B)) *)
by rewrite morphim_dprodm // defAB defxy.
Qed.
Lemma charsimple_dprod G : charsimple G ->
exists H : {group gT}, [/\ H \subset G, simple H
& exists2 I : {set {perm gT}}, I \subset Aut G
& \big[dprod/1]_(f in I) f @: H = G].
Lemma simple_sol_prime G : solvable G -> simple G -> prime #|G|.
Proof.
(* Goal: forall (_ : is_true (@solvable gT (@gval gT G))) (_ : is_true (@simple gT (@gval gT G))), 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))))) *)
move=> solG /simpleP[ntG simG].
(* Goal: 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))))) *)
have{solG} cGG: abelian G.
(* Goal: 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))))) *)
(* Goal: is_true (@abelian gT (@gval gT G)) *)
apply/commG1P; case/simG: (der_normal 1 G) => // /eqP/idPn[].
(* Goal: 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))))) *)
(* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT (@derived_at_group gT G (S O))) (@gval gT G))) *)
by rewrite proper_neq // (sol_der1_proper solG).
(* Goal: 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))))) *)
case: (trivgVpdiv G) ntG => [-> | [p p_pr]]; first by rewrite eqxx.
(* Goal: forall (_ : is_true (dvdn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))), 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))))) *)
case/Cauchy=> // x Gx oxp _; move: p_pr; rewrite -oxp orderE.
(* 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)) (@cycle gT x))))), 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))))) *)
have: <[x]> <| G by rewrite -sub_abelian_normal ?cycle_subG.
(* Goal: forall (_ : is_true (@normal gT (@cycle gT x) (@gval gT G))) (_ : 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)) (@cycle gT x)))))), 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))))) *)
by case/simG=> -> //; rewrite cards1.
Qed.
Lemma charsimple_solvable G : charsimple G -> solvable G -> is_abelem G.
Proof.
(* Goal: forall (_ : is_true (@charsimple gT (@gval gT G))) (_ : is_true (@solvable gT (@gval gT G))), is_true (@is_abelem gT (@gval gT G)) *)
case/charsimple_dprod=> H [sHG simH [I Aut_I defG]] solG.
(* Goal: is_true (@is_abelem gT (@gval gT G)) *)
have p_pr: prime #|H| by apply: simple_sol_prime (solvableS sHG solG) simH.
(* Goal: is_true (@is_abelem gT (@gval gT G)) *)
set p := #|H| in p_pr; apply/is_abelemP; exists p => //.
(* Goal: is_true (@abelem gT p (@gval gT G)) *)
elim/big_rec: _ (G) defG => [_ <-|f B If IH_B M defM]; first exact: abelem1.
(* Goal: is_true (@abelem gT p (@gval gT M)) *)
have [Af [[_ K _ defB] _ _ _]] := (subsetP Aut_I f If, dprodP defM).
(* Goal: is_true (@abelem gT p (@gval gT M)) *)
rewrite (dprod_abelem p defM) defB IH_B // andbT -(autmE Af) -morphimEsub //=.
(* Goal: is_true (@abelem gT p (@morphim gT gT (@gval gT G) (@autm_morphism gT (@gval gT G) f Af) (@MorPhantom gT gT (@autm gT (@gval gT G) f Af)) (@gval gT H))) *)
rewrite morphim_abelem ?abelemE // exponent_dvdn.
(* Goal: is_true (andb (@abelian gT (@gval gT H)) true) *)
by rewrite cyclic_abelian ?prime_cyclic.
Qed.
Lemma minnormal_solvable L G H :
minnormal H L -> H \subset G -> solvable G ->
[/\ L \subset 'N(H), H :!=: 1 & is_abelem H].
Lemma solvable_norm_abelem L G :
solvable G -> G <| L -> G :!=: 1 ->
exists H : {group gT}, [/\ H \subset G, H <| L, H :!=: 1 & is_abelem H].
Proof.
(* Goal: forall (_ : is_true (@solvable gT (@gval gT G))) (_ : is_true (@normal gT (@gval gT G) (@gval gT L))) (_ : 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)))))))), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and4 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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) (@gval gT L))) (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 (@is_abelem gT (@gval gT H)))) *)
move=> solG /andP[sGL nGL] ntG.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and4 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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) (@gval gT L))) (is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (is_true (@is_abelem gT (@gval gT H)))) *)
have [H minH sHG]: {H : {group gT} | minnormal H L & H \subset G}.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and4 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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) (@gval gT L))) (is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (is_true (@is_abelem gT (@gval gT H)))) *)
(* 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 (@minnormal gT (@gval gT H) (@gval gT L))) (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 apply: mingroup_exists; rewrite ntG.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and4 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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) (@gval gT L))) (is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (is_true (@is_abelem gT (@gval gT H)))) *)
have [nHL ntH abH] := minnormal_solvable minH sHG solG.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and4 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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) (@gval gT L))) (is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (is_true (@is_abelem gT (@gval gT H)))) *)
by exists H; split; rewrite // /normal (subset_trans sHG).
Qed.
Lemma trivg_Fitting G : solvable G -> ('F(G) == 1) = (G :==: 1).
Proof.
(* Goal: forall _ : is_true (@solvable gT (@gval gT G)), @eq bool (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@Fitting 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=> solG; apply/idP/idP=> [F1 | /eqP->]; last by rewrite gF1.
(* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *)
apply/idPn=> /(solvable_norm_abelem solG (normal_refl _))[M [_ nsMG ntM]].
(* Goal: forall _ : is_true (@is_abelem gT (@gval gT M)), False *)
case/is_abelemP=> p _ /and3P[pM _ _]; case/negP: ntM.
(* Goal: is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT M) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *)
by rewrite -subG1 -(eqP F1) Fitting_max ?(pgroup_nil pM).
Qed.
Lemma Fitting_pcore pi G : 'F('O_pi(G)) = 'O_pi('F(G)).
Proof.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@Fitting gT (@pcore pi gT (@gval gT G))) (@pcore pi gT (@Fitting gT (@gval gT G))) *)
apply/eqP; rewrite eqEsubset.
(* 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)) (@Fitting gT (@pcore pi 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)) (@pcore pi gT (@Fitting 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)) (@pcore pi gT (@Fitting 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)) (@Fitting gT (@pcore pi gT (@gval gT G))))))) *)
rewrite (subset_trans _ (pcoreS _ (Fitting_sub _))); last first.
(* 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)) (@pcore pi gT (@Fitting 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)) (@Fitting gT (@pcore pi 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)) (@Fitting gT (@pcore pi gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@Fitting_group gT G)) (@pcore pi gT (@gval gT G)))))) *)
by rewrite subsetI Fitting_sub Fitting_max ?Fitting_nil ?gFnormal_trans.
(* 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)) (@pcore pi gT (@Fitting 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)) (@Fitting gT (@pcore pi gT (@gval gT G))))))) *)
rewrite (subset_trans _ (FittingS (pcore_sub _ _))) // subsetI pcore_sub.
(* 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)) (@pcore pi gT (@Fitting 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 (@pcore_group pi gT (@gval gT G)))))) true) *)
by rewrite pcore_max ?pcore_pgroup ?gFnormal_trans.
Qed.
End CharSimple.
Section SolvablePrimeFactor.
Variables (gT : finGroupType) (G : {group gT}).
Lemma index_maxnormal_sol_prime (H : {group gT}) :
solvable G -> maxnormal H G G -> prime #|G : H|.
Proof.
(* Goal: forall (_ : is_true (@solvable gT (@gval gT G))) (_ : is_true (@maxnormal gT (@gval gT H) (@gval gT G) (@gval gT G))), is_true (prime (@indexg gT (@gval gT G) (@gval gT H))) *)
move=> solG maxH; have nsHG := maxnormal_normal maxH.
(* Goal: is_true (prime (@indexg gT (@gval gT G) (@gval gT H))) *)
rewrite -card_quotient ?normal_norm // simple_sol_prime ?quotient_sol //.
(* Goal: is_true (@simple (@coset_groupType gT (@gval gT H)) (@gval (@coset_groupType gT (@gval gT H)) (@quotient_group gT G (@gval gT H)))) *)
by rewrite quotient_simple.
Qed.
Lemma sol_prime_factor_exists :
solvable G -> G :!=: 1 -> {H : {group gT} | H <| G & prime #|G : H| }.
Proof.
(* Goal: forall (_ : is_true (@solvable gT (@gval gT G))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)) : @set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))))), @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 (@normal gT (@gval gT H) (@gval gT G))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (prime (@indexg gT (@gval gT G) (@gval gT H)))) *)
move=> solG /ex_maxnormal_ntrivg[H maxH].
(* 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 (@normal gT (@gval gT H) (@gval gT G))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (prime (@indexg gT (@gval gT G) (@gval gT H)))) *)
by exists H; [apply: maxnormal_normal | apply: index_maxnormal_sol_prime].
Qed.
End SolvablePrimeFactor.
Section Special.
Variables (gT : finGroupType) (p : nat) (A G : {group gT}).
Lemma center_special_abelem : p.-group G -> special G -> p.-abelem 'Z(G).
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : @special gT (@gval gT G)), is_true (@abelem gT p (@center gT (@gval gT G))) *)
move=> pG [defPhi defG'].
(* Goal: is_true (@abelem gT p (@center gT (@gval gT G))) *)
have [-> | ntG] := eqsVneq G 1; first by rewrite center1 abelem1.
(* Goal: is_true (@abelem gT p (@center gT (@gval gT G))) *)
have [p_pr _ _] := pgroup_pdiv pG ntG.
(* Goal: is_true (@abelem gT p (@center gT (@gval gT G))) *)
have fM: {in 'Z(G) &, {morph expgn^~ p : x y / x * y}}.
(* Goal: is_true (@abelem gT p (@center gT (@gval gT G))) *)
(* 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)) (@center gT (@gval gT G)))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) p) (@mulg (FinGroup.base gT) (@expgn (FinGroup.base gT) x p) (@expgn (FinGroup.base gT) y p))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y))) *)
by move=> x y /setIP[_ /centP cxG] /setIP[/cxG cxy _]; apply: expgMn.
(* Goal: is_true (@abelem gT p (@center gT (@gval gT G))) *)
rewrite abelemE //= center_abelian; apply/exponentP=> /= z Zz.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) z p) (oneg (FinGroup.base gT)) *)
apply: (@kerP _ _ _ (Morphism fM)) => //; apply: subsetP z Zz.
(* 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)) (@center 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 gT (@gval gT (@center_group gT G)) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM) (@MorPhantom gT gT (@mfun gT gT (@gval gT (@center_group gT G)) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM))))))) *)
rewrite -{1}defG' gen_subG; apply/subsetP=> _ /imset2P[x y Gx Gy ->].
(* 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 (@ker_group gT gT (@center_group gT G) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM) (@MorPhantom gT gT (@mfun gT gT (@gval gT (@center_group gT G)) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM)))))))) *)
have Zxy: [~ x, y] \in 'Z(G) by rewrite -defG' mem_commg.
(* 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 (@ker_group gT gT (@center_group gT G) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM) (@MorPhantom gT gT (@mfun gT gT (@gval gT (@center_group gT G)) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM)))))))) *)
have Zxp: x ^+ p \in 'Z(G).
(* 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 (@ker_group gT gT (@center_group gT G) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM) (@MorPhantom gT gT (@mfun gT gT (@gval gT (@center_group gT G)) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM)))))))) *)
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x 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)) (@center gT (@gval gT G))))) *)
rewrite -defPhi (Phi_joing pG) (MhoE 1 pG) joing_idr mem_gen // !inE.
(* 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 (@ker_group gT gT (@center_group gT G) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM) (@MorPhantom gT gT (@mfun gT gT (@gval gT (@center_group gT G)) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM)))))))) *)
(* Goal: is_true (orb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) x 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)) (@derived_at (S O) gT (@gval gT G))))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@expgn (FinGroup.base gT) x 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)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @expgn (FinGroup.base gT) x (expn p (S O))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 expn1 orbC (mem_imset (expgn^~ p)).
(* 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 (@ker_group gT gT (@center_group gT G) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM) (@MorPhantom gT gT (@mfun gT gT (@gval gT (@center_group gT G)) (@Morphism gT gT (@center gT (@gval gT G)) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x p) fM)))))))) *)
rewrite mem_morphpre /= ?defG' ?Zxy // inE -commXg; last first.
(* Goal: is_true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base gT))) (@commg gT (@expgn (FinGroup.base gT) x p) y) (oneg (FinGroup.base gT))) *)
(* Goal: @commute (FinGroup.base gT) x (@commg gT x y) *)
by red; case/setIP: Zxy => _ /centP->.
(* Goal: is_true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base gT))) (@commg gT (@expgn (FinGroup.base gT) x p) y) (oneg (FinGroup.base gT))) *)
by apply/commgP; red; case/setIP: Zxp => _ /centP->.
Qed.
Lemma exponent_special : p.-group G -> special G -> exponent G %| p ^ 2.
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : @special gT (@gval gT G)), is_true (dvdn (@exponent gT (@gval gT G)) (expn p (S (S O)))) *)
move=> pG spG; have [defPhi _] := spG.
(* Goal: is_true (dvdn (@exponent gT (@gval gT G)) (expn p (S (S O)))) *)
have /and3P[_ _ expZ] := center_special_abelem pG spG.
(* Goal: is_true (dvdn (@exponent gT (@gval gT G)) (expn p (S (S O)))) *)
apply/exponentP=> x Gx; rewrite expgM (exponentP expZ) // -defPhi.
(* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x 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)) (@Frattini gT (@gval gT G))))) *)
by rewrite (Phi_joing pG) mem_gen // inE orbC (Mho_p_elt 1) ?(mem_p_elt pG).
Qed.
Theorem abelian_charsimple_special :
p.-group G -> coprime #|G| #|A| -> [~: G, A] = G ->
End Special.
Section Extraspecial.
Variables (p : nat) (gT rT : finGroupType).
Implicit Types D E F G H K M R S T U : {group gT}.
Section Basic.
Variable S : {group gT}.
Hypotheses (pS : p.-group S) (esS : extraspecial S).
Let pZ : p.-group 'Z(S) := pgroupS (center_sub S) pS.
Lemma extraspecial_prime : prime p.
Proof.
(* Goal: is_true (prime p) *)
by case: esS => _ /prime_gt1; rewrite cardG_gt1; case/(pgroup_pdiv pZ).
Qed.
Lemma card_center_extraspecial : #|'Z(S)| = p.
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)) (@center gT (@gval gT S))))) p *)
by apply/eqP; apply: (pgroupP pZ); case: esS.
Qed.
Lemma min_card_extraspecial : #|S| >= p ^ 3.
Proof.
(* Goal: is_true (leq (expn p (Datatypes.S (Datatypes.S (Datatypes.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 S))))) *)
have p_gt1 := prime_gt1 extraspecial_prime.
(* Goal: is_true (leq (expn p (Datatypes.S (Datatypes.S (Datatypes.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 S))))) *)
rewrite leqNgt (card_pgroup pS) ltn_exp2l // ltnS.
(* Goal: is_true (negb (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 S))))) (Datatypes.S (Datatypes.S O)))) *)
case: esS => [[_ defS']]; apply: contraL => /(p2group_abelian pS)/derG1P S'1.
(* Goal: is_true (negb (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)) (@center gT (@gval gT S))))))) *)
by rewrite -defS' S'1 cards1.
Qed.
End Basic.
Lemma card_p3group_extraspecial E :
prime p -> #|E| = (p ^ 3)%N -> #|'Z(E)| = p -> extraspecial E.
Lemma p3group_extraspecial G :
p.-group G -> ~~ abelian G -> logn p #|G| <= 3 -> extraspecial G.
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (negb (@abelian gT (@gval gT G)))) (_ : 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))))) (S (S (S O))))), @extraspecial gT (@gval gT G) *)
move=> pG not_cGG; have /andP[sZG nZG] := center_normal G.
(* Goal: forall _ : 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))))) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
have ntG: G :!=: 1 by apply: contraNneq not_cGG => ->; apply: abelian1.
(* Goal: forall _ : 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))))) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
have ntZ: 'Z(G) != 1 by rewrite (center_nil_eq1 (pgroup_nil pG)).
(* Goal: forall _ : 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))))) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
have [p_pr _ [n oG]] := pgroup_pdiv pG ntG; rewrite oG pfactorK //.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
have [_ _ [m oZ]] := pgroup_pdiv (pgroupS sZG pG) ntZ.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
have lt_m1_n: m.+1 < n.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
(* Goal: is_true (leq (S (S m)) n) *)
suffices: 1 < logn p #|(G / 'Z(G))|.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
(* Goal: is_true (leq (S (S O)) (logn p (@card (@coset_finType gT (@center gT (@gval gT G))) (@mem (Finite.sort (@coset_finType gT (@center gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@center gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@center gT (@gval gT G))) (@quotient gT (@gval gT G) (@center gT (@gval gT G)))))))) *)
(* Goal: forall _ : is_true (leq (S (S O)) (logn p (@card (@coset_finType gT (@center gT (@gval gT G))) (@mem (Finite.sort (@coset_finType gT (@center gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@center gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@center gT (@gval gT G))) (@quotient gT (@gval gT G) (@center gT (@gval gT G)))))))), is_true (leq (S (S m)) n) *)
rewrite card_quotient // -divgS // logn_div ?cardSg //.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
(* Goal: is_true (leq (S (S O)) (logn p (@card (@coset_finType gT (@center gT (@gval gT G))) (@mem (Finite.sort (@coset_finType gT (@center gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@center gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@center gT (@gval gT G))) (@quotient gT (@gval gT G) (@center gT (@gval gT G)))))))) *)
(* Goal: forall _ : is_true (leq (S (S O)) (subn (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 (@center_group gT G)))))))), is_true (leq (S (S m)) n) *)
by rewrite oG oZ !pfactorK // ltn_subRL addn1.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
(* Goal: is_true (leq (S (S O)) (logn p (@card (@coset_finType gT (@center gT (@gval gT G))) (@mem (Finite.sort (@coset_finType gT (@center gT (@gval gT G)))) (predPredType (Finite.sort (@coset_finType gT (@center gT (@gval gT G))))) (@SetDef.pred_of_set (@coset_finType gT (@center gT (@gval gT G))) (@quotient gT (@gval gT G) (@center gT (@gval gT G)))))))) *)
rewrite ltnNge; apply: contra not_cGG => cycGs.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
(* Goal: is_true (@abelian gT (@gval gT G)) *)
apply: cyclic_center_factor_abelian; rewrite (dvdn_prime_cyclic p_pr) //.
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
(* Goal: is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@center gT (@gval gT G))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@center gT (@gval gT G)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@center gT (@gval gT G))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@center gT (@gval gT G))))) (@gval (@coset_groupType gT (@center gT (@gval gT G))) (@quotient_group gT G (@center gT (@gval gT G))))))) p) *)
by rewrite (card_pgroup (quotient_pgroup _ pG)) (dvdn_exp2l _ cycGs).
(* Goal: forall _ : is_true (leq (S n) (S (S (S O)))), @extraspecial gT (@gval gT G) *)
rewrite -{lt_m1_n}(subnKC lt_m1_n) !addSn !ltnS leqn0 in oG *.
case: m => // in oZ oG * => /eqP n2; rewrite {n}n2 in oG.
exact: card_p3group_extraspecial oZ.
Qed.
Qed.
Lemma extraspecial_nonabelian G : extraspecial G -> ~~ abelian G.
Proof.
(* Goal: forall _ : @extraspecial gT (@gval gT G), is_true (negb (@abelian gT (@gval gT G))) *)
case=> [[_ defG'] oZ]; rewrite /abelian (sameP commG1P eqP).
(* Goal: is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@commutator gT (@gval gT G) (@gval gT G)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *)
by rewrite -derg1 defG' -cardG_gt1 prime_gt1.
Qed.
Lemma exponent_2extraspecial G : 2.-group G -> extraspecial G -> exponent G = 4.
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat (S (S O))) (@gval gT G))) (_ : @extraspecial gT (@gval gT G)), @eq nat (@exponent gT (@gval gT G)) (S (S (S (S O)))) *)
move=> p2G esG; have [spG _] := esG.
(* Goal: @eq nat (@exponent gT (@gval gT G)) (S (S (S (S O)))) *)
case/dvdn_pfactor: (exponent_special p2G spG) => // k.
(* Goal: forall (_ : is_true (leq k (S (S O)))) (_ : @eq nat (@exponent gT (@gval gT G)) (expn (S (S O)) k)), @eq nat (@exponent gT (@gval gT G)) (S (S (S (S O)))) *)
rewrite leq_eqVlt ltnS => /predU1P[-> // | lek1] expG.
(* Goal: @eq nat (@exponent gT (@gval gT G)) (S (S (S (S O)))) *)
case/negP: (extraspecial_nonabelian esG).
(* Goal: is_true (@abelian gT (@gval gT G)) *)
by rewrite (@abelem_abelian _ 2) ?exponent2_abelem // expG pfactor_dvdn.
Qed.
Lemma injm_special D G (f : {morphism D >-> rT}) :
'injm f -> G \subset D -> special G -> special (f @* G).
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (_ : @special gT (@gval gT G)), @special rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
move=> injf sGD [defPhiG defG'].
(* Goal: @special rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite /special -morphim_der // -injm_Phi // defPhiG defG' injm_center.
Qed.
Lemma injm_extraspecial D G (f : {morphism D >-> rT}) :
'injm f -> G \subset D -> extraspecial G -> extraspecial (f @* G).
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (_ : @extraspecial gT (@gval gT G)), @extraspecial rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
move=> injf sGD [spG ZG_pr]; split; first exact: injm_special spG.
(* Goal: is_true (prime (@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)) (@center rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G))))))) *)
by rewrite -injm_center // card_injm // subIset ?sGD.
Qed.
Lemma isog_special G (R : {group rT}) :
G \isog R -> special G -> special R.
Proof.
(* Goal: forall (_ : is_true (@isog gT rT (@gval gT G) (@gval rT R))) (_ : @special gT (@gval gT G)), @special rT (@gval rT R) *)
by case/isogP=> f injf <-; apply: injm_special.
Qed.
Lemma isog_extraspecial G (R : {group rT}) :
G \isog R -> extraspecial G -> extraspecial R.
Proof.
(* Goal: forall (_ : is_true (@isog gT rT (@gval gT G) (@gval rT R))) (_ : @extraspecial gT (@gval gT G)), @extraspecial rT (@gval rT R) *)
by case/isogP=> f injf <-; apply: injm_extraspecial.
Qed.
Lemma cprod_extraspecial G H K :
p.-group G -> H \* K = G -> H :&: K = 'Z(H) ->
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT H) (@gval gT K)) (@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) (@gval gT K)) (@center gT (@gval gT H))) (_ : @extraspecial gT (@gval gT H)) (_ : @extraspecial gT (@gval gT K)), @extraspecial gT (@gval gT G) *)
move=> pG defG ziHK [[PhiH defH'] ZH_pr] [[PhiK defK'] ZK_pr].
(* Goal: @extraspecial gT (@gval gT G) *)
have [_ defHK cHK]:= cprodP defG.
(* Goal: @extraspecial gT (@gval gT G) *)
have sZHK: 'Z(H) \subset 'Z(K).
(* Goal: @extraspecial 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)) (@center 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)) (@center gT (@gval gT K))))) *)
by rewrite subsetI -{1}ziHK subsetIr subIset // centsC cHK.
(* Goal: @extraspecial gT (@gval gT G) *)
have{sZHK} defZH: 'Z(H) = 'Z(K).
(* Goal: @extraspecial gT (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT H)) (@center gT (@gval gT K)) *)
by apply/eqP; rewrite eqEcard sZHK leq_eqVlt eq_sym -dvdn_prime2 ?cardSg.
(* Goal: @extraspecial gT (@gval gT G) *)
have defZ: 'Z(G) = 'Z(K).
(* Goal: @extraspecial gT (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT G)) (@center gT (@gval gT K)) *)
by case/cprodP: (center_cprod defG) => /= _ <- _; rewrite defZH mulGid.
(* Goal: @extraspecial gT (@gval gT G) *)
split; first split; rewrite defZ //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@center gT (@gval gT K)) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Frattini gT (@gval gT G)) (@center gT (@gval gT K)) *)
by have /cprodP[_ <- _] := Phi_cprod pG defG; rewrite PhiH PhiK defZH mulGid.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT (@gval gT G)) (@center gT (@gval gT K)) *)
by have /cprodP[_ <- _] := der_cprod 1 defG; rewrite defH' defK' defZH mulGid.
Qed.
Section ExtraspecialFormspace.
Variable G : {group gT}.
Hypotheses (pG : p.-group G) (esG : extraspecial G).
Let p_pr := extraspecial_prime pG esG.
Let oZ := card_center_extraspecial pG esG.
Let p_gt1 := prime_gt1 p_pr.
Let p_gt0 := prime_gt0 p_pr.
Lemma cent1_extraspecial_maximal x :
x \in G -> x \notin 'Z(G) -> maximal 'C_G[x] G.
Lemma subcent1_extraspecial_maximal U x :
U \subset G -> x \in G :\: 'C(U) -> maximal 'C_U[x] U.
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 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))))) (_ : 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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT U))))))), is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT U) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@gval gT U)) *)
move=> sUG /setDP[Gx not_cUx]; apply/maxgroupP; split=> [|H ltHU sCxH].
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@setI_group gT U (@normaliser_group gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* 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)) (@gval gT (@setI_group gT U (@normaliser_group 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)) (@gval gT U)))) *)
by rewrite /proper subsetIl subsetI subxx sub_cent1.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@setI_group gT U (@normaliser_group gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
case/andP: ltHU => sHU not_sHU; have sHG := subset_trans sHU sUG.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval gT (@setI_group gT U (@normaliser_group gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
apply/eqP; rewrite eqEsubset sCxH subsetI sHU /= andbT.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))))) *)
apply: contraR not_sHU => not_sHCx.
(* 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 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 H)))) *)
have maxCx: maximal 'C_G[x] 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 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 H)))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@gval gT G)) *)
rewrite cent1_extraspecial_maximal //; apply: contra not_cUx.
(* 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 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 H)))) *)
(* 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)) (@center gT (@gval gT G))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT U))))) *)
by rewrite inE Gx; apply: subsetP (centS sUG) _.
(* 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 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 H)))) *)
have nsCx := p_maximal_normal pG maxCx.
(* 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 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 H)))) *)
rewrite -(setIidPl sUG) -(mulg_normal_maximal nsCx maxCx sHG) ?subsetI ?sHG //.
(* 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 U) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT (@setI_group gT G (@normaliser_group gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) (@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 -group_modr //= setIA (setIidPl sUG) mul_subG.
Qed.
Lemma card_subcent_extraspecial U :
U \subset G -> #|'C_G(U)| = (#|'Z(G) :&: U| * #|G : U|)%N.
Lemma split1_extraspecial x :
x \in G :\: 'Z(G) ->
{E : {group gT} & {R : {group gT} |
[/\ #|E| = (p ^ 3)%N /\ #|R| = #|G| %/ p ^ 2,
E \* R = G /\ E :&: R = 'Z(E),
'Z(E) = 'Z(G) /\ 'Z(R) = 'Z(G),
extraspecial E /\ x \in E
& if abelian R then R :=: 'Z(G) else extraspecial R]}}.
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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@center gT (@gval gT G)))))), @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
case/setDP=> Gx notZx; rewrite inE Gx /= in notZx.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
have [[defPhiG defG'] prZ] := esG.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
have maxCx: maximal 'C_G[x] G.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@gval gT G)) *)
by rewrite subcent1_extraspecial_maximal // inE notZx.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
pose y := repr (G :\: 'C[x]).
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
have [Gy not_cxy]: y \in G /\ y \notin 'C[x].
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
move/maxgroupp: maxCx => /properP[_ [t Gt not_cyt]].
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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 apply/setDP; apply: (mem_repr t); rewrite !inE Gt andbT in not_cyt *.
pose E := <[x]> <*> <[y]>; pose R := 'C_G(E).
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
exists [group of E]; exists [group of R] => /=.
have sEG: E \subset G by rewrite join_subG !cycle_subG Gx.
have [Ex Ey]: x \in E /\ y \in E by rewrite !mem_gen // inE cycle_id ?orbT.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
have sZE: 'Z(G) \subset E.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
rewrite (('Z(G) =P E^`(1)) _) ?der_sub // eqEsubset -{2}defG' dergS // andbT.
apply: contraR not_cxy => /= not_sZE'.
rewrite (sameP cent1P commgP) -in_set1 -[[set 1]](prime_TIg prZ not_sZE').
by rewrite /= -defG' inE !mem_commg.
have ziER: E :&: R = 'Z(E) by rewrite setIA (setIidPl sEG).
have cER: R \subset 'C(E) by rewrite subsetIr.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
have iCxG: #|G : 'C_G[x]| = p by apply: p_maximal_index.
have maxR: maximal R 'C_G[x].
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT R (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
rewrite /R centY !cent_cycle setIA.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
rewrite subcent1_extraspecial_maximal ?subsetIl // inE Gy andbT -sub_cent1.
by apply/subsetPn; exists x; rewrite 1?cent1C // inE Gx cent1id.
have sRCx: R \subset 'C_G[x] by rewrite -cent_cycle setIS ?centS ?joing_subl.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
have sCxG: 'C_G[x] \subset G by rewrite subsetIl.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
have sRG: R \subset G by rewrite subsetIl.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
have iRCx: #|'C_G[x] : R| = p by rewrite (p_maximal_index (pgroupS sCxG pG)).
have defG: E * R = G.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) E R) (@gval gT G) *)
rewrite -cent_joinEr //= -/R joingC joingA.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
have cGx_x: <[x]> \subset 'C_G[x] by rewrite cycle_subG inE Gx cent1id.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
have nsRcx := p_maximal_normal (pgroupS sCxG pG) maxR.
rewrite (norm_joinEr (subset_trans cGx_x (normal_norm nsRcx))).
rewrite (mulg_normal_maximal nsRcx) //=; last first.
by rewrite centY !cent_cycle cycle_subG !in_setI Gx cent1id cent1C.
have nsCxG := p_maximal_normal pG maxCx.
have syG: <[y]> \subset G by rewrite cycle_subG.
rewrite (norm_joinEr (subset_trans syG (normal_norm nsCxG))).
by rewrite (mulg_normal_maximal nsCxG) //= cycle_subG inE Gy.
have defZR: 'Z(R) = 'Z(G) by rewrite -['Z(R)]setIA -centM defG.
have defZE: 'Z(E) = 'Z(G).
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@gval gT G)) *)
by rewrite -defG -center_prod ?mulGSid //= -ziER subsetI center_sub defZR sZE.
have [n oG] := p_natP pG.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@gval gT G)) *)
have n_gt1: n > 1.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@gval gT G)) *)
(* Goal: is_true (leq (S (S O)) n) *)
by rewrite ltnW // -(@leq_exp2l p) // -oG min_card_extraspecial.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@gval gT G)) *)
have oR: #|R| = (p ^ n.-2)%N.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@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)) R))) (expn p (Nat.pred (Nat.pred n))) *)
apply/eqP; rewrite -(divg_indexS sRCx) iRCx /= -(divg_indexS sCxG) iCxG /= oG.
by rewrite -{1}(subnKC n_gt1) subn2 !expnS !mulKn.
have oE: #|E| = (p ^ 3)%N.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@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)) R))) (expn p (Nat.pred (Nat.pred n))) *)
(* 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)) E))) (expn p (S (S (S O)))) *)
apply/eqP; rewrite -(@eqn_pmul2r #|R|) ?cardG_gt0 // mul_cardG defG ziER.
by rewrite defZE oZ oG -{1}(subnKC n_gt1) oR -expnSr -expnD subn2.
rewrite cprodE // oR oG -expnB ?subn2 //; split=> //.
by split=> //; apply: card_p3group_extraspecial _ oE _; rewrite // defZE.
case: ifP => [cRR | not_cRR]; first by rewrite -defZR (center_idP _).
split; rewrite /special defZR //.
have ntR': R^`(1) != 1 by rewrite (sameP eqP commG1P) -abelianE not_cRR.
have pR: p.-group R := pgroupS sRG pG.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@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)) R))) (expn p (Nat.pred (Nat.pred n))) *)
(* 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)) E))) (expn p (S (S (S O)))) *)
have pR': p.-group R^`(1) := pgroupS (der_sub 1 _) pR.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@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)) R))) (expn p (Nat.pred (Nat.pred n))) *)
(* 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)) E))) (expn p (S (S (S O)))) *)
have defR': R^`(1) = 'Z(G).
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@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)) R))) (expn p (Nat.pred (Nat.pred n))) *)
(* 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)) E))) (expn p (S (S (S O)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@derived_at (S O) gT R) (@center gT (@gval gT G)) *)
apply/eqP; rewrite eqEcard -{1}defG' dergS //= oZ.
(* Goal: @sigT (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @sig (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun R : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and5 (and (@eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (S (S (S O))))) (@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 R)))) (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)))) (expn p (S (S O)))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT G))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT G)))) (and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT G)) else @extraspecial gT (@gval gT R)))) *)
(* Goal: and (is_true (@in_mem (FinGroup.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 (negb (@in_mem (FinGroup.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))))))) *)
(* 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)) (@center 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)) E))) *)
(* Goal: is_true (@maximal gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@normaliser gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@joing gT (@joing gT R (@cycle gT x)) (@cycle gT y)) (@gval gT G) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT E) (@center gT (@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)) R))) (expn p (Nat.pred (Nat.pred n))) *)
(* 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)) E))) (expn p (S (S (S O)))) *)
(* Goal: is_true (leq 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)) (@derived_at (S O) gT R))))) *)
by have [_ _ [k ->]]:= pgroup_pdiv pR' ntR'; rewrite (leq_exp2l 1).
split=> //; apply/eqP; rewrite eqEsubset -{1}defPhiG -defR' (PhiS pG) //=.
by rewrite (Phi_joing pR) joing_subl.
Qed.
Qed.
Lemma pmaxElem_extraspecial : 'E*_p(G) = 'E_p^('r_p(G))(G).
Proof.
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)) *)
have sZmax: {in 'E*_p(G), forall E, 'Z(G) \subset E}.
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)) *)
(* Goal: @prop_in1 (Finite.sort (group_finType gT)) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))) (fun E : @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)) (@center 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 E))))) (inPhantom (forall E : @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)) (@center 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 E)))))) *)
move=> E maxE; have defE := pmaxElem_LdivP p_pr maxE.
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@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)) (@center 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 E)))) *)
have abelZ: p.-abelem 'Z(G) by rewrite prime_abelem ?oZ.
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@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)) (@center 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 E)))) *)
rewrite -(Ohm1_id abelZ) (OhmE 1 (abelem_pgroup abelZ)) gen_subG -defE.
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@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 (@center_group gT G)) (Ldiv gT (expn p (S O)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT E))) (Ldiv gT p))))) *)
by rewrite setSI // setIS ?centS // -defE !subIset ?subxx.
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)) *)
suffices card_max: {in 'E*_p(G) &, forall E F, #|E| <= #|F| }.
(* Goal: @prop_in2 (Finite.sort (group_finType gT)) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))) (fun E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (inPhantom (forall E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))))) *)
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)) *)
have EprGmax: 'E_p^('r_p(G))(G) \subset 'E*_p(G) := p_rankElem_max p G.
(* Goal: @prop_in2 (Finite.sort (group_finType gT)) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))) (fun E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (inPhantom (forall E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))))) *)
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)) *)
have [E EprE]:= p_rank_witness p G; have maxE := subsetP EprGmax E EprE.
(* Goal: @prop_in2 (Finite.sort (group_finType gT)) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))) (fun E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (inPhantom (forall E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))))) *)
(* Goal: @eq (@set_of (group_finType gT) (Phant (Finite.sort (group_finType gT)))) (@pmaxElem gT p (@gval gT G)) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G)) *)
apply/eqP; rewrite eqEsubset EprGmax andbT; apply/subsetP=> F maxF.
(* Goal: @prop_in2 (Finite.sort (group_finType gT)) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))) (fun E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (inPhantom (forall E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))))) *)
(* Goal: is_true (@in_mem (Finite.sort (group_finType gT)) F (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pnElem gT p (@p_rank gT p (@gval gT G)) (@gval gT G))))) *)
rewrite inE; have [-> _]:= pmaxElemP maxF; have [_ _ <-]:= pnElemP EprE.
(* Goal: @prop_in2 (Finite.sort (group_finType gT)) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))) (fun E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (inPhantom (forall E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))))) *)
(* Goal: is_true (andb true (@eq_op nat_eqType (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) (logn p (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E))))))) *)
by apply/eqP; congr (logn p _); apply/eqP; rewrite eqn_leq !card_max.
(* Goal: @prop_in2 (Finite.sort (group_finType gT)) (@mem (Finite.sort (group_finType gT)) (predPredType (Finite.sort (group_finType gT))) (@SetDef.pred_of_set (group_finType gT) (@pmaxElem gT p (@gval gT G)))) (fun E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F)))))) (inPhantom (forall E F : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))), 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))))) *)
move=> E F maxE maxF; set U := E :&: F.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have [sUE sUF]: U \subset E /\ U \subset F by apply/andP; rewrite -subsetI.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have sZU: 'Z(G) \subset U by rewrite subsetI !sZmax.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have [EpE _]:= pmaxElemP maxE; have{EpE} [sEG abelE] := pElemP EpE.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have [EpF _]:= pmaxElemP maxF; have{EpF} [sFG abelF] := pElemP EpF.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have [V] := abelem_split_dprod abelE sUE; case/dprodP=> _ defE cUV tiUV.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have [W] := abelem_split_dprod abelF sUF; case/dprodP=> _ defF _ tiUW.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have [sVE sWF]: V \subset E /\ W \subset F by rewrite -defE -defF !mulG_subr.
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
have [sVG sWG] := (subset_trans sVE sEG, subset_trans sWF sFG).
(* 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 E)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT F))))) *)
rewrite -defE -defF !TI_cardMg // leq_pmul2l ?cardG_gt0 //.
(* 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 V)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT W))))) *)
rewrite -(leq_pmul2r (cardG_gt0 'C_G(W))) mul_cardG.
(* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT V) (@gval gT (@setI_group gT G (@centraliser_group gT (@gval gT W)))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 V) (@gval gT (@setI_group gT G (@centraliser_group gT (@gval gT W))))))))) (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 W)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (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 (@gval gT W))))))))) *)
rewrite card_subcent_extraspecial // mulnCA Lagrange // mulnC.
(* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT V) (@gval gT (@setI_group gT G (@centraliser_group gT (@gval gT W)))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 V) (@gval gT (@setI_group gT G (@centraliser_group gT (@gval gT W))))))))) (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)) (@center gT (@gval gT G)) (@gval gT W))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 leq_mul ?subset_leq_card //; last by rewrite mul_subG ?subsetIl.
(* 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 V) (@gval gT (@setI_group gT G (@centraliser_group gT (@gval gT W))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@center gT (@gval gT G)) (@gval gT W))))) *)
apply: subset_trans (sub1G _); rewrite -tiUV !subsetI subsetIl subIset ?sVE //=.
(* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT V) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT W)))))) (@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 F)))) true) *)
rewrite -(pmaxElem_LdivP p_pr maxF) -defF centM -!setIA -(setICA 'C(W)).
(* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT V) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT W)))))) (@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) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT W)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (@setI_group gT E F))) (Ldiv gT p))))))) true) *)
rewrite setIC setIA setIS // subsetI cUV sub_LdivT.
(* Goal: is_true (andb true (dvdn (@exponent gT (@gval gT V)) p)) *)
by case/and3P: (abelemS sVE abelE).
Qed.
End ExtraspecialFormspace.
Lemma critical_extraspecial R S :
p.-group R -> S \subset R -> extraspecial S -> [~: S, R] \subset S^`(1) ->
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT R))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT S))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R))))) (_ : @extraspecial gT (@gval 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)) (@commutator gT (@gval gT S) (@gval gT R)))) (@mem (Finite.sort (FinGroup.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 (Datatypes.S O) gT (@gval gT S)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (@gval gT R) *)
move=> pR sSR esS sSR_S'; have [[defPhi defS'] _] := esS.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (@gval gT R) *)
have [pS [sPS nPS]] := (pgroupS sSR pR, andP (Phi_normal S : 'Phi(S) <| S)).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (@gval gT R) *)
have{esS} oZS: #|'Z(S)| = p := card_center_extraspecial pS esS.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (@gval gT R) *)
have nSR: R \subset 'N(S) by rewrite -commg_subl (subset_trans sSR_S') ?der_sub.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (@gval gT R) *)
have nsCR: 'C_R(S) <| R by rewrite (normalGI nSR) ?cent_normal.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (@gval gT R) *)
have nCS: S \subset 'N('C_R(S)) by rewrite cents_norm // centsC subsetIr.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (@gval gT R) *)
rewrite cprodE ?subsetIr //= -{2}(quotientGK nsCR) normC -?quotientK //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@morphpre gT (@coset_groupType gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@normaliser gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@coset_morphism gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@MorPhantom gT (@coset_groupType gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@coset gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S)))))) (@quotient gT (@gval gT S) (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S)))))) (@morphpre gT (@coset_groupType gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@normaliser gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@coset_morphism gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@MorPhantom gT (@coset_groupType gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S))))) (@coset gT (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S)))))) (@quotient gT (@gval gT R) (@gval gT (@setI_group gT R (@centraliser_group gT (@gval gT S)))))) *)
congr (_ @*^-1 _); apply/eqP; rewrite eqEcard quotientS //=.
(* Goal: is_true (leq (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@mem (@coset_of gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (predPredType (@coset_of gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@quotient gT (@gval gT R) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@mem (@coset_of gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (predPredType (@coset_of gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@quotient gT (@gval gT S) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))))))) *)
rewrite -(card_isog (second_isog nCS)) setIAC (setIidPr sSR) /= -/'Z(S) -defPhi.
(* Goal: is_true (leq (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@mem (@coset_of gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S)))) (predPredType (@coset_of gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))) (@quotient gT (@gval gT R) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT R) (@centraliser gT (@gval gT S))))))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
rewrite -ker_conj_aut (card_isog (first_isog_loc _ nSR)) //=; set A := _ @* R.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
have{pS} abelSb := Phi_quotient_abelem pS; have [pSb cSSb _] := and3P abelSb.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
have [/= Xb defSb oXb] := grank_witness (S / 'Phi(S)).
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
pose X := (repr \o val : coset_of _ -> gT) @: Xb.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
have sXS: X \subset S; last have nPX := subset_trans sXS nPS.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* 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)) X)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT S)))) *)
apply/subsetP=> x; case/imsetP=> xb Xxb ->; have nPx := repr_coset_norm xb.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@funcomp (FinGroup.sort (FinGroup.base gT)) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@sub_sort (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@Frattini gT (@gval gT S)))) (@coset_subType gT (@Frattini gT (@gval gT S)))) tt (@repr (FinGroup.base gT)) (@val (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@pred_of_simpl (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (@coset_range gT (@Frattini gT (@gval gT S)))) (@coset_subType gT (@Frattini gT (@gval gT S)))) xb) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT S)))) *)
rewrite -sub1set -(quotientSGK _ sPS) ?sub1set ?quotient_set1 //= sub1set.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@in_mem (Finite.sort (@coset_finType gT (@Frattini gT (@gval gT S)))) (@coset gT (@Frattini gT (@gval gT S)) (@repr (FinGroup.base gT) (@set_of_coset gT (@Frattini gT (@gval gT S)) xb))) (@mem (Finite.sort (@coset_finType gT (@Frattini gT (@gval gT S)))) (predPredType (Finite.sort (@coset_finType gT (@Frattini gT (@gval gT S))))) (@SetDef.pred_of_set (@coset_finType gT (@Frattini gT (@gval gT S))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S)))))) *)
by rewrite coset_reprK -defSb mem_gen.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
have defS: <<X>> = S.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT X) (@gval gT S) *)
apply: Phi_nongen; apply/eqP; rewrite eqEsubset join_subG sPS sXS -joing_idr.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* 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)) (@gval gT S))) (@mem (Finite.sort (FinGroup.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 (@Frattini gT (@gval gT S)) (@generated gT X)))))) *)
rewrite -genM_join sub_gen // -quotientSK ?quotient_gen // -defSb genS //.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S)))))) Xb)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S)))))) (@quotient gT X (@gval gT (@Frattini_group gT (@gval gT S))))))) *)
apply/subsetP=> xb Xxb; apply/imsetP; rewrite (setIidPr nPX).
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* 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)) X)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S))))))) xb (@mfun gT (@coset_groupType gT (@gval gT (@Frattini_group gT (@gval gT S)))) (@normaliser gT (@gval gT (@Frattini_group gT (@gval gT S)))) (@coset_morphism gT (@gval gT (@Frattini_group gT (@gval gT S)))) x)) *)
by exists (repr xb); rewrite /= ?coset_reprK //; apply: mem_imset.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
pose f (a : {perm gT}) := [ffun x => if x \in X then x^-1 * a x else 1].
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
have injf: {in A &, injective f}.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: @prop_in2 (Finite.sort (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))))) A)) (fun x1 x2 : @perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT))) => forall _ : @eq (@finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), FinGroup.sort (FinGroup.base gT)))) (f x1) (f x2), @eq (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) x1 x2) (inPhantom (@injective (@finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), FinGroup.sort (FinGroup.base gT)))) (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) f)) *)
move=> _ _ /morphimP[y nSy Ry ->] /morphimP[z nSz Rz ->].
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: forall _ : @eq (@finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), FinGroup.sort (FinGroup.base gT)))) (f (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT S)) (@conj_aut_morphism gT S) y)) (f (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT S)) (@conj_aut_morphism gT S) z)), @eq (@perm_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT S)) (@conj_aut_morphism gT S) y) (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT S)) (@conj_aut_morphism gT S) z) *)
move/ffunP=> eq_fyz; apply: (@eq_Aut _ S); rewrite ?Aut_aut //= => x Sx.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@conj_aut gT S y) x) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@conj_aut gT S z) x) *)
rewrite !norm_conj_autE //; apply: canRL (conjgKV z) _; rewrite -conjgM.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@conjg gT x (@mulg (FinGroup.base gT) y (@invg (FinGroup.base gT) z))) x *)
rewrite /conjg -(centP _ x Sx) ?mulKg {x Sx}// -defS cent_gen -sub_cent1.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* 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)) X)) (@mem (Finite.sort (FinGroup.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)) (@mulg (FinGroup.base gT) y (@invg (FinGroup.base gT) z))))))) *)
apply/subsetP=> x Xx; have Sx := subsetP sXS x Xx.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* 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 (@set1 (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) y (@invg (FinGroup.base gT) z))))))) *)
move/(_ x): eq_fyz; rewrite !ffunE Xx !norm_conj_autE // => /mulgI xy_xz.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* 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 (@set1 (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) y (@invg (FinGroup.base gT) z))))))) *)
by rewrite cent1C inE conjg_set1 conjgM xy_xz conjgK.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
have sfA_XS': f @: A \subset pffun_on 1 X S^`(1).
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@subset (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT))) (@Imset.imset (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT))) f (@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))))) A))))) (@mem (@finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (Equality.sort (FinGroup.eqType (FinGroup.base gT))) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), Equality.sort (FinGroup.eqType (FinGroup.base gT))))) (simplPredType (@finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (Equality.sort (FinGroup.eqType (FinGroup.base gT))) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), Equality.sort (FinGroup.eqType (FinGroup.base gT)))))) (@pffun_on_mem (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.eqType (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)) X)) (@mem (Finite.sort (FinGroup.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 (Datatypes.S O) gT (@gval gT S))))))) *)
apply/subsetP=> _ /imsetP[_ /morphimP[y nSy Ry ->] ->].
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@in_mem (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)))) (f (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT S)) (@conj_aut_morphism gT S) y)) (@mem (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT))))) (@pred_of_simpl (@finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (Equality.sort (FinGroup.eqType (FinGroup.base gT))) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), Equality.sort (FinGroup.eqType (FinGroup.base gT))))) (@pffun_on_mem (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.eqType (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)) X)) (@mem (Finite.sort (FinGroup.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 (Datatypes.S O) gT (@gval gT S)))))))) *)
apply/pffun_onP; split=> [|_ /imageP[x /= Xx ->]].
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (f (@conj_aut gT S y)) x) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@derived_at (Datatypes.S O) gT (@gval gT S))))) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (simplPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@support_for (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.eqType (FinGroup.finType (FinGroup.base gT))) (oneg (FinGroup.base gT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) (Equality.sort (Finite.eqType (FinGroup.finType (FinGroup.base gT)))) (f (@mfun gT (perm_of_finGroupType (FinGroup.arg_finType (FinGroup.base gT))) (@normaliser gT (@gval gT S)) (@conj_aut_morphism gT S) 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)) X))) *)
by apply/subsetP=> x; apply: contraR; rewrite ffunE => /negPf->.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (f (@conj_aut gT S y)) x) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@derived_at (Datatypes.S O) gT (@gval gT S))))) *)
have Sx := subsetP sXS x Xx.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@FunFinfun.fun_of_fin (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (f (@conj_aut gT S y)) x) (@mem (FinGroup.sort (FinGroup.base gT)) (predPredType (FinGroup.sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@derived_at (Datatypes.S O) gT (@gval gT S))))) *)
by rewrite ffunE Xx norm_conj_autE // (subsetP sSR_S') ?mem_commg.
(* Goal: is_true (leq (@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)))) A))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
rewrite -(card_in_imset injf) (leq_trans (subset_leq_card sfA_XS')) // defS'.
(* Goal: is_true (leq (@card (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (finfun_of_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT))))) (@pred_of_simpl (@finfun_of (FinGroup.arg_finType (FinGroup.base gT)) (Equality.sort (FinGroup.eqType (FinGroup.base gT))) (Phant (forall _ : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)), Equality.sort (FinGroup.eqType (FinGroup.base gT))))) (@pffun_on_mem (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.eqType (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)) X)) (@mem (Finite.sort (FinGroup.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 S)))))))) (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@quotient gT (@gval gT S) (@Frattini gT (@gval gT S))))))) *)
rewrite card_pffun_on (card_pgroup pSb) -rank_abelem -?grank_abelian // -oXb.
(* Goal: is_true (leq (expn (@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.arg_finType (FinGroup.base gT)) (@center gT (@gval 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)) X)))) (expn p (@card (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) (@mem (@coset_of gT (@Frattini gT (@gval gT S))) (predPredType (@coset_of gT (@Frattini gT (@gval gT S)))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@Frattini gT (@gval gT S)))) Xb))))) *)
by rewrite -oZS ?leq_pexp2l ?cardG_gt0 ?leq_imset_card.
Qed.
Theorem extraspecial_structure S : p.-group S -> extraspecial S ->
Proof.
(* Goal: forall (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT S))) (_ : @extraspecial gT (@gval gT S)), @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
elim: {S}_.+1 {-2}S (ltnSn #|S|) => // m IHm S leSm pS esS.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
have [x Z'x]: {x | x \in S :\: 'Z(S)}.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
(* Goal: @sig (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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT S) (@center gT (@gval gT S))))))) *)
apply/sigW/set0Pn; rewrite -subset0 subDset setU0.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
(* 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 S))) (@mem (Finite.sort (FinGroup.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 S)))))) *)
apply: contra (extraspecial_nonabelian esS) => sSZ.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
(* Goal: is_true (@abelian gT (@gval gT S)) *)
exact: abelianS sSZ (center_abelian S).
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
have [E [R [[oE oR]]]]:= split1_extraspecial pS esS Z'x.
(* Goal: forall (_ : and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (@gval gT R)) (@gval gT S)) (@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 E) (@gval gT R)) (@center gT (@gval gT E)))) (_ : and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT E)) (@center gT (@gval gT S))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@center gT (@gval gT R)) (@center gT (@gval gT S)))) (_ : and (@extraspecial gT (@gval gT E)) (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))))) (_ : if @abelian gT (@gval gT R) then @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT R) (@center gT (@gval gT S)) else @extraspecial gT (@gval gT R)), @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
case=> defS _ [defZE defZR] _; case: ifP => [_ defR | _ esR].
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
by exists [:: E]; rewrite /= ?oE ?defZE ?eqxx // big_seq1 -defR.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
have sRS: R \subset S by case/cprodP: defS => _ <- _; rewrite mulG_subr.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
have [|Es esEs defR] := IHm _ _ (pgroupS sRS pS) esR.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
(* Goal: is_true (leq (Datatypes.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 R))))) m) *)
rewrite oR (leq_trans (ltn_Pdiv _ _)) ?cardG_gt0 // (ltn_exp2l 0) //.
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
(* Goal: is_true (leq (S (S O)) p) *)
exact: prime_gt1 (extraspecial_prime pS esS).
(* Goal: @sig2 (list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (fun Es : list (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) => @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)) *)
exists (E :: Es); first by rewrite /= oE defZE !eqxx -defZR.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E Es) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S) *)
by rewrite -defZR big_cons -cprodA defR.
Qed.
Section StructureCorollaries.
Variable S : {group gT}.
Hypotheses (pS : p.-group S) (esS : extraspecial S).
Let p_pr := extraspecial_prime pS esS.
Let oZ := card_center_extraspecial pS esS.
Lemma card_extraspecial : {n | n > 0 & #|S| = (p ^ n.*2.+1)%N}.
Proof.
(* Goal: @sig2 nat (fun n : nat => is_true (leq (Datatypes.S O) n)) (fun n : nat => @eq nat (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT S)))) (expn p (Datatypes.S (double n)))) *)
exists (logn p #|S|)./2.
(* 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)) (@gval gT S)))) (expn p (Datatypes.S (double (half (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 S))))))))) *)
(* Goal: is_true (leq (Datatypes.S O) (half (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 S))))))) *)
rewrite half_gt0 ltnW // -(leq_exp2l _ _ (prime_gt1 p_pr)) -card_pgroup //.
(* 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)) (@gval gT S)))) (expn p (Datatypes.S (double (half (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 S))))))))) *)
(* Goal: is_true (leq (expn p (Datatypes.S (Datatypes.S (Datatypes.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 S))))) *)
exact: min_card_extraspecial.
(* 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)) (@gval gT S)))) (expn p (Datatypes.S (double (half (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 S))))))))) *)
have [Es] := extraspecial_structure pS esS.
(* Goal: forall (_ : is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) Es)) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) Es (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT S)), @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 S)))) (expn p (Datatypes.S (double (half (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 S))))))))) *)
elim: Es {3 4 5}S => [_ _ <-| E s IHs T] /=.
(* Goal: forall (_ : is_true (andb (andb (@eq_op nat_eqType (@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 E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@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 E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) s))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E s) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT T)), @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 T)))) (expn p (Datatypes.S (double (half (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)) (@gval gT T))))))))) *)
(* 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)) (central_product gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@nil (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S)))))) (expn p (Datatypes.S (double (half (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)) (central_product gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@nil (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))))))))))) *)
by rewrite big_nil cprod1g oZ (pfactorK 1).
(* Goal: forall (_ : is_true (andb (andb (@eq_op nat_eqType (@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 E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@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 E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) s))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@cons (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E s) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) E (central_product gT) true (@gval gT E))) (@center gT (@gval gT S))) (@gval gT T)), @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 T)))) (expn p (Datatypes.S (double (half (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)) (@gval gT T))))))))) *)
rewrite -andbA big_cons -cprodA; case/and3P; move/eqP=> oEp3; move/eqP=> defZE.
(* Goal: forall (_ : is_true (@all (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun E : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@eq_op nat_eqType (@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 E)))) (expn p (Datatypes.S (Datatypes.S (Datatypes.S O))))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@center gT (@gval gT E)) (@center gT (@gval gT S)))) s)) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT E) (central_product gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) s (fun j : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) j (central_product gT) true (@gval gT j))) (@center gT (@gval gT S)))) (@gval gT T)), @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 T)))) (expn p (Datatypes.S (double (half (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)) (@gval gT T))))))))) *)
move/IHs=> {IHs}IHs; case/cprodP=> [[_ U _ defU]]; rewrite defU => defT cEU.
(* 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)) (@gval gT T)))) (expn p (Datatypes.S (double (half (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)) (@gval gT T))))))))) *)
rewrite -(mulnK #|T| (cardG_gt0 (E :&: U))) -defT -mul_cardG /=.
(* Goal: @eq nat (divn (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 E)))) (@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 U))))) (@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 E) (@gval gT U)))))) (expn p (Datatypes.S (double (half (logn p (divn (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 E)))) (@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 U))))) (@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 E) (@gval gT U))))))))))) *)
have ->: E :&: U = 'Z(S).
(* Goal: @eq nat (divn (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 E)))) (@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 U))))) (@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 S)))))) (expn p (Datatypes.S (double (half (logn p (divn (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 E)))) (@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 U))))) (@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 S))))))))))) *)
(* 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 E) (@gval gT U)) (@center gT (@gval gT S)) *)
apply/eqP; rewrite eqEsubset subsetI -{1 2}defZE subsetIl setIS //=.
(* Goal: @eq nat (divn (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 E)))) (@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 U))))) (@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 S)))))) (expn p (Datatypes.S (double (half (logn p (divn (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 E)))) (@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 U))))) (@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 S))))))))))) *)
(* 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)) (@center gT (@gval gT S)))) (@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 U)))) *)
by case/cprodP: defU => [[V _ -> _]] <- _; apply: mulG_subr.
(* Goal: @eq nat (divn (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 E)))) (@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 U))))) (@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 S)))))) (expn p (Datatypes.S (double (half (logn p (divn (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 E)))) (@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 U))))) (@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 S))))))))))) *)
rewrite (IHs U) // oEp3 oZ -expnD addSn expnS mulKn ?prime_gt0 //.
(* Goal: @eq nat (expn p (addn (Datatypes.S (Datatypes.S O)) (Datatypes.S (double (half (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)))))))))) (expn p (Datatypes.S (double (half (logn p (expn p (addn (Datatypes.S (Datatypes.S O)) (Datatypes.S (double (half (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))))))))))))))) *)
by rewrite pfactorK //= uphalf_double.
Qed.
Lemma Aut_extraspecial_full : Aut_in (Aut S) 'Z(S) \isog Aut 'Z(S).
Lemma center_aut_extraspecial k : coprime k p ->
exists2 f, f \in Aut S & forall z, z \in 'Z(S) -> f z = (z ^+ k)%g.
Proof.
(* Goal: forall _ : is_true (coprime k p), @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
have /cyclicP[z defZ]: cyclic 'Z(S) by rewrite prime_cyclic ?oZ.
(* Goal: forall _ : is_true (coprime k p), @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
have oz: #[z] = p by rewrite orderE -defZ.
(* Goal: forall _ : is_true (coprime k p), @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
rewrite coprime_sym -unitZpE ?prime_gt1 // -oz => u_k.
(* Goal: @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
pose g := Zp_unitm (FinRing.unit 'Z_#[z] u_k).
(* Goal: @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
have AutZg: g \in Aut 'Z(S) by rewrite defZ -im_Zp_unitm mem_morphim ?inE.
(* Goal: @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
have ZSfull := Aut_sub_fullP (center_sub S) Aut_extraspecial_full.
(* Goal: @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
have [f [injf fS fZ]] := ZSfull _ (injm_autm AutZg) (im_autm AutZg).
(* Goal: @ex2 (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => is_true (@in_mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) f (@mem (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Aut gT (@gval gT S)))))) (fun f : Finite.sort (perm_for_finType (FinGroup.arg_finType (FinGroup.base gT))) => forall (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)) (@center gT (@gval gT S)))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) f z) (@expgn (FinGroup.base gT) z k)) *)
exists (aut injf fS) => [|u Zu]; first exact: Aut_aut.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@aut gT S f injf fS) u) (@expgn (FinGroup.base gT) u k) *)
have [Su _] := setIP Zu; have z_u: u \in <[z]> by rewrite -defZ.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base gT)) (@aut gT S f injf fS) u) (@expgn (FinGroup.base gT) u k) *)
by rewrite autE // fZ //= autmE permE /= z_u /cyclem expg_znat.
Qed.
End StructureCorollaries.
End Extraspecial.
Section SCN.
Variables (gT : finGroupType) (p : nat) (G : {group gT}).
Implicit Types A Z H : {group gT}.
Lemma SCN_P A : reflect (A <| G /\ 'C_G(A) = A) (A \in 'SCN(G)).
Proof.
(* Goal: Bool.reflect (and (is_true (@normal gT (@gval gT A) (@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 G) (@centraliser gT (@gval gT A))) (@gval gT A))) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A (@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))))) *)
by apply: (iffP setIdP) => [] [->]; move/eqP.
Qed.
Lemma SCN_abelian A : A \in 'SCN(G) -> abelian A.
Proof.
(* Goal: forall _ : is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A (@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 (@abelian gT (@gval gT A)) *)
by case/SCN_P=> _ defA; rewrite /abelian -{1}defA subsetIr.
Qed.
Lemma exponent_Ohm1_class2 H :
odd p -> p.-group H -> nil_class H <= 2 -> exponent 'Ohm_1(H) %| p.
Proof.
(* Goal: forall (_ : is_true (odd p)) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT H))) (_ : is_true (leq (@nil_class gT (@gval gT H)) (S (S O)))), is_true (dvdn (@exponent gT (@Ohm (S O) gT (@gval gT H))) p) *)
move=> odd_p pH; rewrite nil_class2 => sH'Z; apply/exponentP=> x /=.
(* Goal: forall _ : 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)) (@Ohm (S O) gT (@gval gT H))))), @eq (FinGroup.sort (FinGroup.base gT)) (@expgn (FinGroup.base gT) x p) (oneg (FinGroup.base gT)) *)
rewrite (OhmE 1 pH) expn1 gen_set_id => {x} [/LdivP[] //|].
(* Goal: is_true (@group_set gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (Ldiv gT p))) *)
apply/group_setP; split=> [|x y]; first by rewrite !inE group1 expg1n //=.
(* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (Ldiv gT p)))))) (_ : 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (Ldiv gT p)))))), 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (Ldiv gT p))))) *)
case/LdivP=> Hx xp1 /LdivP[Hy yp1]; rewrite !inE groupM //=.
(* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) p) (oneg (FinGroup.base gT))) *)
have [_ czH]: [~ y, x] \in H /\ centralises [~ y, x] H.
(* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) p) (oneg (FinGroup.base gT))) *)
(* Goal: and (is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@commg 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 H))))) (@centralises gT (@commg gT y x) (@gval gT H)) *)
by apply/centerP; rewrite (subsetP sH'Z) ?mem_commg.
(* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) p) (oneg (FinGroup.base gT))) *)
rewrite expMg_Rmul ?xp1 ?yp1 /commute ?czH //= !mul1g.
(* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@commg gT y x) (binomial p (S (S O)))) (oneg (FinGroup.base gT))) *)
by rewrite bin2odd // -commXXg ?yp1 /commute ?czH // comm1g.
Qed.
Lemma SCN_max A : A \in 'SCN(G) -> [max A | A <| G & abelian A].
Lemma max_SCN A :
p.-group G -> [max A | A <| G & abelian A] -> A \in 'SCN(G).
Section SCNseries.
Variables A : {group gT}.
Hypothesis SCN_A : A \in 'SCN(G).
Let Z := 'Ohm_1(A).
Let cAA := SCN_abelian SCN_A.
Let sZA: Z \subset A := Ohm_sub 1 A.
Let nZA : A \subset 'N(Z) := sub_abelian_norm cAA sZA.
Lemma der1_stab_Ohm1_SCN_series : ('C(Z) :&: 'C_G(A / Z | 'Q))^`(1) \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)) (@derived_at (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT Z) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval 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 A)))) *)
case/SCN_P: SCN_A => /andP[sAG nAG] {4} <-.
(* 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)) (@derived_at (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT Z) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval 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) (@centraliser gT (@gval gT A)))))) *)
rewrite subsetI {1}setICA comm_subG ?subsetIl //= gen_subG.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@commg_set gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT Z) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT Z) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval 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 (@centraliser_group gT (@gval gT A)))))) *)
apply/subsetP=> w /imset2P[u v].
(* Goal: forall (_ : is_true (@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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT Z) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) v (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT Z) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) w (@commg gT u v)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) w (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@centraliser_group gT (@gval gT A)))))) *)
rewrite -groupV -(groupV _ v) /= astabQR //= -/Z !inE groupV.
(* Goal: forall (_ : is_true (andb (@in_mem (FinGroup.arg_sort (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 (@centraliser_group gT Z))))) (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@invg (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)))) (andb (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@conjugate gT Z (@invg (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)) Z))) (@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)) (@invg (FinGroup.base gT) u)) (@gval 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)) Z))))))) (_ : is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@invg (FinGroup.base gT) v) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT Z)))) (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@invg (FinGroup.base gT) v) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) (andb (@subset (FinGroup.finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT)) (@conjugate gT Z (@invg (FinGroup.base gT) v)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Z))) (@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)) (@invg (FinGroup.base gT) v)) (@gval 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)) Z))))))) (_ : @eq (FinGroup.arg_sort (FinGroup.base gT)) w (@commg gT u v)), is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) w (@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 (@gval gT A))))) *)
case/and4P=> cZu _ _ sRuZ /and4P[cZv' _ _ sRvZ] ->{w}.
(* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@commg gT u v) (@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 (@gval gT A))))) *)
apply/centP=> a Aa; rewrite /commute -!mulgA (commgCV v) (mulgA u).
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) v) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) u (@commg gT (@invg (FinGroup.base gT) v) (@invg (FinGroup.base gT) a))) (@mulg (FinGroup.base gT) a v)))) (@mulg (FinGroup.base gT) a (@commg gT u v)) *)
rewrite (centP cZu); last by rewrite (subsetP sRvZ) ?mem_commg ?set11 ?groupV.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) u) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) v) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@commg gT (@invg (FinGroup.base gT) v) (@invg (FinGroup.base gT) a)) u) (@mulg (FinGroup.base gT) a v)))) (@mulg (FinGroup.base gT) a (@commg gT u v)) *)
rewrite 2!(mulgA v^-1) mulKVg 4!mulgA invgK (commgC u^-1) mulgA.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) a (@invg (FinGroup.base gT) u)) (@commg gT (@invg (FinGroup.base gT) u) a)) (@invg (FinGroup.base gT) v)) (@invg (FinGroup.base gT) a)) u) a) v) (@mulg (FinGroup.base gT) a (@commg gT u v)) *)
rewrite -(mulgA _ _ v^-1) -(centP cZv') ?(subsetP sRuZ) ?mem_commg ?set11//.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) a (@invg (FinGroup.base gT) u)) (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) v) (@commg gT (@invg (FinGroup.base gT) u) a))) (@invg (FinGroup.base gT) a)) u) a) v) (@mulg (FinGroup.base gT) a (@commg gT u v)) *)
by rewrite -!mulgA invgK mulKVg !mulKg.
Qed.
Lemma Ohm1_stab_Ohm1_SCN_series :
odd p -> p.-group G -> 'Ohm_1('C_G(Z)) \subset 'C_G(A / Z | 'Q).
Proof.
(* Goal: forall (_ : is_true (odd p)) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
have [-> | ntG] := eqsVneq G 1; first by rewrite !(setIidPl (sub1G _)) Ohm1.
(* Goal: forall (_ : is_true (odd p)) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
move=> p_odd pG; have{ntG} [p_pr _ _] := pgroup_pdiv pG ntG.
(* 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 (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
case/SCN_P: SCN_A => /andP[sAG nAG] _; have pA := pgroupS sAG pG.
(* 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 (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
have pCGZ : p.-group 'C_G(Z) by rewrite (pgroupS _ pG) // subsetIl.
(* 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 (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
rewrite {pCGZ}(OhmE 1 pCGZ) gen_subG; apply/subsetP=> x; rewrite 3!inE -andbA.
(* 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)))) (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 (@centraliser_group gT Z))))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p (S O))) (oneg (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 (@setI_group gT G (@astab_group gT (@qact_dom_group gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@quotient gT (@gval gT A) Z))))))) *)
rewrite -!cycle_subG => /and3P[sXG cZX xp1] /=; have cXX := cycle_abelian x.
(* 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
have nZX := cents_norm cZX; have{nAG} nAX := subset_trans sXG nAG.
(* 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
pose XA := <[x]> <*> A; pose C := 'C(<[x]> / Z | 'Q); pose CA := A :&: C.
(* 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
pose Y := <[x]> <*> CA; pose W := 'Ohm_1(Y).
(* 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
have sXC: <[x]> \subset C by rewrite sub_astabQ nZX (quotient_cents _ cXX).
(* 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
have defY : Y = <[x]> * CA by rewrite -norm_joinEl // normsI ?nAX ?normsG.
(* 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
have{nAX} defXA: XA = <[x]> * A := norm_joinEl nAX.
(* 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
suffices{sXC}: XA \subset Y.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))), 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)) (@cycle 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@quotient_action gT (@setT_group gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A)))))))) *)
rewrite subsetI sXG /= sub_astabQ nZX centsC defY group_modl //= -/Z -/C.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) XA)) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) (@gval gT A)) C)))), is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@quotient gT (@gval gT A) Z))) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@centraliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))) *)
by rewrite subsetI sub_astabQ defXA quotientMl //= !mulG_subG; case/and4P.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have sZCA: Z \subset CA by rewrite subsetI sZA [C]astabQ sub_cosetpre.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have cZCA: CA \subset 'C(Z) by rewrite subIset 1?(sub_abelian_cent2 cAA).
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have sZY: Z \subset Y by rewrite (subset_trans sZCA) ?joing_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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have{cZCA cZX} cZY: Y \subset 'C(Z) by rewrite join_subG cZX.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have{cXX nZX} sY'Z : Y^`(1) \subset Z.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* 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)) (@derived_at (S O) 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)) Z))) *)
rewrite der1_min ?cents_norm //= -/Y defY quotientMl // abelianM /= -/Z -/CA.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: is_true (andb (@abelian (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)) (andb (@abelian (@coset_groupType gT Z) (@quotient gT CA Z)) (@subset (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@quotient gT CA Z))) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@centraliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))))) *)
rewrite !quotient_abelian // ?(abelianS _ cAA) ?subsetIl //=.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@quotient gT CA Z))) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@centraliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))) *)
by rewrite /= quotientGI ?Ohm_sub // quotient_astabQ subsetIr.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have{sY'Z cZY} nil_classY: nil_class Y <= 2.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: is_true (leq (@nil_class gT Y) (S (S O))) *)
by rewrite nil_class2 (subset_trans sY'Z ) // subsetI sZY centsC.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have pY: p.-group Y by rewrite (pgroupS _ pG) // join_subG sXG subIset ?sAG.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have sXW: <[x]> \subset W.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@cycle gT x))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) W))) *)
by rewrite [W](OhmE 1 pY) ?genS // sub1set !inE -cycle_subG joing_subl.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have{nil_classY pY sXW sZY sZCA} defW: W = <[x]> * Z.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) W (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) Z) *)
rewrite -[W](setIidPr (Ohm_sub _ _)) /= -/Y {1}defY -group_modl //= -/Y -/W.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* 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)) (@cycle gT x) (@setI (FinGroup.arg_finType (FinGroup.base gT)) CA W)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) Z) *)
congr (_ * _); apply/eqP; rewrite eqEsubset {1}[Z](OhmE 1 pA).
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) CA W))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A) (Ldiv gT (expn p (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)) 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)) CA W))))) *)
rewrite subsetI setIAC subIset //; first by rewrite sZCA -[Z]Ohm_id OhmS.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: is_true (orb (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 A) W))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A) (Ldiv gT (expn p (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)) 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)) (@generated gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A) (Ldiv gT (expn p (S O))))))))) *)
rewrite sub_gen ?setIS //; apply/subsetP=> w Ww; rewrite inE.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
(* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) w (expn p (S O))) (oneg (FinGroup.base gT))) *)
by apply/eqP; apply: exponentP w Ww; apply: exponent_Ohm1_class2.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have{sXG sAG} sXAG: XA \subset G by rewrite join_subG sXG.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have{sXAG} nilXA: nilpotent XA := nilpotentS sXAG (pgroup_nil pG).
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
have sYXA: Y \subset XA by rewrite defY defXA mulgS ?subsetIl.
(* 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)) XA)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) Y))) *)
rewrite -[Y](nilpotent_sub_norm nilXA) {nilXA sYXA}//= -/Y -/XA.
(* 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)) XA (@normaliser 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)) Y))) *)
suffices: 'N_XA('Ohm_1(Y)) \subset Y by apply/subset_trans/setIS/gFnorms.
(* 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)) XA (@normaliser gT (@Ohm (S O) 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)) Y))) *)
rewrite {XA}defXA -group_modl ?normsG /= -/W ?{W}defW ?mulG_subl //.
(* 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)) (@cycle gT x) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A) (@normaliser gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) 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)) Y))) *)
rewrite {Y}defY mulgS // subsetI subsetIl {CA C}sub_astabQ subIset ?nZA //= -/Z.
(* Goal: is_true (@subset (@coset_finType gT Z) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (@coset_finType gT Z) (@quotient gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A) (@normaliser gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@cycle gT x) Z))) Z))) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@centraliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))) *)
rewrite (subset_trans (quotient_subnorm _ _ _)) //= quotientMidr /= -/Z.
(* Goal: is_true (@subset (@coset_finType gT Z) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (@coset_finType gT Z) (@setI (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@normaliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))) (@mem (@coset_of gT Z) (predPredType (@coset_of gT Z)) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT Z)) (@centraliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))) *)
rewrite -quotient_sub1 ?subIset ?cent_norm ?orbT //.
(* Goal: is_true (@subset (@coset_finType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))) (@mem (Finite.sort (@coset_finType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))) (predPredType (Finite.sort (@coset_finType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))) (@SetDef.pred_of_set (@coset_finType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))) (@quotient (@coset_groupType gT Z) (@setI (@coset_finType gT Z) (@quotient gT (@gval gT A) Z) (@normaliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))) (@mem (Finite.sort (FinGroup.finType (@coset_baseGroupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))) (predPredType (Finite.sort (FinGroup.finType (@coset_baseGroupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))))))) *)
rewrite (subset_trans (quotientI _ _ _)) ?coprime_TIg //.
(* Goal: is_true (coprime (@card (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))) (@gval (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))) (@quotient_group (@coset_groupType gT Z) (@quotient_group gT A Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))))) (@card (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))))) (@gval (@coset_groupType (@coset_groupType gT Z) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))) (@quotient_group (@coset_groupType gT Z) (@normaliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)) (@gval (@coset_groupType gT Z) (@centraliser_group (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))))))))) *)
rewrite (@pnat_coprime p) // -/(p.-group _) ?quotient_pgroup {pA}//= -pgroupE.
(* Goal: is_true (@pgroup (@coset_groupType (@coset_groupType gT Z) (@centraliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z))) (negn (nat_pred_of_nat p)) (@quotient (@coset_groupType gT Z) (@normaliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)) (@centraliser (@coset_groupType gT Z) (@quotient gT (@cycle gT x) Z)))) *)
rewrite -(setIidPr (cent_sub _)) p'group_quotient_cent_prime //.
(* Goal: is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT Z))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT Z)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT Z))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT Z))) (@gval (@coset_groupType gT Z) (@quotient_group gT (@cycle_group gT x) Z))))) p) *)
by rewrite (dvdn_trans (dvdn_quotient _ _)) ?order_dvdn.
Qed.
End SCNseries.
Lemma Ohm1_cent_max_normal_abelem Z :
odd p -> p.-group G -> [max Z | Z <| G & p.-abelem Z] -> 'Ohm_1('C_G(Z)) = Z.
Proof.
(* Goal: forall (_ : is_true (odd p)) (_ : is_true (@pgroup gT (nat_pred_of_nat p) (@gval gT G))) (_ : is_true (@maxgroup gT (@gval gT Z) (fun Z : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@normal gT (@gval gT Z) (@gval gT G)) (@abelem gT p (@gval gT Z))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT Z)))) (@gval gT Z) *)
move=> p_odd pG; set X := 'Ohm_1('C_G(Z)).
(* Goal: forall _ : is_true (@maxgroup gT (@gval gT Z) (fun Z : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => andb (@normal gT (@gval gT Z) (@gval gT G)) (@abelem gT p (@gval gT Z)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
case/maxgroupP=> /andP[nsZG abelZ] maxZ.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
have [sZG nZG] := andP nsZG; have [_ cZZ expZp] := and3P abelZ.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
have{nZG} nsXG: X <| G by rewrite gFnormal_trans ?norm_normalI ?norms_cent.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
have cZX : X \subset 'C(Z) by apply/gFsub_trans/subsetIr.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
have{sZG expZp} sZX: Z \subset X.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
(* 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 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)) X))) *)
rewrite [X](OhmE 1 (pgroupS _ pG)) ?subsetIl ?sub_gen //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
(* 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 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 (@setI_group gT G (@centraliser_group gT (@gval gT Z)))) (Ldiv gT (expn p (S O))))))) *)
apply/subsetP=> x Zx; rewrite !inE ?(subsetP sZG) ?(subsetP cZZ) //=.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
(* Goal: is_true (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) x (expn p (S O))) (oneg (FinGroup.base gT))) *)
by rewrite (exponentP expZp).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
suffices{sZX} expXp: (exponent X %| p).
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) X (@gval gT Z) *)
apply/eqP; rewrite eqEsubset sZX andbT -quotient_sub1 ?cents_norm //= -/X.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: is_true (@subset (@coset_finType gT (@gval gT Z)) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT Z)) (@quotient gT X (@gval gT Z)))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@gval gT Z))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT Z))))))) *)
have pGq: p.-group (G / Z) by rewrite quotient_pgroup.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: is_true (@subset (@coset_finType gT (@gval gT Z)) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (@coset_finType gT (@gval gT Z)) (@quotient gT X (@gval gT Z)))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@gval gT Z))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT Z))))))) *)
rewrite (TI_center_nil (pgroup_nil pGq)) ?quotient_normal //= -/X setIC.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (Phant (@coset_of gT (@gval gT Z)))) (@setI (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@center (@coset_groupType gT (@gval gT Z)) (@quotient gT (@gval gT G) (@gval gT Z))) (@quotient gT X (@gval gT Z))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT Z)))) *)
apply/eqP/trivgPn=> [[Zd]]; rewrite inE -!cycle_subG -cycle_eq1 -subG1 /= -/X.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: forall (_ : is_true (andb (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@cycle (@coset_groupType gT (@gval gT Z)) Zd))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@center (@coset_groupType gT (@gval gT Z)) (@quotient gT (@gval gT G) (@gval gT Z)))))) (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@cycle (@coset_groupType gT (@gval gT Z)) Zd))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT X (@gval gT Z))))))) (_ : is_true (negb (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@cycle (@coset_groupType gT (@gval gT Z)) Zd))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@gval gT Z))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT Z))))))))), False *)
case/andP=> /sub_center_normal nsZdG.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@cycle (@coset_groupType gT (@gval gT Z)) Zd))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT X (@gval gT Z)))))) (_ : is_true (negb (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@cycle (@coset_groupType gT (@gval gT Z)) Zd))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@gval gT Z))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT Z))))))))), False *)
have{nsZdG} [D defD sZD nsDG] := inv_quotientN nsZG nsZdG; rewrite defD.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT (@gval gT D) (@gval gT Z)))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT X (@gval gT Z)))))) (_ : is_true (negb (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT (@gval gT D) (@gval gT Z)))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@gval gT Z))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT Z))))))))), False *)
have sDG := normal_sub nsDG; have nsZD := normalS sZD sDG nsZG.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT (@gval gT D) (@gval gT Z)))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT X (@gval gT Z)))))) (_ : is_true (negb (@subset (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.arg_finType (@coset_baseGroupType gT (@gval gT Z))) (@quotient gT (@gval gT D) (@gval gT Z)))) (@mem (@coset_of gT (@gval gT Z)) (predPredType (@coset_of gT (@gval gT Z))) (@SetDef.pred_of_set (FinGroup.finType (@coset_baseGroupType gT (@gval gT Z))) (oneg (group_set_of_baseGroupType (@coset_baseGroupType gT (@gval gT Z))))))))), False *)
rewrite quotientSGK ?quotient_sub1 ?normal_norm //= -/X => sDX /negP[].
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* 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 D))) (@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 Z)))) *)
rewrite (maxZ D) // nsDG andbA (pgroupS sDG) ?(dvdn_trans (exponentS sDX)) //.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: is_true (andb (andb true true) (andb (@abelian gT (@gval gT D)) true)) *)
have sZZD: Z \subset 'Z(D) by rewrite subsetI sZD centsC (subset_trans sDX).
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: is_true (andb (andb true true) (andb (@abelian gT (@gval gT D)) true)) *)
by rewrite (cyclic_factor_abelian sZZD) //= -defD cycle_cyclic.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
pose normal_abelian := [pred A : {group gT} | A <| G & abelian A].
(* Goal: is_true (dvdn (@exponent gT X) p) *)
have{nsZG cZZ} normal_abelian_Z : normal_abelian Z by apply/andP.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
have{normal_abelian_Z} [A maxA sZA] := maxgroup_exists normal_abelian_Z.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
have SCN_A : A \in 'SCN(G) by apply: max_SCN pG maxA.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
move/maxgroupp: maxA => /andP[nsAG cAA] {normal_abelian}.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
have pA := pgroupS (normal_sub nsAG) pG.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
have{abelZ maxZ nsAG cAA sZA} defA1: 'Ohm_1(A) = Z.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT A)) (@gval gT Z) *)
have: Z \subset 'Ohm_1(A) by rewrite -(Ohm1_id abelZ) OhmS.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* 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 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)) (@Ohm (S O) gT (@gval gT A))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@Ohm (S O) gT (@gval gT A)) (@gval gT Z) *)
by apply: maxZ; rewrite Ohm1_abelem ?gFnormal_trans.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
have{SCN_A} sX'A: X^`(1) \subset A.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* 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)) (@derived_at (S O) gT X))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) *)
have sX_CWA1 : X \subset 'C('Ohm_1(A)) :&: 'C_G(A / 'Ohm_1(A) | 'Q).
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* 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)) (@derived_at (S O) gT X))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) *)
(* 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)) X)) (@mem (Finite.sort (FinGroup.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)) (@centraliser gT (@Ohm (S O) gT (@gval gT A))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@astab gT (@qact_dom gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))) (@coset_finType gT (@Ohm (S O) gT (@gval gT A))) (@quotient gT (@gval gT A) (@Ohm (S O) gT (@gval gT A))) (@quotient_action gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) gT (conjg_action gT) (@Ohm_group (S O) gT (@gval gT A))))))))) *)
rewrite subsetI /X -defA1 (Ohm1_stab_Ohm1_SCN_series _ p_odd) //=.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* 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)) (@derived_at (S O) gT X))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) *)
(* 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)) (@Ohm (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@Ohm (S O) gT (@gval 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)) (@centraliser gT (@Ohm (S O) gT (@gval gT A)))))) true) *)
by rewrite gFsub_trans ?subsetIr.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
(* 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)) (@derived_at (S O) gT X))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) *)
by apply: subset_trans (der1_stab_Ohm1_SCN_series SCN_A); rewrite commgSS.
(* Goal: is_true (dvdn (@exponent gT X) p) *)
pose genXp := [pred U : {group gT} | 'Ohm_1(U) == U & ~~ (exponent U %| p)].
(* Goal: is_true (dvdn (@exponent gT X) p) *)
apply/idPn=> expXp'; have genXp_X: genXp [group of X] by rewrite /= Ohm_id eqxx.
(* Goal: False *)
have{genXp_X expXp'} [U] := mingroup_exists genXp_X; case/mingroupP; case/andP.
(* Goal: forall (_ : is_true (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@Ohm (S O) gT (@gval gT U)) (@gval gT U))) (_ : is_true (negb (dvdn (@exponent gT (@gval gT U)) p))) (_ : forall (H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (_ : is_true (@pred_of_simpl (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) genXp 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 U))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@gval gT H) (@gval 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)) (@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 (@clone_group gT (@Ohm_group (S O) gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT (@gval gT Z)))) (@group gT X))))))), False *)
move/eqP=> defU1 expUp' minU sUX; case/negP: expUp'.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
have{nsXG} pU := pgroupS (subset_trans sUX (normal_sub nsXG)) pG.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
case gsetU1: (group_set 'Ldiv_p(U)).
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
by rewrite -defU1 (OhmE 1 pU) gen_set_id // -sub_LdivT subsetIr.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
move: gsetU1; rewrite /group_set 2!inE group1 expg1n eqxx; case/subsetPn=> xy.
(* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) xy (@mem (Finite.sort (FinGroup.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 U) (Ldiv gT p)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT U) (Ldiv gT p))))))) (_ : is_true (negb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) xy (@mem (Finite.sort (FinGroup.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 p))))))), is_true (dvdn (@exponent gT (@gval gT U)) p) *)
case/imset2P=> x y; rewrite !inE => /andP[Ux xp1] /andP[Uy yp1] ->{xy}.
(* Goal: forall _ : is_true (negb (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 U)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (@expgn (FinGroup.base gT) (@mulg (FinGroup.base gT) x y) p) (oneg (FinGroup.base gT))))), is_true (dvdn (@exponent gT (@gval gT U)) p) *)
rewrite groupM //= => nt_xyp; pose XY := <[x]> <*> <[y]>.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
have{yp1 nt_xyp} defXY: XY = U.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) XY (@gval gT U) *)
have sXY_U: XY \subset U by rewrite join_subG !cycle_subG Ux Uy.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) XY (@gval gT U) *)
rewrite [XY]minU //= eqEsubset Ohm_sub (OhmE 1 (pgroupS _ pU)) //.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* 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)) (@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)) (@generated gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@joing_group gT (@cycle gT x) (@cycle gT y))) (Ldiv gT (expn p (S O))))))))) (negb (dvdn (@exponent gT (@joing gT (@cycle gT x) (@cycle gT y))) p))) *)
rewrite /= joing_idl joing_idr genS; last first.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (andb true (negb (dvdn (@exponent gT (@joing gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) p))) *)
(* 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)) (@setU (FinGroup.arg_finType (FinGroup.base gT)) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@set1 (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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)) (Ldiv gT (expn p (S O))))))) *)
by rewrite subsetI subset_gen subUset !sub1set !inE xp1 yp1.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (andb true (negb (dvdn (@exponent gT (@joing gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))) p))) *)
apply: contra nt_xyp => /exponentP-> //.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (@in_mem (FinGroup.arg_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)) (@joing gT (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y))))) *)
by rewrite groupMl mem_gen // (set21, set22).
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
have: <[x]> <|<| U by rewrite nilpotent_subnormal ?(pgroup_nil pU) ?cycle_subG.
(* Goal: forall _ : is_true (@subnormal gT (@cycle gT x) (@gval gT U)), is_true (dvdn (@exponent gT (@gval gT U)) p) *)
case/subnormalEsupport=> [defU | /=].
(* Goal: forall _ : is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@class_support gT (@cycle gT x) (@gval 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 U)))), is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
by apply: dvdn_trans (exponent_dvdn U) _; rewrite -defU order_dvdn.
(* Goal: forall _ : is_true (@proper (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@generated gT (@class_support gT (@cycle gT x) (@gval 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 U)))), is_true (dvdn (@exponent gT (@gval gT U)) p) *)
set V := <<class_support <[x]> U>>; case/andP=> sVU ltVU.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
have{genXp minU xp1 sVU ltVU} expVp: exponent V %| p.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (dvdn (@exponent gT V) p) *)
apply: contraR ltVU => expVp'; rewrite [V]minU //= expVp' eqEsubset Ohm_sub.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* 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)) (@generated gT (@class_support gT (@cycle gT x) (@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)) (@Ohm (S O) gT (@generated gT (@class_support gT (@cycle gT x) (@gval gT U)))))))) true) *)
rewrite (OhmE 1 (pgroupS sVU pU)) genS //= subsetI subset_gen class_supportEr.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* 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)) (@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 x0 : 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))) x0 (@setU (FinGroup.finType (FinGroup.base gT))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x0 (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT U)))) (@conjugate gT (@cycle gT x) x0))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (Ldiv gT (expn p (S O))))))) *)
apply/bigcupsP=> z _; apply/subsetP=> v Vv.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) v (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (Ldiv gT (expn p (S O)))))) *)
by rewrite inE -order_dvdn (dvdn_trans (order_dvdG Vv)) // cardJg order_dvdn.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
have{A pA defA1 sX'A V expVp} Zxy: [~ x, y] \in Z.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: 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 Z)))) *)
rewrite -defA1 (OhmE 1 pA) mem_gen // !inE (exponentP expVp).
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (@in_mem (FinGroup.arg_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)) V))) *)
(* Goal: is_true (andb (@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 A)))) (@eq_op (FinGroup.eqType (FinGroup.base gT)) (oneg (FinGroup.base gT)) (oneg (FinGroup.base gT)))) *)
by rewrite (subsetP sX'A) //= mem_commg ?(subsetP sUX).
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: is_true (@in_mem (FinGroup.arg_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)) V))) *)
by rewrite groupMl -1?[x^-1]conjg1 mem_gen // mem_imset2 // ?groupV cycle_id.
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
have{Zxy sUX cZX} cXYxy: [~ x, y] \in 'C(XY).
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
(* Goal: 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)) (@centraliser gT XY)))) *)
by rewrite centsC in cZX; rewrite defXY (subsetP (centS sUX)) ?(subsetP cZX).
(* Goal: is_true (dvdn (@exponent gT (@gval gT U)) p) *)
rewrite -defU1 exponent_Ohm1_class2 // nil_class2 -defXY der1_joing_cycles //.
(* 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 (@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)) (@center gT XY)))) *)
by rewrite subsetI {1}defXY !cycle_subG groupR.
Qed.
Lemma critical_class2 H : critical H G -> nil_class H <= 2.
Proof.
(* Goal: forall _ : @critical gT (@gval gT H) (@gval gT G), is_true (leq (@nil_class gT (@gval gT H)) (S (S O))) *)
case=> [chH _ sRZ _].
(* Goal: is_true (leq (@nil_class gT (@gval gT H)) (S (S O))) *)
by rewrite nil_class2 (subset_trans _ sRZ) ?commSg // char_sub.
Qed.
Lemma Thompson_critical : p.-group G -> {K : {group gT} | critical K G}.
Lemma critical_p_stab_Aut H :
critical H G -> p.-group G -> p.-group 'C(H | [Aut G]).
End SCN.
Arguments SCN_P {gT G A}. |
Require Export GeoCoq.Elements.OriginalProofs.lemma_samesidesymmetric.
Require Export GeoCoq.Elements.OriginalProofs.lemma_planeseparation.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_samenotopposite :
forall A B C D,
OS A B C D ->
~ TS A C D B.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @OS Ax0 A B C D), not (@TS Ax0 A C D B) *)
intros.
(* Goal: not (@TS Ax0 A C D B) *)
assert (OS B A C D) by (forward_using lemma_samesidesymmetric).
(* Goal: not (@TS Ax0 A C D B) *)
assert (~ TS A C D B).
(* Goal: not (@TS Ax0 A C D B) *)
(* Goal: not (@TS Ax0 A C D B) *)
{
(* Goal: not (@TS Ax0 A C D B) *)
intro.
(* Goal: False *)
assert (TS B C D B) by (conclude lemma_planeseparation).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists M, BetS B M B) by (conclude_def TS );destruct Tf as [M];spliter.
(* Goal: False *)
assert (~ BetS B M B) by (conclude axiom_betweennessidentity).
(* Goal: False *)
contradict.
(* BG Goal: not (@TS Ax0 A C D B) *)
}
(* Goal: not (@TS Ax0 A C D B) *)
close.
Qed.
End Euclid.
|
Require Export Lib_Mult.
Fixpoint exp_2 (n : nat) : nat :=
match n return nat with
| O =>
1
| S p => 2 * exp_2 p
end.
Fixpoint exp_n (n m : nat) {struct m} : nat :=
match m return nat with
| O =>
1
| S p => n * exp_n n p
end.
Lemma eq_exp_2_exp_n : forall n : nat, exp_2 n = exp_n 2 n.
Proof.
(* Goal: forall n : nat, @eq nat (exp_2 n) (exp_n (S (S O)) n) *)
simple induction n; auto with arith.
(* Goal: forall (n : nat) (_ : @eq nat (exp_2 n) (exp_n (S (S O)) n)), @eq nat (exp_2 (S n)) (exp_n (S (S O)) (S n)) *)
intros.
(* Goal: @eq nat (exp_2 (S n0)) (exp_n (S (S O)) (S n0)) *)
change (exp_2 (S n0) = 2 * exp_n 2 n0) in |- *.
(* Goal: @eq nat (exp_2 (S n0)) (Init.Nat.mul (S (S O)) (exp_n (S (S O)) n0)) *)
elim H; auto with arith.
Qed.
Hint Resolve eq_exp_2_exp_n.
Lemma exp_2_n_plus_n : forall n : nat, exp_2 n + exp_2 n = exp_2 (S n).
Proof.
(* Goal: forall n : nat, @eq nat (Init.Nat.add (exp_2 n) (exp_2 n)) (exp_2 (S n)) *)
intro.
(* Goal: @eq nat (Init.Nat.add (exp_2 n) (exp_2 n)) (exp_2 (S n)) *)
rewrite plus_mult.
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (exp_2 n)) (exp_2 (S n)) *)
change (2 * exp_2 n = 2 * exp_2 n) in |- *.
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (exp_2 n)) (Init.Nat.mul (S (S O)) (exp_2 n)) *)
reflexivity.
Qed.
Hint Resolve exp_2_n_plus_n.
Lemma exp_2_plus_pn_pn :
forall n : nat, 0 < n -> exp_2 (pred n) + exp_2 (pred n) = exp_2 n.
Proof.
(* Goal: forall (n : nat) (_ : lt O n), @eq nat (Init.Nat.add (exp_2 (Init.Nat.pred n)) (exp_2 (Init.Nat.pred n))) (exp_2 n) *)
intros.
(* Goal: @eq nat (Init.Nat.add (exp_2 (Init.Nat.pred n)) (exp_2 (Init.Nat.pred n))) (exp_2 n) *)
rewrite exp_2_n_plus_n.
(* Goal: @eq nat (exp_2 (S (Init.Nat.pred n))) (exp_2 n) *)
rewrite S_pred_n; auto with arith.
Qed.
Hint Resolve exp_2_plus_pn_pn.
Lemma exp_2_le_pn_n : forall n : nat, exp_2 (pred n) <= exp_2 n.
Proof.
(* Goal: forall n : nat, le (exp_2 (Init.Nat.pred n)) (exp_2 n) *)
simple induction n; auto with arith.
(* Goal: forall (n : nat) (_ : le (exp_2 (Init.Nat.pred n)) (exp_2 n)), le (exp_2 (Init.Nat.pred (S n))) (exp_2 (S n)) *)
intros.
(* Goal: le (exp_2 (Init.Nat.pred (S n0))) (exp_2 (S n0)) *)
simpl in |- *.
(* Goal: le (exp_2 n0) (Init.Nat.add (exp_2 n0) (Init.Nat.add (exp_2 n0) O)) *)
elim plus_n_O; auto with arith.
Qed.
Hint Resolve exp_2_le_pn_n.
Lemma exp_2_pos : forall n : nat, 0 < exp_2 n.
Proof.
(* Goal: forall n : nat, lt O (exp_2 n) *)
simple induction n; auto with arith.
(* Goal: forall (n : nat) (_ : lt O (exp_2 n)), lt O (exp_2 (S n)) *)
intros.
(* Goal: lt O (exp_2 (S n0)) *)
simpl in |- *.
(* Goal: lt O (Init.Nat.add (exp_2 n0) (Init.Nat.add (exp_2 n0) O)) *)
elim plus_n_O; auto with arith.
Qed.
Hint Resolve exp_2_pos.
Lemma exp_2_incr : forall n m : nat, n <= m -> exp_2 n <= exp_2 m.
Proof.
(* Goal: forall (n m : nat) (_ : le n m), le (exp_2 n) (exp_2 m) *)
intros.
(* Goal: le (exp_2 n) (exp_2 m) *)
elim H; auto with arith.
(* Goal: forall (m : nat) (_ : le n m) (_ : le (exp_2 n) (exp_2 m)), le (exp_2 n) (exp_2 (S m)) *)
intros.
(* Goal: le (exp_2 n) (exp_2 (S m0)) *)
simpl in |- *.
(* Goal: le (exp_2 n) (Init.Nat.add (exp_2 m0) (Init.Nat.add (exp_2 m0) O)) *)
elim plus_n_O.
(* Goal: le (exp_2 n) (Init.Nat.add (exp_2 m0) (exp_2 m0)) *)
elim H1; auto with arith.
Qed.
Hint Resolve exp_2_incr.
Lemma exp_2_n_plus_m : forall n m : nat, exp_2 (n + m) = exp_2 n * exp_2 m.
Proof.
(* Goal: forall n m : nat, @eq nat (exp_2 (Init.Nat.add n m)) (Init.Nat.mul (exp_2 n) (exp_2 m)) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq nat (exp_2 (Init.Nat.add n m)) (Init.Nat.mul (exp_2 n) (exp_2 m))) (m : nat), @eq nat (exp_2 (Init.Nat.add (S n) m)) (Init.Nat.mul (exp_2 (S n)) (exp_2 m)) *)
(* Goal: forall m : nat, @eq nat (exp_2 (Init.Nat.add O m)) (Init.Nat.mul (exp_2 O) (exp_2 m)) *)
intro.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq nat (exp_2 (Init.Nat.add n m)) (Init.Nat.mul (exp_2 n) (exp_2 m))) (m : nat), @eq nat (exp_2 (Init.Nat.add (S n) m)) (Init.Nat.mul (exp_2 (S n)) (exp_2 m)) *)
(* Goal: @eq nat (exp_2 (Init.Nat.add O m)) (Init.Nat.mul (exp_2 O) (exp_2 m)) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq nat (exp_2 (Init.Nat.add n m)) (Init.Nat.mul (exp_2 n) (exp_2 m))) (m : nat), @eq nat (exp_2 (Init.Nat.add (S n) m)) (Init.Nat.mul (exp_2 (S n)) (exp_2 m)) *)
(* Goal: @eq nat (exp_2 m) (Init.Nat.add (exp_2 m) O) *)
elim plus_n_O; reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, @eq nat (exp_2 (Init.Nat.add n m)) (Init.Nat.mul (exp_2 n) (exp_2 m))) (m : nat), @eq nat (exp_2 (Init.Nat.add (S n) m)) (Init.Nat.mul (exp_2 (S n)) (exp_2 m)) *)
intros.
(* Goal: @eq nat (exp_2 (Init.Nat.add (S n0) m)) (Init.Nat.mul (exp_2 (S n0)) (exp_2 m)) *)
simpl in |- *.
(* Goal: @eq nat (Init.Nat.add (exp_2 (Init.Nat.add n0 m)) (Init.Nat.add (exp_2 (Init.Nat.add n0 m)) O)) (Init.Nat.mul (Init.Nat.add (exp_2 n0) (Init.Nat.add (exp_2 n0) O)) (exp_2 m)) *)
elim plus_n_O.
(* Goal: @eq nat (Init.Nat.add (exp_2 (Init.Nat.add n0 m)) (exp_2 (Init.Nat.add n0 m))) (Init.Nat.mul (Init.Nat.add (exp_2 n0) (Init.Nat.add (exp_2 n0) O)) (exp_2 m)) *)
apply sym_equal.
(* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (exp_2 n0) (Init.Nat.add (exp_2 n0) O)) (exp_2 m)) (Init.Nat.add (exp_2 (Init.Nat.add n0 m)) (exp_2 (Init.Nat.add n0 m))) *)
elim plus_n_O.
(* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (exp_2 n0) (exp_2 n0)) (exp_2 m)) (Init.Nat.add (exp_2 (Init.Nat.add n0 m)) (exp_2 (Init.Nat.add n0 m))) *)
rewrite H.
(* Goal: @eq nat (Init.Nat.mul (Init.Nat.add (exp_2 n0) (exp_2 n0)) (exp_2 m)) (Init.Nat.add (Init.Nat.mul (exp_2 n0) (exp_2 m)) (Init.Nat.mul (exp_2 n0) (exp_2 m))) *)
elim mult_plus_distr_r; reflexivity.
Qed.
Hint Resolve exp_2_n_plus_m.
Lemma exp_n_incr : forall n m p : nat, n <= m -> exp_n n p <= exp_n m p.
Proof.
(* Goal: forall (n m p : nat) (_ : le n m), le (exp_n n p) (exp_n m p) *)
simple induction p; auto with arith.
(* Goal: forall (n0 : nat) (_ : forall _ : le n m, le (exp_n n n0) (exp_n m n0)) (_ : le n m), le (exp_n n (S n0)) (exp_n m (S n0)) *)
intros.
(* Goal: le (exp_n n (S n0)) (exp_n m (S n0)) *)
simpl in |- *.
(* Goal: le (Init.Nat.mul n (exp_n n n0)) (Init.Nat.mul m (exp_n m n0)) *)
apply le_mult_csts; auto with arith.
Qed.
Hint Resolve exp_n_incr.
Lemma exp_n_neutre : forall n : nat, exp_n 1 n = 1.
Proof.
(* Goal: forall n : nat, @eq nat (exp_n (S O) n) (S O) *)
simple induction n; auto with arith.
(* Goal: forall (n : nat) (_ : @eq nat (exp_n (S O) n) (S O)), @eq nat (exp_n (S O) (S n)) (S O) *)
intros.
(* Goal: @eq nat (exp_n (S O) (S n0)) (S O) *)
simpl in |- *.
(* Goal: @eq nat (Init.Nat.add (exp_n (S O) n0) O) (S O) *)
rewrite H; auto with arith.
Qed.
Hint Resolve exp_n_neutre.
Lemma exp_n_plus_mult :
forall n m p : nat, exp_n n (m + p) = exp_n n m * exp_n n p.
Proof.
(* Goal: forall n m p : nat, @eq nat (exp_n n (Init.Nat.add m p)) (Init.Nat.mul (exp_n n m) (exp_n n p)) *)
simple induction p.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add m n0)) (Init.Nat.mul (exp_n n m) (exp_n n n0))), @eq nat (exp_n n (Init.Nat.add m (S n0))) (Init.Nat.mul (exp_n n m) (exp_n n (S n0))) *)
(* Goal: @eq nat (exp_n n (Init.Nat.add m O)) (Init.Nat.mul (exp_n n m) (exp_n n O)) *)
simpl in |- *.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add m n0)) (Init.Nat.mul (exp_n n m) (exp_n n n0))), @eq nat (exp_n n (Init.Nat.add m (S n0))) (Init.Nat.mul (exp_n n m) (exp_n n (S n0))) *)
(* Goal: @eq nat (exp_n n (Init.Nat.add m O)) (Init.Nat.mul (exp_n n m) (S O)) *)
elim plus_n_O.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add m n0)) (Init.Nat.mul (exp_n n m) (exp_n n n0))), @eq nat (exp_n n (Init.Nat.add m (S n0))) (Init.Nat.mul (exp_n n m) (exp_n n (S n0))) *)
(* Goal: @eq nat (exp_n n m) (Init.Nat.mul (exp_n n m) (S O)) *)
elim mult_n_Sm.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add m n0)) (Init.Nat.mul (exp_n n m) (exp_n n n0))), @eq nat (exp_n n (Init.Nat.add m (S n0))) (Init.Nat.mul (exp_n n m) (exp_n n (S n0))) *)
(* Goal: @eq nat (exp_n n m) (Init.Nat.add (Init.Nat.mul (exp_n n m) O) (exp_n n m)) *)
auto with arith.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add m n0)) (Init.Nat.mul (exp_n n m) (exp_n n n0))), @eq nat (exp_n n (Init.Nat.add m (S n0))) (Init.Nat.mul (exp_n n m) (exp_n n (S n0))) *)
(* Goal: @eq nat (exp_n n m) (Init.Nat.add (Init.Nat.mul (exp_n n m) O) (exp_n n m)) *)
elim mult_n_O; auto with arith.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add m n0)) (Init.Nat.mul (exp_n n m) (exp_n n n0))), @eq nat (exp_n n (Init.Nat.add m (S n0))) (Init.Nat.mul (exp_n n m) (exp_n n (S n0))) *)
clear p; intros p H_rec.
(* Goal: @eq nat (exp_n n (Init.Nat.add m (S p))) (Init.Nat.mul (exp_n n m) (exp_n n (S p))) *)
elim plus_n_Sm.
(* Goal: @eq nat (exp_n n (S (Init.Nat.add m p))) (Init.Nat.mul (exp_n n m) (exp_n n (S p))) *)
simpl in |- *.
(* Goal: @eq nat (Init.Nat.mul n (exp_n n (Init.Nat.add m p))) (Init.Nat.mul (exp_n n m) (Init.Nat.mul n (exp_n n p))) *)
rewrite H_rec.
(* Goal: @eq nat (Init.Nat.mul n (Init.Nat.mul (exp_n n m) (exp_n n p))) (Init.Nat.mul (exp_n n m) (Init.Nat.mul n (exp_n n p))) *)
elim mult_assoc_reverse.
(* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul n (exp_n n m)) (exp_n n p)) (Init.Nat.mul (exp_n n m) (Init.Nat.mul n (exp_n n p))) *)
rewrite (mult_comm n (exp_n n m)).
(* Goal: @eq nat (Init.Nat.mul (Nat.mul (exp_n n m) n) (exp_n n p)) (Init.Nat.mul (exp_n n m) (Init.Nat.mul n (exp_n n p))) *)
auto with arith.
Qed.
Hint Resolve exp_n_plus_mult.
Lemma exp_n_permut :
forall n m p : nat, exp_n n (m * p) = exp_n (exp_n n p) m.
Proof.
(* Goal: forall n m p : nat, @eq nat (exp_n n (Init.Nat.mul m p)) (exp_n (exp_n n p) m) *)
simple induction m; auto with arith.
(* Goal: forall (n0 : nat) (_ : forall p : nat, @eq nat (exp_n n (Init.Nat.mul n0 p)) (exp_n (exp_n n p) n0)) (p : nat), @eq nat (exp_n n (Init.Nat.mul (S n0) p)) (exp_n (exp_n n p) (S n0)) *)
intros.
(* Goal: @eq nat (exp_n n (Init.Nat.mul (S n0) p)) (exp_n (exp_n n p) (S n0)) *)
simpl in |- *.
(* Goal: @eq nat (exp_n n (Init.Nat.add p (Init.Nat.mul n0 p))) (Init.Nat.mul (exp_n n p) (exp_n (exp_n n p) n0)) *)
elim H.
(* Goal: @eq nat (exp_n n (Init.Nat.add p (Init.Nat.mul n0 p))) (Init.Nat.mul (exp_n n p) (exp_n n (Init.Nat.mul n0 p))) *)
elim exp_n_plus_mult; auto with arith.
Qed.
Hint Resolve exp_n_permut.
Lemma exp_n_plus_p1 : forall n p : nat, exp_n n (p + 1) = n * exp_n n p.
Proof.
(* Goal: forall n p : nat, @eq nat (exp_n n (Init.Nat.add p (S O))) (Init.Nat.mul n (exp_n n p)) *)
simple induction p; simpl in |- *.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add n0 (S O))) (Init.Nat.mul n (exp_n n n0))), @eq nat (Init.Nat.mul n (exp_n n (Init.Nat.add n0 (S O)))) (Init.Nat.mul n (Init.Nat.mul n (exp_n n n0))) *)
(* Goal: @eq nat (Init.Nat.mul n (S O)) (Init.Nat.mul n (S O)) *)
auto with arith.
(* Goal: forall (n0 : nat) (_ : @eq nat (exp_n n (Init.Nat.add n0 (S O))) (Init.Nat.mul n (exp_n n n0))), @eq nat (Init.Nat.mul n (exp_n n (Init.Nat.add n0 (S O)))) (Init.Nat.mul n (Init.Nat.mul n (exp_n n n0))) *)
intros no H; rewrite H; auto with arith.
Qed.
Hint Resolve exp_n_plus_p1.
Lemma exp_n_pos : forall n p : nat, 0 < n -> 0 < exp_n n p.
Proof.
(* Goal: forall (n p : nat) (_ : lt O n), lt O (exp_n n p) *)
simple induction p.
(* Goal: forall (n0 : nat) (_ : forall _ : lt O n, lt O (exp_n n n0)) (_ : lt O n), lt O (exp_n n (S n0)) *)
(* Goal: forall _ : lt O n, lt O (exp_n n O) *)
simpl in |- *; auto with arith.
(* Goal: forall (n0 : nat) (_ : forall _ : lt O n, lt O (exp_n n n0)) (_ : lt O n), lt O (exp_n n (S n0)) *)
intros.
(* Goal: lt O (exp_n n (S n0)) *)
simpl in |- *.
(* Goal: lt O (Init.Nat.mul n (exp_n n n0)) *)
apply lt_nm_mult; auto with arith.
Qed.
Hint Resolve exp_n_pos.
Lemma le_exp_n_mult : forall n p : nat, 0 < n -> exp_n n p <= n * exp_n n p.
Proof.
(* Goal: forall (n p : nat) (_ : lt O n), le (exp_n n p) (Init.Nat.mul n (exp_n n p)) *)
auto with arith.
Qed.
Hint Resolve le_exp_n_mult.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCorder.
Require Export GeoCoq.Elements.OriginalProofs.lemma_oppositesidesymmetric.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_crossimpliesopposite :
forall A B C D,
CR A B C D -> nCol A C D ->
TS A C D B /\ TS A D C B /\ TS B C D A /\ TS B D C A.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @CR Ax0 A B C D) (_ : @nCol Ax0 A C D), and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
intros.
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
let Tf:=fresh in assert (Tf:exists M, (BetS A M B /\ BetS C M D)) by (conclude_def CR );destruct Tf as [M];spliter.
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (Col C M D) by (conclude_def Col ).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (Col C D M) by (forward_using lemma_collinearorder).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (nCol C D A) by (forward_using lemma_NCorder).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (nCol D C A) by (forward_using lemma_NCorder).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (TS A C D B) by (conclude_def TS ).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (Col D C M) by (forward_using lemma_collinearorder).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (TS A D C B) by (conclude_def TS ).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (TS B C D A) by (conclude lemma_oppositesidesymmetric).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
assert (TS B D C A) by (conclude lemma_oppositesidesymmetric).
(* Goal: and (@TS Ax0 A C D B) (and (@TS Ax0 A D C B) (and (@TS Ax0 B C D A) (@TS Ax0 B D C A))) *)
close.
Qed.
End Euclid.
|
Require Export positive_fraction_encoding.
Require Import ZArithRing.
Definition outside_interval (a b : Z) := (Z.sgn a + Z.sgn b)%Z.
Definition inside_interval_1 (o1 o2 : Z) :=
(0 < o1)%Z /\ (0 < o2)%Z \/ (o1 < 0)%Z /\ (o2 < 0)%Z.
Definition inside_interval_2 (o1 o2 : Z) :=
(0 < o1)%Z /\ (o2 < 0)%Z \/ (o1 < 0)%Z /\ (0 < o2)%Z.
Lemma inside_interval_1_dec_inf :
forall o1 o2 : Z, {inside_interval_1 o1 o2} + {~ inside_interval_1 o1 o2}.
Proof.
(* Goal: forall o1 o2 : Z, sumbool (inside_interval_1 o1 o2) (not (inside_interval_1 o1 o2)) *)
intros.
(* Goal: sumbool (inside_interval_1 o1 o2) (not (inside_interval_1 o1 o2)) *)
abstract (case (Z_lt_dec 0 o1); intro Ho1; [ case (Z_lt_dec 0 o2); intro Ho2; [ left; left; split | right; intro H; match goal with | id1:(~ ?X1) |- ?X2 => apply id1; case H; intros (H1, H2); [ idtac | apply False_ind; apply Z.lt_irrefl with o1; apply Z.lt_trans with 0%Z ] end ] | case (Z_lt_dec o1 0); intro Ho1'; [ case (Z_lt_dec o2 0); intro Ho2; [ left; right; split | right; intro H; case H; intros (H1, H2); [ apply Ho1 | apply Ho2 ] ] | right; intro H; apply Ho1; case H; intros (H1, H2); [ idtac | apply False_ind; apply Ho1' ] ] ]; try assumption).
Qed.
Lemma inside_interval_2_dec_inf :
forall o1 o2 : Z, {inside_interval_2 o1 o2} + {~ inside_interval_2 o1 o2}.
Proof.
(* Goal: forall o1 o2 : Z, sumbool (inside_interval_2 o1 o2) (not (inside_interval_2 o1 o2)) *)
intros.
(* Goal: sumbool (inside_interval_2 o1 o2) (not (inside_interval_2 o1 o2)) *)
abstract (case (Z_lt_dec 0 o1); intro Ho1; [ case (Z_lt_dec o2 0); intro Ho2; [ left; left; split | right; intro H; match goal with | id1:(~ ?X1) |- ?X2 => apply id1; case H; intros (H1, H2); [ idtac | apply False_ind; apply Z.lt_irrefl with o1; apply Z.lt_trans with 0%Z ] end ] | case (Z_lt_dec o1 0); intro Ho1'; [ case (Z_lt_dec 0 o2); intro Ho2; [ left; right; split | right; intro H; case H; intros (H1, H2); [ apply Ho1 | apply Ho2 ] ] | right; intro H; apply Ho1; case H; intros (H1, H2); [ idtac | apply False_ind; apply Ho1' ] ] ]; try assumption).
Qed.
Inductive Qhomographic_sg_denom_nonzero : Z -> Z -> Qpositive -> Prop :=
| Qhomographic_signok0 :
forall (c d : Z) (p : Qpositive),
p = One -> (c + d)%Z <> 0%Z -> Qhomographic_sg_denom_nonzero c d p
| Qhomographic_signok1 :
forall (c d : Z) (xs : Qpositive),
Qhomographic_sg_denom_nonzero c (c + d)%Z xs ->
Qhomographic_sg_denom_nonzero c d (nR xs)
| Qhomographic_signok2 :
forall (c d : Z) (xs : Qpositive),
Qhomographic_sg_denom_nonzero (c + d)%Z d xs ->
Qhomographic_sg_denom_nonzero c d (dL xs).
Lemma Qhomographic_signok_1 :
forall c d : Z, Qhomographic_sg_denom_nonzero c d One -> (c + d)%Z <> 0%Z.
Proof.
(* Goal: forall (c d : Z) (_ : Qhomographic_sg_denom_nonzero c d One), not (@eq Z (Z.add c d) Z0) *)
intros.
(* Goal: not (@eq Z (Z.add c d) Z0) *)
inversion H.
(* Goal: not (@eq Z (Z.add c d) Z0) *)
assumption.
Qed.
Lemma Qhomographic_signok_2 :
forall (c d : Z) (xs : Qpositive),
Qhomographic_sg_denom_nonzero c d (nR xs) ->
Qhomographic_sg_denom_nonzero c (c + d) xs.
Proof.
(* Goal: forall (c d : Z) (xs : Qpositive) (_ : Qhomographic_sg_denom_nonzero c d (nR xs)), Qhomographic_sg_denom_nonzero c (Z.add c d) xs *)
intros.
(* Goal: Qhomographic_sg_denom_nonzero c (Z.add c d) xs *)
inversion H.
(* Goal: Qhomographic_sg_denom_nonzero c (Z.add c d) xs *)
(* Goal: Qhomographic_sg_denom_nonzero c (Z.add c d) xs *)
discriminate H0.
(* Goal: Qhomographic_sg_denom_nonzero c (Z.add c d) xs *)
assumption.
Qed.
Lemma Qhomographic_signok_3 :
forall (c d : Z) (xs : Qpositive),
Qhomographic_sg_denom_nonzero c d (dL xs) ->
Qhomographic_sg_denom_nonzero (c + d) d xs.
Proof.
(* Goal: forall (c d : Z) (xs : Qpositive) (_ : Qhomographic_sg_denom_nonzero c d (dL xs)), Qhomographic_sg_denom_nonzero (Z.add c d) d xs *)
intros.
(* Goal: Qhomographic_sg_denom_nonzero (Z.add c d) d xs *)
inversion H.
(* Goal: Qhomographic_sg_denom_nonzero (Z.add c d) d xs *)
(* Goal: Qhomographic_sg_denom_nonzero (Z.add c d) d xs *)
discriminate H0.
(* Goal: Qhomographic_sg_denom_nonzero (Z.add c d) d xs *)
assumption.
Qed.
Fixpoint Qhomographic_sign (a b c d : Z) (p : Qpositive) {struct p} :
forall (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
Z * (Z * (Z * (Z * Z)) * Qpositive).
Proof.
(* Goal: forall _ : Qhomographic_sg_denom_nonzero c d p, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
set (o1 := outside_interval a b) in *.
(* Goal: forall _ : Qhomographic_sg_denom_nonzero c d p, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
set (o2 := outside_interval c d) in *.
(* Goal: forall _ : Qhomographic_sg_denom_nonzero c d p, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
destruct p as [q| q| ]; intros H_Qhomographic_sg_denom_nonzero.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_zerop b).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z b Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hb.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_zerop d).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z d Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((Z.sgn a * Z.sgn c)%Z, (a, (b, (c, d)), nR q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec 0 o2).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt Z0 o2, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Z.sgn a, (a, (b, (c, d)), nR q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec o2 0).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o2 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt o2 Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o2 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((- Z.sgn a)%Z, (a, (b, (c, d)), nR q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o2 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2''.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Qhomographic_sign a (a + b)%Z c (c + d)%Z q (Qhomographic_signok_2 c d q H_Qhomographic_sg_denom_nonzero)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hb.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_zerop d).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z d Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec 0 o1).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o1), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt Z0 o1, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o1), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Z.sgn c, (a, (b, (c, d)), nR q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o1), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec o1 0).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o1 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt o1 Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o1 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((- Z.sgn c)%Z, (a, (b, (c, d)), nR q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o1 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1''.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Qhomographic_sign a (a + b)%Z c (c + d)%Z q (Qhomographic_signok_2 c d q H_Qhomographic_sg_denom_nonzero)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (inside_interval_1_dec_inf o1 o2).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_1 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : inside_interval_1 o1 o2, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro H_inside_1.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_1 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (1%Z, (a, (b, (c, d)), nR q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_1 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro H_inside_1'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (inside_interval_2_dec_inf o1 o2).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_2 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : inside_interval_2 o1 o2, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro H_inside_2.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_2 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((-1)%Z, (a, (b, (c, d)), nR q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_2 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intros H_inside_2'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Qhomographic_sign a (a + b)%Z c (c + d)%Z q (Qhomographic_signok_2 c d q H_Qhomographic_sg_denom_nonzero)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_zerop b).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z b Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hb.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_zerop d).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z d Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((Z.sgn a * Z.sgn c)%Z, (a, (b, (c, d)), dL q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec 0 o2).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt Z0 o2, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Z.sgn a, (a, (b, (c, d)), dL q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec o2 0).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o2 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt o2 Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o2 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((- Z.sgn a)%Z, (a, (b, (c, d)), dL q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o2 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho2''.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Qhomographic_sign (a + b)%Z b (c + d)%Z d q (Qhomographic_signok_3 c d q H_Qhomographic_sg_denom_nonzero)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z b Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hb.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_zerop d).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z d Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec 0 o1).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o1), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt Z0 o1, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o1), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Z.sgn c, (a, (b, (c, d)), dL q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt Z0 o1), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z_lt_dec o1 0).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o1 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : Z.lt o1 Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o1 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((- Z.sgn c)%Z, (a, (b, (c, d)), dL q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (Z.lt o1 Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Ho1''.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Qhomographic_sign (a + b)%Z b (c + d)%Z d q (Qhomographic_signok_3 c d q H_Qhomographic_sg_denom_nonzero)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (@eq Z d Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro Hd'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (inside_interval_1_dec_inf o1 o2).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_1 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : inside_interval_1 o1 o2, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro H_inside_1.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_1 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (1%Z, (a, (b, (c, d)), dL q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_1 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro H_inside_1'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (inside_interval_2_dec_inf o1 o2).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_2 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : inside_interval_2 o1 o2, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro H_inside_2.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_2 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((-1)%Z, (a, (b, (c, d)), dL q)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : not (inside_interval_2 o1 o2), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intros H_inside_2'.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (Qhomographic_sign (a + b)%Z b (c + d)%Z d q (Qhomographic_signok_3 c d q H_Qhomographic_sg_denom_nonzero)).
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
set (soorat := Z.sgn (a + b)) in *.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
set (makhraj := Z.sgn (c + d)) in *.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z.eq_dec soorat 0).
(* Goal: forall _ : not (@eq Z soorat Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z soorat Z0, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro eq_numerator0.
(* Goal: forall _ : not (@eq Z soorat Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (0%Z, (a, (b, (c, d)), One)).
(* Goal: forall _ : not (@eq Z soorat Z0), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
case (Z.eq_dec soorat makhraj).
(* Goal: forall _ : not (@eq Z soorat makhraj), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: forall _ : @eq Z soorat makhraj, prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro.
(* Goal: forall _ : not (@eq Z soorat makhraj), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact (1%Z, (a, (b, (c, d)), One)).
(* Goal: forall _ : not (@eq Z soorat makhraj), prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
intro.
(* Goal: prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) *)
exact ((-1)%Z, (a, (b, (c, d)), One)).
Qed.
Functional Scheme Qhomographic_sign_ind :=
Induction for Qhomographic_sign Sort Prop.
Scheme Qhomographic_sg_denom_nonzero_inv_dep :=
Induction for Qhomographic_sg_denom_nonzero Sort Prop.
Lemma Qhomographic_sign_equal :
forall (a b c d : Z) (p : Qpositive)
(H1 H2 : Qhomographic_sg_denom_nonzero c d p),
Qhomographic_sign a b c d p H1 = Qhomographic_sign a b c d p H2.
Proof.
(* Goal: forall (a b c d : Z) (p : Qpositive) (H1 H2 : Qhomographic_sg_denom_nonzero c d p), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H1) (Qhomographic_sign a b c d p H2) *)
intros.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H1) (Qhomographic_sign a b c d p H2) *)
generalize H2 H1 a b.
(* Goal: forall (H2 H1 : Qhomographic_sg_denom_nonzero c d p) (a b : Z), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H1) (Qhomographic_sign a b c d p H2) *)
intro.
(* Goal: forall (H1 : Qhomographic_sg_denom_nonzero c d p) (a b : Z), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H1) (Qhomographic_sign a b c d p H0) *)
abstract let T_local := (intros; simpl in |- *; rewrite H; reflexivity) in (elim H0 using Qhomographic_sg_denom_nonzero_inv_dep; intros; [ destruct p0 as [q| q| ]; [ discriminate e | discriminate e | simpl in |- *; case (Z.eq_dec (Z.sgn (a0 + b0)) 0); case (Z.eq_dec (Z.sgn (a0 + b0)) (Z.sgn (c0 + d0))); intros; reflexivity ] | T_local | T_local ]).
Qed.
Lemma Qhomographic_sign_equal_strong :
forall (a1 a2 b1 b2 c1 c2 d1 d2 : Z) (p1 p2 : Qpositive)
(H_ok_1 : Qhomographic_sg_denom_nonzero c1 d1 p1)
(H_ok_2 : Qhomographic_sg_denom_nonzero c2 d2 p2),
a1 = a2 ->
b1 = b2 ->
c1 = c2 ->
d1 = d2 ->
p1 = p2 ->
Qhomographic_sign a1 b1 c1 d1 p1 H_ok_1 =
Qhomographic_sign a2 b2 c2 d2 p2 H_ok_2.
Proof.
(* Goal: forall (a1 a2 b1 b2 c1 c2 d1 d2 : Z) (p1 p2 : Qpositive) (H_ok_1 : Qhomographic_sg_denom_nonzero c1 d1 p1) (H_ok_2 : Qhomographic_sg_denom_nonzero c2 d2 p2) (_ : @eq Z a1 a2) (_ : @eq Z b1 b2) (_ : @eq Z c1 c2) (_ : @eq Z d1 d2) (_ : @eq Qpositive p1 p2), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a1 b1 c1 d1 p1 H_ok_1) (Qhomographic_sign a2 b2 c2 d2 p2 H_ok_2) *)
abstract (intros; generalize H_ok_2; repeat match goal with | id1:(?X1 = ?X2) |- ?X3 => rewrite <- id1; clear id1 end; intro; apply Qhomographic_sign_equal).
Qed.
Lemma sg_One_2 :
forall (a b c d : Z) (p : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = One ->
Z.sgn (a + b) = 0%Z ->
Proof.
(* Goal: forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p One) (_ : @eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intros.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
destruct p as [q| q| ]; repeat (apply False_ind; discriminate H).
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d One H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
simpl in |- *.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) Z0 then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
case (Z.eq_dec (Z.sgn (a + b)) 0).
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
(* Goal: forall _ : @eq Z (Z.sgn (Z.add a b)) Z0, @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intro.
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
reflexivity.
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intro.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
Falsum.
Qed.
Lemma sg_One_3 :
forall (a b c d : Z) (p : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = One ->
Z.sgn (a + b) <> 0%Z ->
Proof.
(* Goal: forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p One) (_ : not (@eq Z (Z.sgn (Z.add a b)) Z0)) (_ : @eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d))), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intros.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
destruct p as [q| q| ]; repeat (apply False_ind; discriminate H).
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d One H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
simpl in |- *.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) Z0 then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
case (Z.eq_dec (Z.sgn (a + b)) 0).
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
(* Goal: forall _ : @eq Z (Z.sgn (Z.add a b)) Z0, @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
Falsum.
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intro.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
case (Z.eq_dec (Z.sgn (a + b)) (Z.sgn (c + d))).
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d))), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
(* Goal: forall _ : @eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intro.
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d))), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
reflexivity.
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d))), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intro.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
Falsum.
Qed.
Lemma sg_One_4 :
forall (a b c d : Z) (p : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = One ->
Z.sgn (a + b) <> 0%Z ->
Proof.
(* Goal: forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p One) (_ : not (@eq Z (Z.sgn (Z.add a b)) Z0)) (_ : not (@eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)))), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
intros.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
destruct p as [q| q| ]; repeat (apply False_ind; discriminate H).
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d One H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
simpl in |- *.
(* Goal: @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) Z0 then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
case (Z.eq_dec (Z.sgn (a + b)) 0).
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
(* Goal: forall _ : @eq Z (Z.sgn (Z.add a b)) Z0, @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) Z0 (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
Falsum.
(* Goal: forall _ : not (@eq Z (Z.sgn (Z.add a b)) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (if Z.eq_dec (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)) then @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One) else @pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
case (Z.eq_dec (Z.sgn (a + b)) (Z.sgn (c + d))).
(* Goal: forall (_ : not (@eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)))) (_ : not (@eq Z (Z.sgn (Z.add a b)) Z0)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
(* Goal: forall (_ : @eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d))) (_ : not (@eq Z (Z.sgn (Z.add a b)) Z0)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
Falsum.
(* Goal: forall (_ : not (@eq Z (Z.sgn (Z.add a b)) (Z.sgn (Z.add c d)))) (_ : not (@eq Z (Z.sgn (Z.add a b)) Z0)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) One)) *)
reflexivity.
Qed.
Lemma Qhomographic_sign_nR_1 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = nR xs ->
b = 0%Z ->
d = 0%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((Z.sgn a * Z.sgn c)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (nR xs)) (_ : @eq Z b Z0) (_ : @eq Z d Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.mul (Z.sgn a) (Z.sgn c)) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ reflexivity | Falsum ] | Falsum ].
Qed.
Lemma Qhomographic_sign_nR_2 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = nR xs ->
b = 0%Z ->
d <> 0%Z ->
(0 < outside_interval c d)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
(Z.sgn a, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (nR xs)) (_ : @eq Z b Z0) (_ : not (@eq Z d Z0)) (_ : Z.lt Z0 (outside_interval c d)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.sgn a) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ Falsum | case (Z_lt_dec 0 (outside_interval c d)); intro Ho2; [ reflexivity | Falsum ] ] | Falsum ].
Qed.
Lemma Qhomographic_sign_nR_3 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = nR xs ->
b = 0%Z ->
d <> 0%Z ->
~ (0 < outside_interval c d)%Z ->
(outside_interval c d < 0)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((- Z.sgn a)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (nR xs)) (_ : @eq Z b Z0) (_ : not (@eq Z d Z0)) (_ : not (Z.lt Z0 (outside_interval c d))) (_ : Z.lt (outside_interval c d) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.opp (Z.sgn a)) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ Falsum | case (Z_lt_dec 0 (outside_interval c d)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval c d) 0); intro Ho2'; [ reflexivity | Falsum ] ] ] | Falsum ].
Qed.
Lemma Qhomographic_sign_nR_4 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c
(c + d) xs)
(H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d
(nR xs)),
b = 0%Z ->
d <> 0%Z ->
~ (0 < outside_interval c d)%Z ->
~ (outside_interval c d < 0)%Z ->
Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR =
Qhomographic_sign a (a + b) c (c + d) xs H_Qhomographic_sg_denom_nonzero.
Proof.
(* Goal: forall (a b c d : Z) (_ : Qpositive) (xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c (Z.add c d) xs) (H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d (nR xs)) (_ : @eq Z b Z0) (_ : not (@eq Z d Z0)) (_ : not (Z.lt Z0 (outside_interval c d))) (_ : not (Z.lt (outside_interval c d) Z0)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR) (Qhomographic_sign a (Z.add a b) c (Z.add c d) xs H_Qhomographic_sg_denom_nonzero) *)
intros; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ Falsum | case (Z_lt_dec 0 (outside_interval c d)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval c d) 0); intro Ho2'; [ Falsum | apply Qhomographic_sign_equal ] ] ] | Falsum ].
Qed.
Lemma Qhomographic_sign_nR_5 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = nR xs ->
b <> 0%Z ->
d = 0%Z ->
(0 < outside_interval a b)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
(Z.sgn c, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (nR xs)) (_ : not (@eq Z b Z0)) (_ : @eq Z d Z0) (_ : Z.lt Z0 (outside_interval a b)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.sgn c) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ case (Z_lt_dec 0 (outside_interval a b)); intro Ho2; [ reflexivity | Falsum ] | Falsum ] ].
Qed.
Lemma Qhomographic_sign_nR_6 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = nR xs ->
b <> 0%Z ->
d = 0%Z ->
~ (0 < outside_interval a b)%Z ->
(outside_interval a b < 0)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((- Z.sgn c)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (nR xs)) (_ : not (@eq Z b Z0)) (_ : @eq Z d Z0) (_ : not (Z.lt Z0 (outside_interval a b))) (_ : Z.lt (outside_interval a b) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.opp (Z.sgn c)) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ case (Z_lt_dec 0 (outside_interval a b)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval a b) 0); intro Ho2'; [ reflexivity | Falsum ] ] | Falsum ] ].
Qed.
Lemma Qhomographic_sign_nR_7 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c
(c + d) xs)
(H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d
(nR xs)),
b <> 0%Z ->
d = 0%Z ->
~ (0 < outside_interval a b)%Z ->
~ (outside_interval a b < 0)%Z ->
Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR =
Qhomographic_sign a (a + b) c (c + d) xs H_Qhomographic_sg_denom_nonzero.
Proof.
(* Goal: forall (a b c d : Z) (_ : Qpositive) (xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c (Z.add c d) xs) (H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d (nR xs)) (_ : not (@eq Z b Z0)) (_ : @eq Z d Z0) (_ : not (Z.lt Z0 (outside_interval a b))) (_ : not (Z.lt (outside_interval a b) Z0)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR) (Qhomographic_sign a (Z.add a b) c (Z.add c d) xs H_Qhomographic_sg_denom_nonzero) *)
intros; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ case (Z_lt_dec 0 (outside_interval a b)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval a b) 0); intro Ho2'; [ Falsum | apply Qhomographic_sign_equal ] ] | Falsum ] ].
Qed.
Lemma Qhomographic_sign_nR_8 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = nR xs ->
b <> 0%Z ->
d <> 0%Z ->
inside_interval_1 (outside_interval a b) (outside_interval c d) ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
(1%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (nR xs)) (_ : not (@eq Z b Z0)) (_ : not (@eq Z d Z0)) (_ : inside_interval_1 (outside_interval a b) (outside_interval c d)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ Falsum | case (inside_interval_1_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_1; [ reflexivity | Falsum ] ] ].
Qed.
Lemma Qhomographic_sign_nR_9 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = nR xs ->
b <> 0%Z ->
d <> 0%Z ->
~ inside_interval_1 (outside_interval a b) (outside_interval c d) ->
inside_interval_2 (outside_interval a b) (outside_interval c d) ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((-1)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (nR xs)) (_ : not (@eq Z b Z0)) (_ : not (@eq Z d Z0)) (_ : not (inside_interval_1 (outside_interval a b) (outside_interval c d))) (_ : inside_interval_2 (outside_interval a b) (outside_interval c d)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ Falsum | case (inside_interval_1_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_1; [ Falsum | case (inside_interval_2_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_2; [ reflexivity | Falsum ] ] ] ].
Qed.
Lemma Qhomographic_sign_nR_10 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c
(c + d) xs)
(H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d
(nR xs)),
b <> 0%Z ->
d <> 0%Z ->
~ inside_interval_1 (outside_interval a b) (outside_interval c d) ->
~ inside_interval_2 (outside_interval a b) (outside_interval c d) ->
Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR =
Qhomographic_sign a (a + b) c (c + d) xs H_Qhomographic_sg_denom_nonzero.
Proof.
(* Goal: forall (a b c d : Z) (_ : Qpositive) (xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c (Z.add c d) xs) (H_Qhomographic_sg_denom_nonzero_nR : Qhomographic_sg_denom_nonzero c d (nR xs)) (_ : not (@eq Z b Z0)) (_ : not (@eq Z d Z0)) (_ : not (inside_interval_1 (outside_interval a b) (outside_interval c d))) (_ : not (inside_interval_2 (outside_interval a b) (outside_interval c d))), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d (nR xs) H_Qhomographic_sg_denom_nonzero_nR) (Qhomographic_sign a (Z.add a b) c (Z.add c d) xs H_Qhomographic_sg_denom_nonzero) *)
intros; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ Falsum | case (inside_interval_1_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_1; [ Falsum | case (inside_interval_2_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_2; [ Falsum | apply Qhomographic_sign_equal ] ] ] ].
Qed.
Lemma Qhomographic_sign_dL_1 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = dL xs ->
b = 0%Z ->
d = 0%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((Z.sgn a * Z.sgn c)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (dL xs)) (_ : @eq Z b Z0) (_ : @eq Z d Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.mul (Z.sgn a) (Z.sgn c)) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ reflexivity | Falsum ] | Falsum ].
Qed.
Lemma Qhomographic_sign_dL_2 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = dL xs ->
b = 0%Z ->
d <> 0%Z ->
(0 < outside_interval c d)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
(Z.sgn a, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (dL xs)) (_ : @eq Z b Z0) (_ : not (@eq Z d Z0)) (_ : Z.lt Z0 (outside_interval c d)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.sgn a) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ Falsum | case (Z_lt_dec 0 (outside_interval c d)); intro Ho2; [ reflexivity | Falsum ] ] | Falsum ].
Qed.
Lemma Qhomographic_sign_dL_3 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = dL xs ->
b = 0%Z ->
d <> 0%Z ->
~ (0 < outside_interval c d)%Z ->
(outside_interval c d < 0)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((- Z.sgn a)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (dL xs)) (_ : @eq Z b Z0) (_ : not (@eq Z d Z0)) (_ : not (Z.lt Z0 (outside_interval c d))) (_ : Z.lt (outside_interval c d) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.opp (Z.sgn a)) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ Falsum | case (Z_lt_dec 0 (outside_interval c d)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval c d) 0); intro Ho2'; [ reflexivity | Falsum ] ] ] | Falsum ].
Qed.
Lemma Qhomographic_sign_dL_4 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero
(c + d) d xs)
(H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d
(dL xs)),
b = 0%Z ->
d <> 0%Z ->
~ (0 < outside_interval c d)%Z ->
~ (outside_interval c d < 0)%Z ->
Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL =
Qhomographic_sign (a + b) b (c + d) d xs H_Qhomographic_sg_denom_nonzero.
Proof.
(* Goal: forall (a b c d : Z) (_ : Qpositive) (xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero (Z.add c d) d xs) (H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d (dL xs)) (_ : @eq Z b Z0) (_ : not (@eq Z d Z0)) (_ : not (Z.lt Z0 (outside_interval c d))) (_ : not (Z.lt (outside_interval c d) Z0)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL) (Qhomographic_sign (Z.add a b) b (Z.add c d) d xs H_Qhomographic_sg_denom_nonzero) *)
intros; simpl in |- *; case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ Falsum | case (Z_lt_dec 0 (outside_interval c d)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval c d) 0); intro Ho2'; [ Falsum | apply Qhomographic_sign_equal ] ] ] | Falsum ].
Qed.
Lemma Qhomographic_sign_dL_5 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = dL xs ->
b <> 0%Z ->
d = 0%Z ->
(0 < outside_interval a b)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
(Z.sgn c, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (dL xs)) (_ : not (@eq Z b Z0)) (_ : @eq Z d Z0) (_ : Z.lt Z0 (outside_interval a b)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.sgn c) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ case (Z_lt_dec 0 (outside_interval a b)); intro Ho2; [ reflexivity | Falsum ] | Falsum ] ].
Qed.
Lemma Qhomographic_sign_dL_6 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = dL xs ->
b <> 0%Z ->
d = 0%Z ->
~ (0 < outside_interval a b)%Z ->
(outside_interval a b < 0)%Z ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((- Z.sgn c)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (dL xs)) (_ : not (@eq Z b Z0)) (_ : @eq Z d Z0) (_ : not (Z.lt Z0 (outside_interval a b))) (_ : Z.lt (outside_interval a b) Z0), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Z.opp (Z.sgn c)) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ case (Z_lt_dec 0 (outside_interval a b)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval a b) 0); intro Ho2'; [ reflexivity | Falsum ] ] | Falsum ] ].
Qed.
Lemma Qhomographic_sign_dL_7 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero
(c + d) d xs)
(H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d
(dL xs)),
b <> 0%Z ->
d = 0%Z ->
~ (0 < outside_interval a b)%Z ->
~ (outside_interval a b < 0)%Z ->
Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL =
Qhomographic_sign (a + b) b (c + d) d xs H_Qhomographic_sg_denom_nonzero.
Proof.
(* Goal: forall (a b c d : Z) (_ : Qpositive) (xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero (Z.add c d) d xs) (H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d (dL xs)) (_ : not (@eq Z b Z0)) (_ : @eq Z d Z0) (_ : not (Z.lt Z0 (outside_interval a b))) (_ : not (Z.lt (outside_interval a b) Z0)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL) (Qhomographic_sign (Z.add a b) b (Z.add c d) d xs H_Qhomographic_sg_denom_nonzero) *)
intros; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ case (Z_lt_dec 0 (outside_interval a b)); intro Ho2; [ Falsum | case (Z_lt_dec (outside_interval a b) 0); intro Ho2'; [ Falsum | apply Qhomographic_sign_equal ] ] | Falsum ] ].
Qed.
Lemma Qhomographic_sign_dL_8 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = dL xs ->
b <> 0%Z ->
d <> 0%Z ->
inside_interval_1 (outside_interval a b) (outside_interval c d) ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
(1%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (dL xs)) (_ : not (@eq Z b Z0)) (_ : not (@eq Z d Z0)) (_ : inside_interval_1 (outside_interval a b) (outside_interval c d)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zpos xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ Falsum | case (inside_interval_1_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_1; [ reflexivity | Falsum ] ] ].
Qed.
Lemma Qhomographic_sign_dL_9 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
p = dL xs ->
b <> 0%Z ->
d <> 0%Z ->
~ inside_interval_1 (outside_interval a b) (outside_interval c d) ->
inside_interval_2 (outside_interval a b) (outside_interval c d) ->
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero =
((-1)%Z, (a, (b, (c, d)), p)).
Proof.
(* Goal: forall (a b c d : Z) (p xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) (_ : @eq Qpositive p (dL xs)) (_ : not (@eq Z b Z0)) (_ : not (@eq Z d Z0)) (_ : not (inside_interval_1 (outside_interval a b) (outside_interval c d))) (_ : inside_interval_2 (outside_interval a b) (outside_interval c d)), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero) (@pair Z (prod (prod Z (prod Z (prod Z Z))) Qpositive) (Zneg xH) (@pair (prod Z (prod Z (prod Z Z))) Qpositive (@pair Z (prod Z (prod Z Z)) a (@pair Z (prod Z Z) b (@pair Z Z c d))) p)) *)
intros; generalize H_Qhomographic_sg_denom_nonzero; clear H_Qhomographic_sg_denom_nonzero; rewrite H; intros H_Qhomographic_sg_denom_nonzero; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ Falsum | case (inside_interval_1_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_1; [ Falsum | case (inside_interval_2_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_2; [ reflexivity | Falsum ] ] ] ].
Qed.
Lemma Qhomographic_sign_dL_10 :
forall (a b c d : Z) (p xs : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero
(c + d) d xs)
(H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d
(dL xs)),
b <> 0%Z ->
d <> 0%Z ->
~ inside_interval_1 (outside_interval a b) (outside_interval c d) ->
~ inside_interval_2 (outside_interval a b) (outside_interval c d) ->
Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL =
Qhomographic_sign (a + b) b (c + d) d xs H_Qhomographic_sg_denom_nonzero.
Proof.
(* Goal: forall (a b c d : Z) (_ : Qpositive) (xs : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero (Z.add c d) d xs) (H_Qhomographic_sg_denom_nonzero_dL : Qhomographic_sg_denom_nonzero c d (dL xs)) (_ : not (@eq Z b Z0)) (_ : not (@eq Z d Z0)) (_ : not (inside_interval_1 (outside_interval a b) (outside_interval c d))) (_ : not (inside_interval_2 (outside_interval a b) (outside_interval c d))), @eq (prod Z (prod (prod Z (prod Z (prod Z Z))) Qpositive)) (Qhomographic_sign a b c d (dL xs) H_Qhomographic_sg_denom_nonzero_dL) (Qhomographic_sign (Z.add a b) b (Z.add c d) d xs H_Qhomographic_sg_denom_nonzero) *)
intros; simpl in |- *; case (Z_zerop b); intro Hb; [ Falsum | case (Z_zerop d); intro Hd; [ Falsum | case (inside_interval_1_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_1; [ Falsum | case (inside_interval_2_dec_inf (outside_interval a b) (outside_interval c d)); intro H_inside_2; [ Falsum | apply Qhomographic_sign_equal ] ] ] ].
Qed.
Lemma sg_sign :
forall (a b c d : Z) (qp : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d qp),
let (l1, L2) :=
Qhomographic_sign a b c d qp H_Qhomographic_sg_denom_nonzero in
{l1 = 0%Z} + {l1 = 1%Z} + {l1 = (-1)%Z}.
Proof.
(* Goal: forall (a b c d : Z) (qp : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d qp), let (l1, _) := Qhomographic_sign a b c d qp H_Qhomographic_sg_denom_nonzero in sumor (sumbool (@eq Z l1 Z0) (@eq Z l1 (Zpos xH))) (@eq Z l1 (Zneg xH)) *)
fix sg_sign 5.
(* Goal: forall (a b c d : Z) (qp : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d qp), let (l1, _) := Qhomographic_sign a b c d qp H_Qhomographic_sg_denom_nonzero in sumor (sumbool (@eq Z l1 Z0) (@eq Z l1 (Zpos xH))) (@eq Z l1 (Zneg xH)) *)
intros.
(* Goal: let (l1, _) := Qhomographic_sign a b c d qp H_Qhomographic_sg_denom_nonzero in sumor (sumbool (@eq Z l1 Z0) (@eq Z l1 (Zpos xH))) (@eq Z l1 (Zneg xH)) *)
let T_local := (case (Z_zerop b); intro Hb; [ case (Z_zerop d); intro Hd; [ match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_1 a b c d (nR q) q H_Qhomographic_sg_denom_nonzero (refl_equal (nR q)) Hb Hd) | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_1 a b c d (dL q) q H_Qhomographic_sg_denom_nonzero (refl_equal (dL q)) Hb Hd) end; generalize a c; intros [|pa|pa] [| pc| pc]; simpl in |- *; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] | case (Z_lt_dec 0 (outside_interval c d)); intros Ho2; [ match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_2 a b c d (nR q) q H_Qhomographic_sg_denom_nonzero (refl_equal (nR q)) Hb Hd Ho2) | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_2 a b c d (dL q) q H_Qhomographic_sg_denom_nonzero (refl_equal (dL q)) Hb Hd Ho2) end; generalize a; intros [| pa| pa]; simpl in |- *; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] | case (Z_lt_dec (outside_interval c d) 0); intros Ho2'; [ match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_3 a b c d (nR q) q H_Qhomographic_sg_denom_nonzero (refl_equal (nR q)) Hb Hd Ho2 Ho2') | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_3 a b c d (dL q) q H_Qhomographic_sg_denom_nonzero (refl_equal (dL q)) Hb Hd Ho2 Ho2') end; generalize a; intros [| pa| pa]; simpl in |- *; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] | match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_4 a b c d (nR q) q (Qhomographic_signok_2 c d q H_Qhomographic_sg_denom_nonzero) H_Qhomographic_sg_denom_nonzero Hb Hd Ho2 Ho2') | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_4 a b c d (dL q) q (Qhomographic_signok_3 c d q H_Qhomographic_sg_denom_nonzero) H_Qhomographic_sg_denom_nonzero Hb Hd Ho2 Ho2') end; apply sg_sign ] ] ] | case (Z_zerop d); intro Hd; [ case (Z_lt_dec 0 (outside_interval a b)); intros Ho1; [ match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_5 a b c d (nR q) q H_Qhomographic_sg_denom_nonzero (refl_equal (nR q)) Hb Hd Ho1) | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_5 a b c d (dL q) q H_Qhomographic_sg_denom_nonzero (refl_equal (dL q)) Hb Hd Ho1) end; generalize c; intros [| pc| pc]; simpl in |- *; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] | case (Z_lt_dec (outside_interval a b) 0); intros Ho1'; [ match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_6 a b c d (nR q) q H_Qhomographic_sg_denom_nonzero (refl_equal (nR q)) Hb Hd Ho1 Ho1') | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_6 a b c d (dL q) q H_Qhomographic_sg_denom_nonzero (refl_equal (dL q)) Hb Hd Ho1 Ho1') end; generalize c; intros [| pc| pc]; simpl in |- *; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] | match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_7 a b c d (nR q) q (Qhomographic_signok_2 c d q H_Qhomographic_sg_denom_nonzero) H_Qhomographic_sg_denom_nonzero Hb Hd Ho1 Ho1') | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_7 a b c d (dL q) q (Qhomographic_signok_3 c d q H_Qhomographic_sg_denom_nonzero) H_Qhomographic_sg_denom_nonzero Hb Hd Ho1 Ho1') end; apply sg_sign ] ] | case (inside_interval_1_dec_inf (outside_interval a b) (outside_interval c d)); intros H_inside_1; [ match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_8 a b c d (nR q) q H_Qhomographic_sg_denom_nonzero (refl_equal (nR q)) Hb Hd H_inside_1) | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_8 a b c d (dL q) q H_Qhomographic_sg_denom_nonzero (refl_equal (dL q)) Hb Hd H_inside_1) end; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] | case (inside_interval_2_dec_inf (outside_interval a b) (outside_interval c d)); intros H_inside_2; [ match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_9 a b c d (nR q) q H_Qhomographic_sg_denom_nonzero (refl_equal (nR q)) Hb Hd H_inside_1 H_inside_2) | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_9 a b c d (dL q) q H_Qhomographic_sg_denom_nonzero (refl_equal (dL q)) Hb Hd H_inside_1 H_inside_2) end; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] | match goal with | id1:(?X1 ?X2 ?X3 (nR ?X4)) |- ?X5 => rewrite (Qhomographic_sign_nR_10 a b c d (nR q) q (Qhomographic_signok_2 c d q H_Qhomographic_sg_denom_nonzero) H_Qhomographic_sg_denom_nonzero Hb Hd H_inside_1 H_inside_2) | id1:(?X1 ?X2 ?X3 (dL ?X4)) |- ?X5 => rewrite (Qhomographic_sign_dL_10 a b c d (dL q) q (Qhomographic_signok_3 c d q H_Qhomographic_sg_denom_nonzero) H_Qhomographic_sg_denom_nonzero Hb Hd H_inside_1 H_inside_2) end; apply sg_sign ] ] ] ]) in (destruct qp as [q| q| ]; [ T_local | T_local | case (Z.eq_dec (Z.sgn (a + b)) 0); intro H_ab; [ rewrite (sg_One_2 a b c d One H_Qhomographic_sg_denom_nonzero (refl_equal One) H_ab) | case (Z.eq_dec (Z.sgn (a + b)) (Z.sgn (c + d))); intro H_ab_cd; [ rewrite (sg_One_3 a b c d One H_Qhomographic_sg_denom_nonzero (refl_equal One) H_ab H_ab_cd) | rewrite (sg_One_4 a b c d One H_Qhomographic_sg_denom_nonzero (refl_equal One) H_ab H_ab_cd) ] ]; first [ right; reflexivity | left; left; reflexivity | left; right; reflexivity ] ]).
Qed.
Definition h_sign (a b c d : Z) (p : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p) :=
let (l1, L2) :=
Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in
l1.
Lemma sg_sign_dec :
forall (a b c d : Z) (p : Qpositive)
(H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p),
{h_sign a b c d p H_Qhomographic_sg_denom_nonzero = 0%Z} +
{h_sign a b c d p H_Qhomographic_sg_denom_nonzero = 1%Z} +
{h_sign a b c d p H_Qhomographic_sg_denom_nonzero = (-1)%Z}.
Proof.
(* Goal: forall (a b c d : Z) (p : Qpositive) (H_Qhomographic_sg_denom_nonzero : Qhomographic_sg_denom_nonzero c d p), sumor (sumbool (@eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) Z0) (@eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) (Zpos xH))) (@eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) (Zneg xH)) *)
intros.
(* Goal: sumor (sumbool (@eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) Z0) (@eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) (Zpos xH))) (@eq Z (h_sign a b c d p H_Qhomographic_sg_denom_nonzero) (Zneg xH)) *)
unfold h_sign in |- *.
(* Goal: sumor (sumbool (@eq Z (let (l1, _) := Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in l1) Z0) (@eq Z (let (l1, _) := Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in l1) (Zpos xH))) (@eq Z (let (l1, _) := Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in l1) (Zneg xH)) *)
generalize (sg_sign a b c d p H_Qhomographic_sg_denom_nonzero).
(* Goal: forall _ : let (l1, _) := Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in sumor (sumbool (@eq Z l1 Z0) (@eq Z l1 (Zpos xH))) (@eq Z l1 (Zneg xH)), sumor (sumbool (@eq Z (let (l1, _) := Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in l1) Z0) (@eq Z (let (l1, _) := Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in l1) (Zpos xH))) (@eq Z (let (l1, _) := Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero in l1) (Zneg xH)) *)
case (Qhomographic_sign a b c d p H_Qhomographic_sg_denom_nonzero).
(* Goal: forall (z : Z) (_ : prod (prod Z (prod Z (prod Z Z))) Qpositive) (_ : sumor (sumbool (@eq Z z Z0) (@eq Z z (Zpos xH))) (@eq Z z (Zneg xH))), sumor (sumbool (@eq Z z Z0) (@eq Z z (Zpos xH))) (@eq Z z (Zneg xH)) *)
intros l1 L2.
(* Goal: forall _ : sumor (sumbool (@eq Z l1 Z0) (@eq Z l1 (Zpos xH))) (@eq Z l1 (Zneg xH)), sumor (sumbool (@eq Z l1 Z0) (@eq Z l1 (Zpos xH))) (@eq Z l1 (Zneg xH)) *)
trivial.
Qed.
|
Require Export GeoCoq.Elements.OriginalProofs.proposition_47A.
Require Export GeoCoq.Elements.OriginalProofs.lemma_angleaddition.
Require Export GeoCoq.Elements.OriginalProofs.proposition_41.
Section Euclid.
Context `{Ax:area}.
Lemma proposition_47B :
forall A B C D E F G,
Triangle A B C -> Per B A C -> SQ A B F G -> TS G B A C -> SQ B C E D -> TS D C B A ->
exists X Y, PG B X Y D /\ BetS B X C /\ PG X C E Y /\ BetS D Y E /\ BetS Y X A /\ Per D Y A /\ EF A B F G B X Y D.
Proof.
(* Goal: forall (A B C D E F G : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @Per Ax0 B A C) (_ : @SQ Ax0 A B F G) (_ : @TS Ax0 G B A C) (_ : @SQ Ax0 B C E D) (_ : @TS Ax0 D C B A), @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
intros.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
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 /\ BetS L M A /\ Per D L A)) by (conclude proposition_47A);destruct Tf as [M[L]];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
let Tf:=fresh in assert (Tf:exists N, (BetS D N A /\ Col C B N /\ nCol C B D)) by (conclude_def TS );destruct Tf as [N];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Per G A B) by (conclude_def SQ ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS G A C) by (conclude lemma_righttogether).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Per A B F) by (conclude_def SQ ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Per F B A) by (conclude lemma_8_2).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Per D B C) by (conclude_def SQ ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol A B C) by (conclude_def Triangle ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (PG A B F G) by (conclude lemma_squareparallelogram).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par A B F G) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par A B G F) by (forward_using lemma_parallelflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (TP A B G F) by (conclude lemma_paralleldef2B).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (OS G F A B) by (conclude_def TP ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (OS F G A B) by (forward_using lemma_samesidesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (TS G A B C) by (conclude lemma_oppositesideflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (TS F A B C) by (conclude lemma_planeseparation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
let Tf:=fresh in assert (Tf:exists a, (BetS F a C /\ Col A B a /\ nCol A B F)) by (conclude_def TS );destruct Tf as [a];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col B A a) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par A G B F) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par A G F B) by (forward_using lemma_parallelflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col G A C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col A G C) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq G C) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq C G) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par F B A G) by (conclude lemma_parallelsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par F B C G) by (conclude lemma_collinearparallel).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par F B G C) by (forward_using lemma_parallelflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (~ Meet F B G C) by (conclude_def Par ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq A C) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol A B F) by (forward_using lemma_parallelNC).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq F A) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq F B) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col F B B) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS B a A) by (conclude lemma_collinearbetween).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq B a) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B a A) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq B F) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (eq F F) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B F F) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol A B F) by (forward_using lemma_parallelNC).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol F B A) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA F B A F B A) by (conclude lemma_equalanglesreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B A a) by (conclude lemma_ray5).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA F B A F B a) by (conclude lemma_equalangleshelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq B C) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B C C) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA A B C A B C) by (conclude lemma_equalanglesreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA A B C a B C) by (conclude lemma_equalangleshelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (SumA F B A A B C F B C) by (conclude_def SumA ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
let Tf:=fresh in assert (Tf:exists c, (BetS D c A /\ Col C B c /\ nCol C B D)) by (conclude_def TS );destruct Tf as [c];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (PG B C E D) by (conclude lemma_squareparallelogram).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par B D C E) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par C E B D) by (conclude lemma_parallelsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par C E D B) by (forward_using lemma_parallelflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col B C c) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col B M C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col C B M) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col C B c) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq C B) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col B M c) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par B D M L) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col L M A) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col M L A) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq L A) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq A L) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par B D A L) by (conclude lemma_collinearparallel).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par D B L A) by (forward_using lemma_parallelflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (~ Meet D B L A) by (conclude_def Par ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol B D L) by (forward_using lemma_parallelNC).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq D B) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq M A) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq L M) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (eq D D) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col D B B) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS B c M) by (conclude lemma_collinearbetween).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS B c C) by (conclude lemma_3_6b).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol D B A) by (forward_using lemma_parallelNC).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (~ eq B c).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
(* Goal: not (@eq Ax0 B c) *)
{
(* Goal: not (@eq Ax0 B c) *)
intro.
(* Goal: False *)
assert (Col D B c) by (conclude_def Col ).
(* Goal: False *)
assert (Col D c A) by (conclude_def Col ).
(* Goal: False *)
assert (Col c D B) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col c D A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq D c) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq c D) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col D B A) by (conclude lemma_collinear4).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B c C) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B C c) by (conclude lemma_ray5).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol C B A) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA C B A C B A) by (conclude lemma_equalanglesreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq B A) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B A A) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA C B A c B A) by (conclude lemma_equalangleshelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol C D B) by (forward_using lemma_parallelNC).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol D B C) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA D B C D B C) by (conclude lemma_equalanglesreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (neq B D) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Out B D D) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA D B C D B c) by (conclude lemma_equalangleshelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (SumA D B C C B A D B A) by (conclude_def SumA ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA F B A D B C) by (conclude lemma_Euclid4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA A B C C B A) by (conclude lemma_ABCequalsCBA).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA F B C D B A) by (conclude lemma_angleaddition).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA D B A F B C) by (conclude lemma_equalanglessymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (~ Col C B F).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
(* Goal: not (@Col Ax0 C B F) *)
{
(* Goal: not (@Col Ax0 C B F) *)
intro.
(* Goal: False *)
assert (Col F B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Per C B A) by (conclude lemma_collinearright).
(* Goal: False *)
assert (~ Per C B A) by (conclude lemma_8_7).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol F B C) by (assert (nCol C B F) by auto;forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA F B C C B F) by (conclude lemma_ABCequalsCBA).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA D B A C B F) by (conclude lemma_equalanglestransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong A B B F) by (conclude_def SQ ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong A B F B) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong F B A B) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong B F B A) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong B A B F) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong B C D B) by (conclude_def SQ ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong D B B C) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong B D B C) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert ((Cong D A C F /\ CongA B D A B C F /\ CongA B A D B F C)) by (conclude proposition_04).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong A D F C) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (CongA B F C B A D) by (conclude lemma_equalanglessymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol B A D) by (conclude lemma_equalanglesNC).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol A B D) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Triangle A B D) by (conclude_def Triangle ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong_3 A B D F B C) by (conclude_def Cong_3 ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B D F B C) by (conclude axiom_congruentequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par B M L D) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par B D M L) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par M L B D) by (conclude lemma_parallelsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Par M B D L) by (forward_using lemma_parallelflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (PG M B D L) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col M L A) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET M B D A B D) by (conclude proposition_41).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (PG A B F G) by (conclude lemma_squareparallelogram).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (PG B A G F) by (conclude lemma_PGflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col G A C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col A G C) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B F C B F) by (conclude proposition_41).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B F F B C) by (forward_using axiom_ETpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F B C A B D) by (conclude axiom_ETsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B F A B D) by (conclude axiom_ETtransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B D M B D) by (conclude axiom_ETsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B F M B D) by (conclude axiom_ETtransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong_3 A B F F G A) by (conclude proposition_34).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B F F G A) by (conclude axiom_congruentequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (PG B M L D) by (conclude lemma_PGflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Cong_3 M B D D L M) by (conclude proposition_34).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET M B D D L M) by (conclude axiom_congruentequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F G A A B F) by (conclude axiom_ETsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F G A A B D) by (conclude axiom_ETtransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F G A M B D) by (conclude axiom_ETtransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F G A D L M) by (conclude axiom_ETtransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F G A D M L) by (forward_using axiom_ETpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET D M L F G A) by (conclude axiom_ETsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET D M L F A G) by (forward_using axiom_ETpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F A G D M L) by (conclude axiom_ETsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET A B F D M B) by (forward_using axiom_ETpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET D M B A B F) by (conclude axiom_ETsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET D M B F A B) by (forward_using axiom_ETpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (ET F A B D M B) by (conclude axiom_ETsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
let Tf:=fresh in assert (Tf:exists m, (Midpoint A m F /\ Midpoint B m G)) by (conclude lemma_diagonalsbisect);destruct Tf as [m];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS A m F) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS B m G) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS F m A) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
let Tf:=fresh in assert (Tf:exists n, (Midpoint B n L /\ Midpoint M n D)) by (conclude lemma_diagonalsbisect);destruct Tf as [n];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS B n L) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS M n D) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (BetS D n M) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col M n D) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (Col D M n) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol B M D) by (forward_using lemma_parallelNC).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (nCol D M B) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (EF F B A G D B M L) by (conclude axiom_paste3).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (EF F B A G B M L D) by (forward_using axiom_EFpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (EF B M L D F B A G) by (conclude axiom_EFsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (EF B M L D A B F G) by (forward_using axiom_EFpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
assert (EF A B F G B M L D) by (conclude axiom_EFsymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@BetS Ax0 Y X A) (and (@Per Ax0 D Y A) (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D)))))))) *)
close.
Qed.
End Euclid.
|
Global Set Asymmetric Patterns.
Require Import ZArith.
Require Import EqNat.
Lemma predminus1 : forall n : nat, pred n = n - 1.
Proof.
(* Goal: forall n : nat, @eq nat (Init.Nat.pred n) (Init.Nat.sub n (S O)) *)
intro n.
(* Goal: @eq nat (Init.Nat.pred n) (Init.Nat.sub n (S O)) *)
case n.
(* Goal: forall n : nat, @eq nat (Init.Nat.pred (S n)) (Init.Nat.sub (S n) (S O)) *)
(* Goal: @eq nat (Init.Nat.pred O) (Init.Nat.sub O (S O)) *)
simpl in |- *.
(* Goal: forall n : nat, @eq nat (Init.Nat.pred (S n)) (Init.Nat.sub (S n) (S O)) *)
(* Goal: @eq nat O O *)
reflexivity.
(* Goal: forall n : nat, @eq nat (Init.Nat.pred (S n)) (Init.Nat.sub (S n) (S O)) *)
simpl in |- *.
(* Goal: forall n : nat, @eq nat n (Init.Nat.sub n O) *)
intro m.
(* Goal: @eq nat m (Init.Nat.sub m O) *)
rewrite <- minus_n_O.
(* Goal: @eq nat m m *)
reflexivity.
Qed.
Lemma le_mult_l : forall p q : nat, p <= q -> forall r : nat, r * p <= r * q.
Proof.
(* Goal: forall (p q : nat) (_ : le p q) (r : nat), le (Init.Nat.mul r p) (Init.Nat.mul r q) *)
intros p q H.
(* Goal: forall r : nat, le (Init.Nat.mul r p) (Init.Nat.mul r q) *)
simple induction r.
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul n p) (Init.Nat.mul n q)), le (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q) *)
(* Goal: le (Init.Nat.mul O p) (Init.Nat.mul O q) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul n p) (Init.Nat.mul n q)), le (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q) *)
(* Goal: le O O *)
apply le_n.
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul n p) (Init.Nat.mul n q)), le (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q) *)
intros r1 IHr1.
(* Goal: le (Init.Nat.mul (S r1) p) (Init.Nat.mul (S r1) q) *)
simpl in |- *.
(* Goal: le (Init.Nat.add p (Init.Nat.mul r1 p)) (Init.Nat.add q (Init.Nat.mul r1 q)) *)
apply plus_le_compat.
(* Goal: le (Init.Nat.mul r1 p) (Init.Nat.mul r1 q) *)
(* Goal: le p q *)
assumption.
(* Goal: le (Init.Nat.mul r1 p) (Init.Nat.mul r1 q) *)
assumption.
Qed.
Lemma lt_plus_plus : forall n m p q : nat, n < m -> p < q -> n + p < m + q.
Proof.
(* Goal: forall (n m p q : nat) (_ : lt n m) (_ : lt p q), lt (Init.Nat.add n p) (Init.Nat.add m q) *)
intros n m p q H H0.
(* Goal: lt (Init.Nat.add n p) (Init.Nat.add m q) *)
elim H; simpl in |- *; auto with arith.
Qed.
Lemma lt_mult_l :
forall p q : nat, p < q -> forall r : nat, S r * p < S r * q.
Proof.
(* Goal: forall (p q : nat) (_ : lt p q) (r : nat), lt (Init.Nat.mul (S r) p) (Init.Nat.mul (S r) q) *)
intros p q H.
(* Goal: forall r : nat, lt (Init.Nat.mul (S r) p) (Init.Nat.mul (S r) q) *)
simple induction r.
(* Goal: forall (n : nat) (_ : lt (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q)), lt (Init.Nat.mul (S (S n)) p) (Init.Nat.mul (S (S n)) q) *)
(* Goal: lt (Init.Nat.mul (S O) p) (Init.Nat.mul (S O) q) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : lt (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q)), lt (Init.Nat.mul (S (S n)) p) (Init.Nat.mul (S (S n)) q) *)
(* Goal: lt (Init.Nat.add p O) (Init.Nat.add q O) *)
rewrite <- plus_n_O.
(* Goal: forall (n : nat) (_ : lt (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q)), lt (Init.Nat.mul (S (S n)) p) (Init.Nat.mul (S (S n)) q) *)
(* Goal: lt p (Init.Nat.add q O) *)
rewrite <- plus_n_O.
(* Goal: forall (n : nat) (_ : lt (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q)), lt (Init.Nat.mul (S (S n)) p) (Init.Nat.mul (S (S n)) q) *)
(* Goal: lt p q *)
assumption.
(* Goal: forall (n : nat) (_ : lt (Init.Nat.mul (S n) p) (Init.Nat.mul (S n) q)), lt (Init.Nat.mul (S (S n)) p) (Init.Nat.mul (S (S n)) q) *)
intros r1 IHr1.
(* Goal: lt (Init.Nat.mul (S (S r1)) p) (Init.Nat.mul (S (S r1)) q) *)
simpl in |- *.
(* Goal: lt (Init.Nat.add p (Init.Nat.add p (Init.Nat.mul r1 p))) (Init.Nat.add q (Init.Nat.add q (Init.Nat.mul r1 q))) *)
apply lt_plus_plus.
(* Goal: lt (Init.Nat.add p (Init.Nat.mul r1 p)) (Init.Nat.add q (Init.Nat.mul r1 q)) *)
(* Goal: lt p q *)
assumption.
(* Goal: lt (Init.Nat.add p (Init.Nat.mul r1 p)) (Init.Nat.add q (Init.Nat.mul r1 q)) *)
assumption.
Qed.
Lemma le_mult_r : forall p q : nat, p <= q -> forall r : nat, p * r <= q * r.
Proof.
(* Goal: forall (p q : nat) (_ : le p q) (r : nat), le (Init.Nat.mul p r) (Init.Nat.mul q r) *)
intros p q H.
(* Goal: forall r : nat, le (Init.Nat.mul p r) (Init.Nat.mul q r) *)
simple induction r.
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *)
(* Goal: le (Init.Nat.mul p O) (Init.Nat.mul q O) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *)
(* Goal: le (Init.Nat.mul p O) (Init.Nat.mul q O) *)
rewrite <- (mult_n_O p).
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *)
(* Goal: le O (Init.Nat.mul q O) *)
rewrite <- (mult_n_O q).
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *)
(* Goal: le O O *)
apply le_n.
(* Goal: forall (n : nat) (_ : le (Init.Nat.mul p n) (Init.Nat.mul q n)), le (Init.Nat.mul p (S n)) (Init.Nat.mul q (S n)) *)
intros r1 IHr1.
(* Goal: le (Init.Nat.mul p (S r1)) (Init.Nat.mul q (S r1)) *)
rewrite <- (mult_n_Sm p r1).
(* Goal: le (Init.Nat.add (Init.Nat.mul p r1) p) (Init.Nat.mul q (S r1)) *)
rewrite <- (mult_n_Sm q r1).
(* Goal: le (Init.Nat.add (Init.Nat.mul p r1) p) (Init.Nat.add (Init.Nat.mul q r1) q) *)
apply plus_le_compat.
(* Goal: le p q *)
(* Goal: le (Init.Nat.mul p r1) (Init.Nat.mul q r1) *)
assumption.
(* Goal: le p q *)
assumption.
Qed.
Lemma sqrbound : forall p q : nat, p * p <= p * q \/ q * q <= p * q.
Proof.
(* Goal: forall p q : nat, or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *)
intros.
(* Goal: or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *)
elim (le_or_lt p q).
(* Goal: forall _ : lt q p, or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *)
(* Goal: forall _ : le p q, or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *)
left.
(* Goal: forall _ : lt q p, or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *)
(* Goal: le (Init.Nat.mul p p) (Init.Nat.mul p q) *)
apply le_mult_l.
(* Goal: forall _ : lt q p, or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *)
(* Goal: le p q *)
assumption.
(* Goal: forall _ : lt q p, or (le (Init.Nat.mul p p) (Init.Nat.mul p q)) (le (Init.Nat.mul q q) (Init.Nat.mul p q)) *)
right.
(* Goal: le (Init.Nat.mul q q) (Init.Nat.mul p q) *)
apply le_mult_r.
(* Goal: le q p *)
apply lt_le_weak.
(* Goal: lt q p *)
assumption.
Qed.
Lemma le_n_nm : forall n m : nat, n <= n * S m.
Proof.
(* Goal: forall n m : nat, le n (Init.Nat.mul n (S m)) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall m : nat, le n (Init.Nat.mul n (S m))) (m : nat), le (S n) (Init.Nat.mul (S n) (S m)) *)
(* Goal: forall m : nat, le O (Init.Nat.mul O (S m)) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, le n (Init.Nat.mul n (S m))) (m : nat), le (S n) (Init.Nat.mul (S n) (S m)) *)
(* Goal: forall _ : nat, le O O *)
intros.
(* Goal: forall (n : nat) (_ : forall m : nat, le n (Init.Nat.mul n (S m))) (m : nat), le (S n) (Init.Nat.mul (S n) (S m)) *)
(* Goal: le O O *)
apply le_n.
(* Goal: forall (n : nat) (_ : forall m : nat, le n (Init.Nat.mul n (S m))) (m : nat), le (S n) (Init.Nat.mul (S n) (S m)) *)
intros n1 IHn1.
(* Goal: forall m : nat, le (S n1) (Init.Nat.mul (S n1) (S m)) *)
simpl in |- *.
(* Goal: forall m : nat, le (S n1) (S (Init.Nat.add m (Init.Nat.mul n1 (S m)))) *)
intros.
(* Goal: le (S n1) (S (Init.Nat.add m (Init.Nat.mul n1 (S m)))) *)
apply le_n_S.
(* Goal: le n1 (Init.Nat.add m (Init.Nat.mul n1 (S m))) *)
rewrite (plus_comm m (n1 * S m)).
(* Goal: le n1 (Nat.add (Init.Nat.mul n1 (S m)) m) *)
apply le_plus_trans.
(* Goal: le n1 (Init.Nat.mul n1 (S m)) *)
apply IHn1.
Qed.
Lemma le_n_mn : forall n m : nat, n <= S m * n.
Proof.
(* Goal: forall n m : nat, le n (Init.Nat.mul (S m) n) *)
intros.
(* Goal: le n (Init.Nat.mul (S m) n) *)
rewrite (mult_comm (S m) n).
(* Goal: le n (Nat.mul n (S m)) *)
apply le_n_nm.
Qed.
Lemma le_n_nn : forall n : nat, n <= n * n.
Proof.
(* Goal: forall n : nat, le n (Init.Nat.mul n n) *)
intro n.
(* Goal: le n (Init.Nat.mul n n) *)
case n.
(* Goal: forall n : nat, le (S n) (Init.Nat.mul (S n) (S n)) *)
(* Goal: le O (Init.Nat.mul O O) *)
simpl in |- *.
(* Goal: forall n : nat, le (S n) (Init.Nat.mul (S n) (S n)) *)
(* Goal: le O O *)
apply le_n.
(* Goal: forall n : nat, le (S n) (Init.Nat.mul (S n) (S n)) *)
simpl in |- *.
(* Goal: forall n : nat, le (S n) (S (Init.Nat.add n (Init.Nat.mul n (S n)))) *)
intros.
(* Goal: le (S n0) (S (Init.Nat.add n0 (Init.Nat.mul n0 (S n0)))) *)
apply le_n_S.
(* Goal: le n0 (Init.Nat.add n0 (Init.Nat.mul n0 (S n0))) *)
apply le_plus_trans.
(* Goal: le n0 n0 *)
apply le_n.
Qed.
Lemma lt_n_nm : forall n m : nat, 0 < n -> 1 < m -> n < n * m.
Proof.
(* Goal: forall (n m : nat) (_ : lt O n) (_ : lt (S O) m), lt n (Init.Nat.mul n m) *)
intros n m.
(* Goal: forall (_ : lt O n) (_ : lt (S O) m), lt n (Init.Nat.mul n m) *)
case n.
(* Goal: forall (n : nat) (_ : lt O (S n)) (_ : lt (S O) m), lt (S n) (Init.Nat.mul (S n) m) *)
(* Goal: forall (_ : lt O O) (_ : lt (S O) m), lt O (Init.Nat.mul O m) *)
intros.
(* Goal: forall (n : nat) (_ : lt O (S n)) (_ : lt (S O) m), lt (S n) (Init.Nat.mul (S n) m) *)
(* Goal: lt O (Init.Nat.mul O m) *)
elim (lt_n_O 0).
(* Goal: forall (n : nat) (_ : lt O (S n)) (_ : lt (S O) m), lt (S n) (Init.Nat.mul (S n) m) *)
(* Goal: lt O O *)
assumption.
(* Goal: forall (n : nat) (_ : lt O (S n)) (_ : lt (S O) m), lt (S n) (Init.Nat.mul (S n) m) *)
intro n1.
(* Goal: forall (_ : lt O (S n1)) (_ : lt (S O) m), lt (S n1) (Init.Nat.mul (S n1) m) *)
case m.
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S n)), lt (S n1) (Init.Nat.mul (S n1) (S n)) *)
(* Goal: forall (_ : lt O (S n1)) (_ : lt (S O) O), lt (S n1) (Init.Nat.mul (S n1) O) *)
intros.
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S n)), lt (S n1) (Init.Nat.mul (S n1) (S n)) *)
(* Goal: lt (S n1) (Init.Nat.mul (S n1) O) *)
elim (lt_n_O 1).
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S n)), lt (S n1) (Init.Nat.mul (S n1) (S n)) *)
(* Goal: lt (S O) O *)
assumption.
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S n)), lt (S n1) (Init.Nat.mul (S n1) (S n)) *)
intro m1.
(* Goal: forall (_ : lt O (S n1)) (_ : lt (S O) (S m1)), lt (S n1) (Init.Nat.mul (S n1) (S m1)) *)
case m1.
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S (S n))), lt (S n1) (Init.Nat.mul (S n1) (S (S n))) *)
(* Goal: forall (_ : lt O (S n1)) (_ : lt (S O) (S O)), lt (S n1) (Init.Nat.mul (S n1) (S O)) *)
intros.
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S (S n))), lt (S n1) (Init.Nat.mul (S n1) (S (S n))) *)
(* Goal: lt (S n1) (Init.Nat.mul (S n1) (S O)) *)
elim (lt_irrefl 1).
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S (S n))), lt (S n1) (Init.Nat.mul (S n1) (S (S n))) *)
(* Goal: lt (S O) (S O) *)
assumption.
(* Goal: forall (n : nat) (_ : lt O (S n1)) (_ : lt (S O) (S (S n))), lt (S n1) (Init.Nat.mul (S n1) (S (S n))) *)
intro m2.
(* Goal: forall (_ : lt O (S n1)) (_ : lt (S O) (S (S m2))), lt (S n1) (Init.Nat.mul (S n1) (S (S m2))) *)
elim n1.
(* Goal: forall (n : nat) (_ : forall (_ : lt O (S n)) (_ : lt (S O) (S (S m2))), lt (S n) (Init.Nat.mul (S n) (S (S m2)))) (_ : lt O (S (S n))) (_ : lt (S O) (S (S m2))), lt (S (S n)) (Init.Nat.mul (S (S n)) (S (S m2))) *)
(* Goal: forall (_ : lt O (S O)) (_ : lt (S O) (S (S m2))), lt (S O) (Init.Nat.mul (S O) (S (S m2))) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall (_ : lt O (S n)) (_ : lt (S O) (S (S m2))), lt (S n) (Init.Nat.mul (S n) (S (S m2)))) (_ : lt O (S (S n))) (_ : lt (S O) (S (S m2))), lt (S (S n)) (Init.Nat.mul (S (S n)) (S (S m2))) *)
(* Goal: forall (_ : lt O (S O)) (_ : lt (S O) (S (S m2))), lt (S O) (S (S (Init.Nat.add m2 O))) *)
intros.
(* Goal: forall (n : nat) (_ : forall (_ : lt O (S n)) (_ : lt (S O) (S (S m2))), lt (S n) (Init.Nat.mul (S n) (S (S m2)))) (_ : lt O (S (S n))) (_ : lt (S O) (S (S m2))), lt (S (S n)) (Init.Nat.mul (S (S n)) (S (S m2))) *)
(* Goal: lt (S O) (S (S (Init.Nat.add m2 O))) *)
apply lt_n_S.
(* Goal: forall (n : nat) (_ : forall (_ : lt O (S n)) (_ : lt (S O) (S (S m2))), lt (S n) (Init.Nat.mul (S n) (S (S m2)))) (_ : lt O (S (S n))) (_ : lt (S O) (S (S m2))), lt (S (S n)) (Init.Nat.mul (S (S n)) (S (S m2))) *)
(* Goal: lt O (S (Init.Nat.add m2 O)) *)
apply lt_O_Sn.
(* Goal: forall (n : nat) (_ : forall (_ : lt O (S n)) (_ : lt (S O) (S (S m2))), lt (S n) (Init.Nat.mul (S n) (S (S m2)))) (_ : lt O (S (S n))) (_ : lt (S O) (S (S m2))), lt (S (S n)) (Init.Nat.mul (S (S n)) (S (S m2))) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall (_ : lt O (S n)) (_ : lt (S O) (S (S m2))), lt (S n) (S (S (Init.Nat.add m2 (Init.Nat.mul n (S (S m2))))))) (_ : lt O (S (S n))) (_ : lt (S O) (S (S m2))), lt (S (S n)) (S (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n (S (S m2))))))))) *)
intros n2 IH.
(* Goal: forall (_ : lt O (S (S n2))) (_ : lt (S O) (S (S m2))), lt (S (S n2)) (S (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2))))))))) *)
intros.
(* Goal: lt (S (S n2)) (S (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2))))))))) *)
apply lt_n_S.
(* Goal: lt (S n2) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *)
apply lt_trans with (S (S (m2 + n2 * S (S m2)))).
(* Goal: lt (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *)
(* Goal: lt (S n2) (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) *)
apply IH.
(* Goal: lt (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *)
(* Goal: lt (S O) (S (S m2)) *)
(* Goal: lt O (S n2) *)
apply lt_O_Sn.
(* Goal: lt (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *)
(* Goal: lt (S O) (S (S m2)) *)
apply lt_n_S.
(* Goal: lt (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *)
(* Goal: lt O (S m2) *)
apply lt_O_Sn.
(* Goal: lt (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))) (S (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2)))))))) *)
apply lt_n_S.
(* Goal: lt (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2))))) (Init.Nat.add m2 (S (S (Init.Nat.add m2 (Init.Nat.mul n2 (S (S m2))))))) *)
rewrite (plus_comm m2).
(* Goal: lt (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) (Init.Nat.add m2 (S (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)))) *)
rewrite (plus_comm m2).
(* Goal: lt (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) (Nat.add (S (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2))) m2) *)
simpl in |- *.
(* Goal: lt (S (Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) (S (S (Nat.add (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) m2))) *)
apply lt_n_S.
(* Goal: lt (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) (S (Nat.add (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) m2)) *)
apply lt_le_trans with (S (n2 * S (S m2) + m2)).
(* Goal: le (S (Init.Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) (S (Nat.add (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) m2)) *)
(* Goal: lt (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) (S (Init.Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) *)
apply lt_n_Sn.
(* Goal: le (S (Init.Nat.add (Init.Nat.mul n2 (S (S m2))) m2)) (S (Nat.add (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) m2)) *)
apply le_n_S.
(* Goal: le (Init.Nat.add (Init.Nat.mul n2 (S (S m2))) m2) (Nat.add (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) m2) *)
apply le_plus_trans.
(* Goal: le (Init.Nat.add (Init.Nat.mul n2 (S (S m2))) m2) (Nat.add (Init.Nat.mul n2 (S (S m2))) m2) *)
apply le_n.
Qed.
Lemma sqr_ascend : forall n : nat, n > 1 -> n < n * n.
Proof.
(* Goal: forall (n : nat) (_ : gt n (S O)), lt n (Init.Nat.mul n n) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall _ : gt n (S O), lt n (Init.Nat.mul n n)) (_ : gt (S n) (S O)), lt (S n) (Init.Nat.mul (S n) (S n)) *)
(* Goal: forall _ : gt O (S O), lt O (Init.Nat.mul O O) *)
intros.
(* Goal: forall (n : nat) (_ : forall _ : gt n (S O), lt n (Init.Nat.mul n n)) (_ : gt (S n) (S O)), lt (S n) (Init.Nat.mul (S n) (S n)) *)
(* Goal: lt O (Init.Nat.mul O O) *)
elim (lt_n_O 1).
(* Goal: forall (n : nat) (_ : forall _ : gt n (S O), lt n (Init.Nat.mul n n)) (_ : gt (S n) (S O)), lt (S n) (Init.Nat.mul (S n) (S n)) *)
(* Goal: lt (S O) O *)
assumption.
(* Goal: forall (n : nat) (_ : forall _ : gt n (S O), lt n (Init.Nat.mul n n)) (_ : gt (S n) (S O)), lt (S n) (Init.Nat.mul (S n) (S n)) *)
intros m IHm.
(* Goal: forall _ : gt (S m) (S O), lt (S m) (Init.Nat.mul (S m) (S m)) *)
intro.
(* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *)
unfold gt in H.
(* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *)
unfold lt in H.
(* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *)
elim (le_lt_or_eq 1 m).
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: forall _ : lt (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
intros.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *)
simpl in |- *.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: lt (S m) (S (Init.Nat.add m (Init.Nat.mul m (S m)))) *)
apply lt_n_S.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: lt m (Init.Nat.add m (Init.Nat.mul m (S m))) *)
rewrite <- (mult_n_Sm m m).
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: lt m (Init.Nat.add m (Init.Nat.add (Init.Nat.mul m m) m)) *)
rewrite plus_comm.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: lt m (Nat.add (Init.Nat.add (Init.Nat.mul m m) m) m) *)
apply lt_plus_trans.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: lt m (Init.Nat.add (Init.Nat.mul m m) m) *)
apply lt_plus_trans.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: lt m (Init.Nat.mul m m) *)
apply IHm.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
(* Goal: gt m (S O) *)
assumption.
(* Goal: le (S O) m *)
(* Goal: forall _ : @eq nat (S O) m, lt (S m) (Init.Nat.mul (S m) (S m)) *)
intros.
(* Goal: le (S O) m *)
(* Goal: lt (S m) (Init.Nat.mul (S m) (S m)) *)
rewrite <- H0.
(* Goal: le (S O) m *)
(* Goal: lt (S (S O)) (Init.Nat.mul (S (S O)) (S (S O))) *)
simpl in |- *.
(* Goal: le (S O) m *)
(* Goal: lt (S (S O)) (S (S (S (S O)))) *)
unfold lt in |- *.
(* Goal: le (S O) m *)
(* Goal: le (S (S (S O))) (S (S (S (S O)))) *)
apply le_S.
(* Goal: le (S O) m *)
(* Goal: le (S (S (S O))) (S (S (S O))) *)
apply le_n.
(* Goal: le (S O) m *)
apply le_S_n.
(* Goal: le (S (S O)) (S m) *)
assumption.
Qed.
Lemma witness_le : forall x y : nat, (exists q : nat, x + q = y) -> x <= y.
Proof.
(* Goal: forall (x y : nat) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) y)), le x y *)
intros.
(* Goal: le x y *)
elim H.
(* Goal: forall (x0 : nat) (_ : @eq nat (Init.Nat.add x x0) y), le x y *)
intro q.
(* Goal: forall _ : @eq nat (Init.Nat.add x q) y, le x y *)
intros.
(* Goal: le x y *)
rewrite <- H0.
(* Goal: le x (Init.Nat.add x q) *)
elim q.
(* Goal: forall (n : nat) (_ : le x (Init.Nat.add x n)), le x (Init.Nat.add x (S n)) *)
(* Goal: le x (Init.Nat.add x O) *)
rewrite <- plus_n_O.
(* Goal: forall (n : nat) (_ : le x (Init.Nat.add x n)), le x (Init.Nat.add x (S n)) *)
(* Goal: le x x *)
apply le_n.
(* Goal: forall (n : nat) (_ : le x (Init.Nat.add x n)), le x (Init.Nat.add x (S n)) *)
intros.
(* Goal: le x (Init.Nat.add x (S n)) *)
rewrite <- plus_n_Sm.
(* Goal: le x (S (Init.Nat.add x n)) *)
apply le_S.
(* Goal: le x (Init.Nat.add x n) *)
assumption.
Qed.
Lemma le_witness : forall x y : nat, x <= y -> exists q : nat, x + q = y.
Proof.
(* Goal: forall (x y : nat) (_ : le x y), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) y) *)
intros x y.
(* Goal: forall _ : le x y, @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) y) *)
intro.
(* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) y) *)
elim H.
(* Goal: forall (m : nat) (_ : le x m) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) m)), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
(* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) x) *)
split with 0.
(* Goal: forall (m : nat) (_ : le x m) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) m)), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
(* Goal: @eq nat (Init.Nat.add x O) x *)
simpl in |- *.
(* Goal: forall (m : nat) (_ : le x m) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) m)), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
(* Goal: @eq nat (Init.Nat.add x O) x *)
symmetry in |- *.
(* Goal: forall (m : nat) (_ : le x m) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) m)), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
(* Goal: @eq nat x (Init.Nat.add x O) *)
apply plus_n_O.
(* Goal: forall (m : nat) (_ : le x m) (_ : @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) m)), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
intros.
(* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
case H1.
(* Goal: forall (x0 : nat) (_ : @eq nat (Init.Nat.add x x0) m), @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
intros.
(* Goal: @ex nat (fun q : nat => @eq nat (Init.Nat.add x q) (S m)) *)
split with (S x0).
(* Goal: @eq nat (Init.Nat.add x (S x0)) (S m) *)
replace (x + S x0) with (S (x + x0)).
(* Goal: @eq nat (S (Init.Nat.add x x0)) (Init.Nat.add x (S x0)) *)
(* Goal: @eq nat (S (Init.Nat.add x x0)) (S m) *)
simpl in |- *.
(* Goal: @eq nat (S (Init.Nat.add x x0)) (Init.Nat.add x (S x0)) *)
(* Goal: @eq nat (S (Init.Nat.add x x0)) (S m) *)
rewrite H2.
(* Goal: @eq nat (S (Init.Nat.add x x0)) (Init.Nat.add x (S x0)) *)
(* Goal: @eq nat (S m) (S m) *)
reflexivity.
(* Goal: @eq nat (S (Init.Nat.add x x0)) (Init.Nat.add x (S x0)) *)
apply plus_n_Sm.
Qed.
Lemma lt_witness :
forall x y : nat, x < y -> exists q : nat, x + q = y /\ 0 < q.
Proof.
(* Goal: forall (x y : nat) (_ : lt x y), @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (lt O q)) *)
unfold lt in |- *.
(* Goal: forall (x y : nat) (_ : le (S x) y), @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (le (S O) q)) *)
intros.
(* Goal: @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (le (S O) q)) *)
elim (le_witness (S x) y).
(* Goal: le (S x) y *)
(* Goal: forall (x0 : nat) (_ : @eq nat (Init.Nat.add (S x) x0) y), @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (le (S O) q)) *)
intros.
(* Goal: le (S x) y *)
(* Goal: @ex nat (fun q : nat => and (@eq nat (Init.Nat.add x q) y) (le (S O) q)) *)
split with (S x0).
(* Goal: le (S x) y *)
(* Goal: and (@eq nat (Init.Nat.add x (S x0)) y) (le (S O) (S x0)) *)
split.
(* Goal: le (S x) y *)
(* Goal: le (S O) (S x0) *)
(* Goal: @eq nat (Init.Nat.add x (S x0)) y *)
rewrite <- plus_n_Sm.
(* Goal: le (S x) y *)
(* Goal: le (S O) (S x0) *)
(* Goal: @eq nat (S (Init.Nat.add x x0)) y *)
assumption.
(* Goal: le (S x) y *)
(* Goal: le (S O) (S x0) *)
apply le_n_S.
(* Goal: le (S x) y *)
(* Goal: le O x0 *)
apply le_O_n.
(* Goal: le (S x) y *)
assumption.
Qed.
Lemma le_le_mult : forall b a c d : nat, a <= b -> c <= d -> a * c <= b * d.
Proof.
(* Goal: forall (b a c d : nat) (_ : le a b) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul b d) *)
simple induction b.
(* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *)
(* Goal: forall (a c d : nat) (_ : le a O) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul O d) *)
intros.
(* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.mul O d) *)
replace a with 0.
(* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *)
(* Goal: @eq nat O a *)
(* Goal: le (Init.Nat.mul O c) (Init.Nat.mul O d) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *)
(* Goal: @eq nat O a *)
(* Goal: le O O *)
apply le_n.
(* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *)
(* Goal: @eq nat O a *)
apply le_n_O_eq.
(* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *)
(* Goal: le a O *)
assumption.
(* Goal: forall (n : nat) (_ : forall (a c d : nat) (_ : le a n) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul n d)) (a c d : nat) (_ : le a (S n)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S n) d) *)
intros b1 IHb1.
(* Goal: forall (a c d : nat) (_ : le a (S b1)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.mul (S b1) d) *)
simpl in |- *.
(* Goal: forall (a c d : nat) (_ : le a (S b1)) (_ : le c d), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
intros.
(* Goal: le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
elim (le_lt_or_eq a (S b1)).
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: forall _ : lt a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
unfold lt in |- *.
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: forall _ : le (S a) (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
intros.
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
rewrite (plus_comm d (b1 * d)).
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le (Init.Nat.mul a c) (Nat.add (Init.Nat.mul b1 d) d) *)
apply le_plus_trans.
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.mul b1 d) *)
apply IHb1.
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le c d *)
(* Goal: le a b1 *)
apply le_S_n.
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le c d *)
(* Goal: le (S a) (S b1) *)
assumption.
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le c d *)
assumption.
(* Goal: le a (S b1) *)
(* Goal: forall _ : @eq nat a (S b1), le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
intro.
(* Goal: le a (S b1) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
rewrite H1.
(* Goal: le a (S b1) *)
(* Goal: le (Init.Nat.mul (S b1) c) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
replace (d + b1 * d) with (S b1 * d).
(* Goal: le a (S b1) *)
(* Goal: @eq nat (Init.Nat.mul (S b1) d) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le (Init.Nat.mul (S b1) c) (Init.Nat.mul (S b1) d) *)
apply le_mult_l.
(* Goal: le a (S b1) *)
(* Goal: @eq nat (Init.Nat.mul (S b1) d) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
(* Goal: le c d *)
assumption.
(* Goal: le a (S b1) *)
(* Goal: @eq nat (Init.Nat.mul (S b1) d) (Init.Nat.add d (Init.Nat.mul b1 d)) *)
reflexivity.
(* Goal: le a (S b1) *)
assumption.
Qed.
Lemma lt_lt_mult : forall a b c d : nat, a < b -> c < d -> a * c < b * d.
Proof.
(* Goal: forall (a b c d : nat) (_ : lt a b) (_ : lt c d), lt (Init.Nat.mul a c) (Init.Nat.mul b d) *)
unfold lt in |- *.
(* Goal: forall (a b c d : nat) (_ : le (S a) b) (_ : le (S c) d), le (S (Init.Nat.mul a c)) (Init.Nat.mul b d) *)
intros.
(* Goal: le (S (Init.Nat.mul a c)) (Init.Nat.mul b d) *)
apply le_trans with (S a * S c).
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
(* Goal: le (S (Init.Nat.mul a c)) (Init.Nat.mul (S a) (S c)) *)
simpl in |- *.
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
(* Goal: le (S (Init.Nat.mul a c)) (S (Init.Nat.add c (Init.Nat.mul a (S c)))) *)
apply le_n_S.
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.add c (Init.Nat.mul a (S c))) *)
rewrite <- (mult_n_Sm a c).
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.add c (Init.Nat.add (Init.Nat.mul a c) a)) *)
rewrite (plus_comm c (a * c + a)).
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
(* Goal: le (Init.Nat.mul a c) (Nat.add (Init.Nat.add (Init.Nat.mul a c) a) c) *)
apply le_plus_trans.
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.add (Init.Nat.mul a c) a) *)
apply le_plus_trans.
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *)
apply le_n.
(* Goal: le (Init.Nat.mul (S a) (S c)) (Init.Nat.mul b d) *)
apply le_le_mult.
(* Goal: le (S c) d *)
(* Goal: le (S a) b *)
assumption.
(* Goal: le (S c) d *)
assumption.
Qed.
Lemma lt_n_nm_m_gt_1 : forall a b : nat, a < a * b -> b > 1.
Proof.
(* Goal: forall (a b : nat) (_ : lt a (Init.Nat.mul a b)), gt b (S O) *)
intros a b.
(* Goal: forall _ : lt a (Init.Nat.mul a b), gt b (S O) *)
case b.
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S n))), gt (S n) (S O) *)
(* Goal: forall _ : lt a (Init.Nat.mul a O), gt O (S O) *)
rewrite <- (mult_n_O a).
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S n))), gt (S n) (S O) *)
(* Goal: forall _ : lt a O, gt O (S O) *)
intro.
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S n))), gt (S n) (S O) *)
(* Goal: gt O (S O) *)
elim (lt_n_O a).
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S n))), gt (S n) (S O) *)
(* Goal: lt a O *)
assumption.
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S n))), gt (S n) (S O) *)
intro b1.
(* Goal: forall _ : lt a (Init.Nat.mul a (S b1)), gt (S b1) (S O) *)
case b1.
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *)
(* Goal: forall _ : lt a (Init.Nat.mul a (S O)), gt (S O) (S O) *)
rewrite <- (mult_n_Sm a 0).
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *)
(* Goal: forall _ : lt a (Init.Nat.add (Init.Nat.mul a O) a), gt (S O) (S O) *)
rewrite <- (mult_n_O a).
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *)
(* Goal: forall _ : lt a (Init.Nat.add O a), gt (S O) (S O) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *)
(* Goal: forall _ : lt a a, gt (S O) (S O) *)
intro.
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *)
(* Goal: gt (S O) (S O) *)
elim (lt_irrefl a).
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *)
(* Goal: lt a a *)
assumption.
(* Goal: forall (n : nat) (_ : lt a (Init.Nat.mul a (S (S n)))), gt (S (S n)) (S O) *)
intros.
(* Goal: gt (S (S n)) (S O) *)
apply gt_n_S.
(* Goal: gt (S n) O *)
apply gt_Sn_O.
Qed.
Lemma n0n1_or_gt : forall n : nat, n = 0 \/ n = 1 \/ n > 1.
Proof.
(* Goal: forall n : nat, or (@eq nat n O) (or (@eq nat n (S O)) (gt n (S O))) *)
intro n.
(* Goal: or (@eq nat n O) (or (@eq nat n (S O)) (gt n (S O))) *)
case n.
(* Goal: forall n : nat, or (@eq nat (S n) O) (or (@eq nat (S n) (S O)) (gt (S n) (S O))) *)
(* Goal: or (@eq nat O O) (or (@eq nat O (S O)) (gt O (S O))) *)
left.
(* Goal: forall n : nat, or (@eq nat (S n) O) (or (@eq nat (S n) (S O)) (gt (S n) (S O))) *)
(* Goal: @eq nat O O *)
reflexivity.
(* Goal: forall n : nat, or (@eq nat (S n) O) (or (@eq nat (S n) (S O)) (gt (S n) (S O))) *)
intro n1.
(* Goal: or (@eq nat (S n1) O) (or (@eq nat (S n1) (S O)) (gt (S n1) (S O))) *)
case n1.
(* Goal: forall n : nat, or (@eq nat (S (S n)) O) (or (@eq nat (S (S n)) (S O)) (gt (S (S n)) (S O))) *)
(* Goal: or (@eq nat (S O) O) (or (@eq nat (S O) (S O)) (gt (S O) (S O))) *)
right.
(* Goal: forall n : nat, or (@eq nat (S (S n)) O) (or (@eq nat (S (S n)) (S O)) (gt (S (S n)) (S O))) *)
(* Goal: or (@eq nat (S O) (S O)) (gt (S O) (S O)) *)
left.
(* Goal: forall n : nat, or (@eq nat (S (S n)) O) (or (@eq nat (S (S n)) (S O)) (gt (S (S n)) (S O))) *)
(* Goal: @eq nat (S O) (S O) *)
reflexivity.
(* Goal: forall n : nat, or (@eq nat (S (S n)) O) (or (@eq nat (S (S n)) (S O)) (gt (S (S n)) (S O))) *)
intro n2.
(* Goal: or (@eq nat (S (S n2)) O) (or (@eq nat (S (S n2)) (S O)) (gt (S (S n2)) (S O))) *)
right.
(* Goal: or (@eq nat (S (S n2)) (S O)) (gt (S (S n2)) (S O)) *)
right.
(* Goal: gt (S (S n2)) (S O) *)
apply gt_n_S.
(* Goal: gt (S n2) O *)
apply gt_Sn_O.
Qed.
Lemma lt_multpred_pp : forall p : nat, p > 1 -> pred p * pred p < p * p.
Proof.
(* Goal: forall (p : nat) (_ : gt p (S O)), lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *)
intro.
(* Goal: forall _ : gt p (S O), lt (Init.Nat.mul (Init.Nat.pred p) (Init.Nat.pred p)) (Init.Nat.mul p p) *)
case p.
(* Goal: forall (n : nat) (_ : gt (S n) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S n)) (Init.Nat.pred (S n))) (Init.Nat.mul (S n) (S n)) *)
(* Goal: forall _ : gt O (S O), lt (Init.Nat.mul (Init.Nat.pred O) (Init.Nat.pred O)) (Init.Nat.mul O O) *)
intro.
(* Goal: forall (n : nat) (_ : gt (S n) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S n)) (Init.Nat.pred (S n))) (Init.Nat.mul (S n) (S n)) *)
(* Goal: lt (Init.Nat.mul (Init.Nat.pred O) (Init.Nat.pred O)) (Init.Nat.mul O O) *)
elim (lt_n_O 1).
(* Goal: forall (n : nat) (_ : gt (S n) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S n)) (Init.Nat.pred (S n))) (Init.Nat.mul (S n) (S n)) *)
(* Goal: lt (S O) O *)
assumption.
(* Goal: forall (n : nat) (_ : gt (S n) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S n)) (Init.Nat.pred (S n))) (Init.Nat.mul (S n) (S n)) *)
intro p1.
(* Goal: forall _ : gt (S p1) (S O), lt (Init.Nat.mul (Init.Nat.pred (S p1)) (Init.Nat.pred (S p1))) (Init.Nat.mul (S p1) (S p1)) *)
case p1.
(* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S (S n))) (Init.Nat.pred (S (S n)))) (Init.Nat.mul (S (S n)) (S (S n))) *)
(* Goal: forall _ : gt (S O) (S O), lt (Init.Nat.mul (Init.Nat.pred (S O)) (Init.Nat.pred (S O))) (Init.Nat.mul (S O) (S O)) *)
intro.
(* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S (S n))) (Init.Nat.pred (S (S n)))) (Init.Nat.mul (S (S n)) (S (S n))) *)
(* Goal: lt (Init.Nat.mul (Init.Nat.pred (S O)) (Init.Nat.pred (S O))) (Init.Nat.mul (S O) (S O)) *)
elim (lt_irrefl 1).
(* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S (S n))) (Init.Nat.pred (S (S n)))) (Init.Nat.mul (S (S n)) (S (S n))) *)
(* Goal: lt (S O) (S O) *)
assumption.
(* Goal: forall (n : nat) (_ : gt (S (S n)) (S O)), lt (Init.Nat.mul (Init.Nat.pred (S (S n))) (Init.Nat.pred (S (S n)))) (Init.Nat.mul (S (S n)) (S (S n))) *)
intro p2.
(* Goal: forall _ : gt (S (S p2)) (S O), lt (Init.Nat.mul (Init.Nat.pred (S (S p2))) (Init.Nat.pred (S (S p2)))) (Init.Nat.mul (S (S p2)) (S (S p2))) *)
intros.
(* Goal: lt (Init.Nat.mul (Init.Nat.pred (S (S p2))) (Init.Nat.pred (S (S p2)))) (Init.Nat.mul (S (S p2)) (S (S p2))) *)
apply lt_lt_mult.
(* Goal: lt (Init.Nat.pred (S (S p2))) (S (S p2)) *)
(* Goal: lt (Init.Nat.pred (S (S p2))) (S (S p2)) *)
simpl in |- *.
(* Goal: lt (Init.Nat.pred (S (S p2))) (S (S p2)) *)
(* Goal: lt (S p2) (S (S p2)) *)
apply lt_n_Sn.
(* Goal: lt (Init.Nat.pred (S (S p2))) (S (S p2)) *)
simpl in |- *.
(* Goal: lt (S p2) (S (S p2)) *)
apply lt_n_Sn.
Qed.
Lemma le_diff0 : forall b a c : nat, a <= b -> a = b + c -> c = 0.
Proof.
(* Goal: forall (b a c : nat) (_ : le a b) (_ : @eq nat a (Init.Nat.add b c)), @eq nat c O *)
simple induction b.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: forall (a c : nat) (_ : le a O) (_ : @eq nat a (Init.Nat.add O c)), @eq nat c O *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: forall (a c : nat) (_ : le a O) (_ : @eq nat a c), @eq nat c O *)
intro.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: forall (c : nat) (_ : le a O) (_ : @eq nat a c), @eq nat c O *)
case a.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: forall (n c : nat) (_ : le (S n) O) (_ : @eq nat (S n) c), @eq nat c O *)
(* Goal: forall (c : nat) (_ : le O O) (_ : @eq nat O c), @eq nat c O *)
intros.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: forall (n c : nat) (_ : le (S n) O) (_ : @eq nat (S n) c), @eq nat c O *)
(* Goal: @eq nat c O *)
rewrite H0.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: forall (n c : nat) (_ : le (S n) O) (_ : @eq nat (S n) c), @eq nat c O *)
(* Goal: @eq nat c c *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: forall (n c : nat) (_ : le (S n) O) (_ : @eq nat (S n) c), @eq nat c O *)
intros.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: @eq nat c O *)
elim (lt_n_O n).
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
(* Goal: lt n O *)
assumption.
(* Goal: forall (n : nat) (_ : forall (a c : nat) (_ : le a n) (_ : @eq nat a (Init.Nat.add n c)), @eq nat c O) (a c : nat) (_ : le a (S n)) (_ : @eq nat a (Init.Nat.add (S n) c)), @eq nat c O *)
intros b1 IH.
(* Goal: forall (a c : nat) (_ : le a (S b1)) (_ : @eq nat a (Init.Nat.add (S b1) c)), @eq nat c O *)
simpl in |- *.
(* Goal: forall (a c : nat) (_ : le a (S b1)) (_ : @eq nat a (S (Init.Nat.add b1 c))), @eq nat c O *)
intros.
(* Goal: @eq nat c O *)
rewrite H0 in H.
(* Goal: @eq nat c O *)
apply (IH (b1 + c) c).
(* Goal: @eq nat (Init.Nat.add b1 c) (Init.Nat.add b1 c) *)
(* Goal: le (Init.Nat.add b1 c) b1 *)
apply le_S_n.
(* Goal: @eq nat (Init.Nat.add b1 c) (Init.Nat.add b1 c) *)
(* Goal: le (S (Init.Nat.add b1 c)) (S b1) *)
assumption.
(* Goal: @eq nat (Init.Nat.add b1 c) (Init.Nat.add b1 c) *)
reflexivity.
Qed.
Lemma simpl_lt_mult_l : forall a b c : nat, a * b < a * c -> b < c.
Proof.
(* Goal: forall (a b c : nat) (_ : lt (Init.Nat.mul a b) (Init.Nat.mul a c)), lt b c *)
simple induction a.
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt (Init.Nat.mul n b) (Init.Nat.mul n c)), lt b c) (b c : nat) (_ : lt (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), lt b c *)
(* Goal: forall (b c : nat) (_ : lt (Init.Nat.mul O b) (Init.Nat.mul O c)), lt b c *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt (Init.Nat.mul n b) (Init.Nat.mul n c)), lt b c) (b c : nat) (_ : lt (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), lt b c *)
(* Goal: forall (b c : nat) (_ : lt O O), lt b c *)
intros.
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt (Init.Nat.mul n b) (Init.Nat.mul n c)), lt b c) (b c : nat) (_ : lt (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), lt b c *)
(* Goal: lt b c *)
elim (lt_irrefl 0).
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt (Init.Nat.mul n b) (Init.Nat.mul n c)), lt b c) (b c : nat) (_ : lt (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), lt b c *)
(* Goal: lt O O *)
assumption.
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt (Init.Nat.mul n b) (Init.Nat.mul n c)), lt b c) (b c : nat) (_ : lt (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), lt b c *)
intros a1 IH.
(* Goal: forall (b c : nat) (_ : lt (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c)), lt b c *)
intros.
(* Goal: lt b c *)
elim (le_or_lt b c).
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: forall _ : le b c, lt b c *)
intro.
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: lt b c *)
elim (le_lt_or_eq b c).
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: le b c *)
(* Goal: forall _ : @eq nat b c, lt b c *)
(* Goal: forall _ : lt b c, lt b c *)
intro.
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: le b c *)
(* Goal: forall _ : @eq nat b c, lt b c *)
(* Goal: lt b c *)
assumption.
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: le b c *)
(* Goal: forall _ : @eq nat b c, lt b c *)
intros.
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: le b c *)
(* Goal: lt b c *)
rewrite H1 in H.
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: le b c *)
(* Goal: lt b c *)
elim (lt_irrefl (S a1 * c)).
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: le b c *)
(* Goal: lt (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) c) *)
assumption.
(* Goal: forall _ : lt c b, lt b c *)
(* Goal: le b c *)
assumption.
(* Goal: forall _ : lt c b, lt b c *)
intros.
(* Goal: lt b c *)
cut (S a1 * c <= S a1 * b).
(* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
(* Goal: forall _ : le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b), lt b c *)
intros.
(* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
(* Goal: lt b c *)
elim (le_not_lt (S a1 * c) (S a1 * b)).
(* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
(* Goal: lt (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c) *)
(* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
assumption.
(* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
(* Goal: lt (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c) *)
assumption.
(* Goal: le (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
apply lt_le_weak.
(* Goal: lt (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
apply lt_mult_l.
(* Goal: lt c b *)
assumption.
Qed.
Lemma simpl_le_mult_l : forall a b c : nat, 0 < a -> a * b <= a * c -> b <= c.
Proof.
(* Goal: forall (a b c : nat) (_ : lt O a) (_ : le (Init.Nat.mul a b) (Init.Nat.mul a c)), le b c *)
simple induction a.
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt O n) (_ : le (Init.Nat.mul n b) (Init.Nat.mul n c)), le b c) (b c : nat) (_ : lt O (S n)) (_ : le (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), le b c *)
(* Goal: forall (b c : nat) (_ : lt O O) (_ : le (Init.Nat.mul O b) (Init.Nat.mul O c)), le b c *)
intros.
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt O n) (_ : le (Init.Nat.mul n b) (Init.Nat.mul n c)), le b c) (b c : nat) (_ : lt O (S n)) (_ : le (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), le b c *)
(* Goal: le b c *)
elim (lt_n_O 0).
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt O n) (_ : le (Init.Nat.mul n b) (Init.Nat.mul n c)), le b c) (b c : nat) (_ : lt O (S n)) (_ : le (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), le b c *)
(* Goal: lt O O *)
assumption.
(* Goal: forall (n : nat) (_ : forall (b c : nat) (_ : lt O n) (_ : le (Init.Nat.mul n b) (Init.Nat.mul n c)), le b c) (b c : nat) (_ : lt O (S n)) (_ : le (Init.Nat.mul (S n) b) (Init.Nat.mul (S n) c)), le b c *)
intros a1 IH.
(* Goal: forall (b c : nat) (_ : lt O (S a1)) (_ : le (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c)), le b c *)
intros.
(* Goal: le b c *)
simpl in H0.
(* Goal: le b c *)
elim (le_or_lt b c).
(* Goal: forall _ : lt c b, le b c *)
(* Goal: forall _ : le b c, le b c *)
intro.
(* Goal: forall _ : lt c b, le b c *)
(* Goal: le b c *)
assumption.
(* Goal: forall _ : lt c b, le b c *)
intro.
(* Goal: le b c *)
elim (lt_not_le (S a1 * c) (S a1 * b)).
(* Goal: le (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c) *)
(* Goal: lt (Init.Nat.mul (S a1) c) (Init.Nat.mul (S a1) b) *)
apply lt_mult_l.
(* Goal: le (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c) *)
(* Goal: lt c b *)
assumption.
(* Goal: le (Init.Nat.mul (S a1) b) (Init.Nat.mul (S a1) c) *)
assumption.
Qed.
Lemma simpl_eq_mult_l : forall a b c : nat, 0 < a -> a * b = a * c -> b = c.
Proof.
(* Goal: forall (a b c : nat) (_ : lt O a) (_ : @eq nat (Init.Nat.mul a b) (Init.Nat.mul a c)), @eq nat b c *)
intros.
(* Goal: @eq nat b c *)
apply le_antisym.
(* Goal: le c b *)
(* Goal: le b c *)
apply simpl_le_mult_l with a.
(* Goal: le c b *)
(* Goal: le (Init.Nat.mul a b) (Init.Nat.mul a c) *)
(* Goal: lt O a *)
assumption.
(* Goal: le c b *)
(* Goal: le (Init.Nat.mul a b) (Init.Nat.mul a c) *)
rewrite H0.
(* Goal: le c b *)
(* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *)
apply le_n.
(* Goal: le c b *)
apply simpl_le_mult_l with a.
(* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a b) *)
(* Goal: lt O a *)
assumption.
(* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a b) *)
rewrite H0.
(* Goal: le (Init.Nat.mul a c) (Init.Nat.mul a c) *)
apply le_n.
Qed.
Lemma mult_ppq_p0q1 : forall p q : nat, p = p * q -> p = 0 \/ q = 1.
Proof.
(* Goal: forall (p q : nat) (_ : @eq nat p (Init.Nat.mul p q)), or (@eq nat p O) (@eq nat q (S O)) *)
intro p.
(* Goal: forall (q : nat) (_ : @eq nat p (Init.Nat.mul p q)), or (@eq nat p O) (@eq nat q (S O)) *)
case p.
(* Goal: forall (n q : nat) (_ : @eq nat (S n) (Init.Nat.mul (S n) q)), or (@eq nat (S n) O) (@eq nat q (S O)) *)
(* Goal: forall (q : nat) (_ : @eq nat O (Init.Nat.mul O q)), or (@eq nat O O) (@eq nat q (S O)) *)
left.
(* Goal: forall (n q : nat) (_ : @eq nat (S n) (Init.Nat.mul (S n) q)), or (@eq nat (S n) O) (@eq nat q (S O)) *)
(* Goal: @eq nat O O *)
reflexivity.
(* Goal: forall (n q : nat) (_ : @eq nat (S n) (Init.Nat.mul (S n) q)), or (@eq nat (S n) O) (@eq nat q (S O)) *)
intro p1.
(* Goal: forall (q : nat) (_ : @eq nat (S p1) (Init.Nat.mul (S p1) q)), or (@eq nat (S p1) O) (@eq nat q (S O)) *)
right.
(* Goal: @eq nat q (S O) *)
apply simpl_eq_mult_l with (S p1).
(* Goal: @eq nat (Init.Nat.mul (S p1) q) (Init.Nat.mul (S p1) (S O)) *)
(* Goal: lt O (S p1) *)
apply lt_O_Sn.
(* Goal: @eq nat (Init.Nat.mul (S p1) q) (Init.Nat.mul (S p1) (S O)) *)
rewrite <- H.
(* Goal: @eq nat (S p1) (Init.Nat.mul (S p1) (S O)) *)
rewrite <- mult_n_Sm.
(* Goal: @eq nat (S p1) (Init.Nat.add (Init.Nat.mul (S p1) O) (S p1)) *)
rewrite <- mult_n_O.
(* Goal: @eq nat (S p1) (Init.Nat.add O (S p1)) *)
simpl in |- *.
(* Goal: @eq nat (S p1) (S p1) *)
reflexivity.
Qed.
Lemma mult_pq1_p1q1 : forall p q : nat, p * q = 1 -> p = 1 /\ q = 1.
Proof.
(* Goal: forall (p q : nat) (_ : @eq nat (Init.Nat.mul p q) (S O)), and (@eq nat p (S O)) (@eq nat q (S O)) *)
intro p.
(* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.mul p q) (S O)), and (@eq nat p (S O)) (@eq nat q (S O)) *)
case p.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S n) q) (S O)), and (@eq nat (S n) (S O)) (@eq nat q (S O)) *)
(* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.mul O q) (S O)), and (@eq nat O (S O)) (@eq nat q (S O)) *)
simpl in |- *.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S n) q) (S O)), and (@eq nat (S n) (S O)) (@eq nat q (S O)) *)
(* Goal: forall (q : nat) (_ : @eq nat O (S O)), and (@eq nat O (S O)) (@eq nat q (S O)) *)
intros.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S n) q) (S O)), and (@eq nat (S n) (S O)) (@eq nat q (S O)) *)
(* Goal: and (@eq nat O (S O)) (@eq nat q (S O)) *)
discriminate H.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S n) q) (S O)), and (@eq nat (S n) (S O)) (@eq nat q (S O)) *)
intro p1.
(* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.mul (S p1) q) (S O)), and (@eq nat (S p1) (S O)) (@eq nat q (S O)) *)
case p1.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *)
(* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.mul (S O) q) (S O)), and (@eq nat (S O) (S O)) (@eq nat q (S O)) *)
simpl in |- *.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *)
(* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.add q O) (S O)), and (@eq nat (S O) (S O)) (@eq nat q (S O)) *)
intro q.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *)
(* Goal: forall _ : @eq nat (Init.Nat.add q O) (S O), and (@eq nat (S O) (S O)) (@eq nat q (S O)) *)
rewrite <- plus_n_O.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *)
(* Goal: forall _ : @eq nat q (S O), and (@eq nat (S O) (S O)) (@eq nat q (S O)) *)
split.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *)
(* Goal: @eq nat q (S O) *)
(* Goal: @eq nat (S O) (S O) *)
reflexivity.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *)
(* Goal: @eq nat q (S O) *)
assumption.
(* Goal: forall (n q : nat) (_ : @eq nat (Init.Nat.mul (S (S n)) q) (S O)), and (@eq nat (S (S n)) (S O)) (@eq nat q (S O)) *)
intro p2.
(* Goal: forall (q : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) q) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat q (S O)) *)
intro q.
(* Goal: forall _ : @eq nat (Init.Nat.mul (S (S p2)) q) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat q (S O)) *)
case q.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S n)) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S n) (S O)) *)
(* Goal: forall _ : @eq nat (Init.Nat.mul (S (S p2)) O) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat O (S O)) *)
rewrite <- mult_n_O.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S n)) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S n) (S O)) *)
(* Goal: forall _ : @eq nat O (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat O (S O)) *)
intro.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S n)) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S n) (S O)) *)
(* Goal: and (@eq nat (S (S p2)) (S O)) (@eq nat O (S O)) *)
discriminate H.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S n)) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S n) (S O)) *)
intro q1.
(* Goal: forall _ : @eq nat (Init.Nat.mul (S (S p2)) (S q1)) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S q1) (S O)) *)
case q1.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *)
(* Goal: forall _ : @eq nat (Init.Nat.mul (S (S p2)) (S O)) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *)
rewrite <- mult_n_Sm.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *)
(* Goal: forall _ : @eq nat (Init.Nat.add (Init.Nat.mul (S (S p2)) O) (S (S p2))) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *)
rewrite <- mult_n_O.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *)
(* Goal: forall _ : @eq nat (Init.Nat.add O (S (S p2))) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *)
(* Goal: forall _ : @eq nat (S (S p2)) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *)
intro.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *)
(* Goal: and (@eq nat (S (S p2)) (S O)) (@eq nat (S O) (S O)) *)
discriminate H.
(* Goal: forall (n : nat) (_ : @eq nat (Init.Nat.mul (S (S p2)) (S (S n))) (S O)), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S n)) (S O)) *)
intro q2.
(* Goal: forall _ : @eq nat (Init.Nat.mul (S (S p2)) (S (S q2))) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S q2)) (S O)) *)
simpl in |- *.
(* Goal: forall _ : @eq nat (S (S (Init.Nat.add q2 (S (S (Init.Nat.add q2 (Init.Nat.mul p2 (S (S q2))))))))) (S O), and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S q2)) (S O)) *)
intro.
(* Goal: and (@eq nat (S (S p2)) (S O)) (@eq nat (S (S q2)) (S O)) *)
discriminate H.
Qed.
Lemma Zmult_ab0a0b0 : forall a b : Z, (a * b)%Z = 0%Z -> a = 0%Z \/ b = 0%Z.
Proof.
(* Goal: forall (a b : Z) (_ : @eq Z (Z.mul a b) Z0), or (@eq Z a Z0) (@eq Z b Z0) *)
simple induction a.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zpos p) b) Z0), or (@eq Z (Zpos p) Z0) (@eq Z b Z0) *)
(* Goal: forall (b : Z) (_ : @eq Z (Z.mul Z0 b) Z0), or (@eq Z Z0 Z0) (@eq Z b Z0) *)
simpl in |- *.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zpos p) b) Z0), or (@eq Z (Zpos p) Z0) (@eq Z b Z0) *)
(* Goal: forall (b : Z) (_ : @eq Z Z0 Z0), or (@eq Z Z0 Z0) (@eq Z b Z0) *)
left.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zpos p) b) Z0), or (@eq Z (Zpos p) Z0) (@eq Z b Z0) *)
(* Goal: @eq Z Z0 Z0 *)
reflexivity.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zpos p) b) Z0), or (@eq Z (Zpos p) Z0) (@eq Z b Z0) *)
intro p.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (b : Z) (_ : @eq Z (Z.mul (Zpos p) b) Z0), or (@eq Z (Zpos p) Z0) (@eq Z b Z0) *)
simple induction b.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zneg p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zpos p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zpos p0) Z0) *)
(* Goal: forall _ : @eq Z (Z.mul (Zpos p) Z0) Z0, or (@eq Z (Zpos p) Z0) (@eq Z Z0 Z0) *)
simpl in |- *.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zneg p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zpos p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zpos p0) Z0) *)
(* Goal: forall _ : @eq Z Z0 Z0, or (@eq Z (Zpos p) Z0) (@eq Z Z0 Z0) *)
right.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zneg p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zpos p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zpos p0) Z0) *)
(* Goal: @eq Z Z0 Z0 *)
reflexivity.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zneg p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zpos p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zpos p0) Z0) *)
simpl in |- *.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zneg p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Zpos (Pos.mul p p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zpos p0) Z0) *)
intros.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zneg p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: or (@eq Z (Zpos p) Z0) (@eq Z (Zpos p0) Z0) *)
discriminate H.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zpos p) (Zneg p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
simpl in |- *.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Zneg (Pos.mul p p0)) Z0), or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
intros.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
(* Goal: or (@eq Z (Zpos p) Z0) (@eq Z (Zneg p0) Z0) *)
discriminate H.
(* Goal: forall (p : positive) (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
intro.
(* Goal: forall (b : Z) (_ : @eq Z (Z.mul (Zneg p) b) Z0), or (@eq Z (Zneg p) Z0) (@eq Z b Z0) *)
simple induction b.
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zpos p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *)
(* Goal: forall _ : @eq Z (Z.mul (Zneg p) Z0) Z0, or (@eq Z (Zneg p) Z0) (@eq Z Z0 Z0) *)
simpl in |- *.
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zpos p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *)
(* Goal: forall _ : @eq Z Z0 Z0, or (@eq Z (Zneg p) Z0) (@eq Z Z0 Z0) *)
right.
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zpos p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *)
(* Goal: @eq Z Z0 Z0 *)
reflexivity.
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zpos p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *)
simpl in |- *.
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: forall (p0 : positive) (_ : @eq Z (Zneg (Pos.mul p p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *)
intros.
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
(* Goal: or (@eq Z (Zneg p) Z0) (@eq Z (Zpos p0) Z0) *)
discriminate H.
(* Goal: forall (p0 : positive) (_ : @eq Z (Z.mul (Zneg p) (Zneg p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
simpl in |- *.
(* Goal: forall (p0 : positive) (_ : @eq Z (Zpos (Pos.mul p p0)) Z0), or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
intros.
(* Goal: or (@eq Z (Zneg p) Z0) (@eq Z (Zneg p0) Z0) *)
discriminate H.
Qed.
Lemma Zle_minus : forall a b : Z, (b <= a)%Z -> (0 <= a - b)%Z.
Proof.
(* Goal: forall (a b : Z) (_ : Z.le b a), Z.le Z0 (Z.sub a b) *)
intros a b.
(* Goal: forall _ : Z.le b a, Z.le Z0 (Z.sub a b) *)
intros.
(* Goal: Z.le Z0 (Z.sub a b) *)
apply Zplus_le_reg_l with b.
(* Goal: Z.le (Z.add b Z0) (Z.add b (Z.sub a b)) *)
unfold Zminus in |- *.
(* Goal: Z.le (Z.add b Z0) (Z.add b (Z.add a (Z.opp b))) *)
rewrite (Zplus_comm a).
(* Goal: Z.le (Z.add b Z0) (Z.add b (Z.add (Z.opp b) a)) *)
rewrite (Zplus_assoc b (- b)).
(* Goal: Z.le (Z.add b Z0) (Z.add (Z.add b (Z.opp b)) a) *)
rewrite Zplus_opp_r.
(* Goal: Z.le (Z.add b Z0) (Z.add Z0 a) *)
simpl in |- *.
(* Goal: Z.le (Z.add b Z0) a *)
rewrite <- Zplus_0_r_reverse.
(* Goal: Z.le b a *)
assumption.
Qed.
Lemma Zopp_lt_gt_0 : forall x : Z, (x < 0)%Z -> (- x > 0)%Z.
Proof.
(* Goal: forall (x : Z) (_ : Z.lt x Z0), Z.gt (Z.opp x) Z0 *)
simple induction x.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: forall (p : positive) (_ : Z.lt (Zpos p) Z0), Z.gt (Z.opp (Zpos p)) Z0 *)
(* Goal: forall _ : Z.lt Z0 Z0, Z.gt (Z.opp Z0) Z0 *)
intro.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: forall (p : positive) (_ : Z.lt (Zpos p) Z0), Z.gt (Z.opp (Zpos p)) Z0 *)
(* Goal: Z.gt (Z.opp Z0) Z0 *)
unfold Zlt in H.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: forall (p : positive) (_ : Z.lt (Zpos p) Z0), Z.gt (Z.opp (Zpos p)) Z0 *)
(* Goal: Z.gt (Z.opp Z0) Z0 *)
simpl in H.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: forall (p : positive) (_ : Z.lt (Zpos p) Z0), Z.gt (Z.opp (Zpos p)) Z0 *)
(* Goal: Z.gt (Z.opp Z0) Z0 *)
discriminate H.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: forall (p : positive) (_ : Z.lt (Zpos p) Z0), Z.gt (Z.opp (Zpos p)) Z0 *)
intros.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: Z.gt (Z.opp (Zpos p)) Z0 *)
unfold Zlt in H.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: Z.gt (Z.opp (Zpos p)) Z0 *)
simpl in H.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
(* Goal: Z.gt (Z.opp (Zpos p)) Z0 *)
discriminate H.
(* Goal: forall (p : positive) (_ : Z.lt (Zneg p) Z0), Z.gt (Z.opp (Zneg p)) Z0 *)
intros.
(* Goal: Z.gt (Z.opp (Zneg p)) Z0 *)
simpl in |- *.
(* Goal: Z.gt (Zpos p) Z0 *)
unfold Zgt in |- *.
(* Goal: @eq comparison (Z.compare (Zpos p) Z0) Gt *)
simpl in |- *.
(* Goal: @eq comparison Gt Gt *)
reflexivity.
Qed.
Lemma Zlt_neq : forall x y : Z, (x < y)%Z -> x <> y.
Proof.
(* Goal: forall (x y : Z) (_ : Z.lt x y), not (@eq Z x y) *)
intros.
(* Goal: not (@eq Z x y) *)
intro.
(* Goal: False *)
rewrite H0 in H.
(* Goal: False *)
elim (Zlt_irrefl y).
(* Goal: Z.lt y y *)
assumption.
Qed.
Lemma Zgt_neq : forall x y : Z, (x > y)%Z -> x <> y.
Proof.
(* Goal: forall (x y : Z) (_ : Z.gt x y), not (@eq Z x y) *)
intros.
(* Goal: not (@eq Z x y) *)
intro.
(* Goal: False *)
rewrite H0 in H.
(* Goal: False *)
elim (Zlt_irrefl y).
(* Goal: Z.lt y y *)
apply Zgt_lt.
(* Goal: Z.gt y y *)
assumption.
Qed.
Lemma S_inj : forall n m : nat, S n = S m -> n = m.
Proof.
(* Goal: forall (n m : nat) (_ : @eq nat (S n) (S m)), @eq nat n m *)
intros n m H; injection H; trivial.
Qed.
Lemma Zlt_mult_l :
forall p q r : Z, (0 < r)%Z -> (p < q)%Z -> (r * p < r * q)%Z.
Proof.
(* Goal: forall (p q r : Z) (_ : Z.lt Z0 r) (_ : Z.lt p q), Z.lt (Z.mul r p) (Z.mul r q) *)
simple induction r.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
(* Goal: forall (_ : Z.lt Z0 Z0) (_ : Z.lt p q), Z.lt (Z.mul Z0 p) (Z.mul Z0 q) *)
intros.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
(* Goal: Z.lt (Z.mul Z0 p) (Z.mul Z0 q) *)
elim (Zlt_irrefl 0).
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
(* Goal: Z.lt Z0 Z0 *)
assumption.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
intros.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: Z.lt (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
unfold Zlt in |- *.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: @eq comparison (Z.compare (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q)) Lt *)
rewrite (Zcompare_mult_compat p0 p q).
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: @eq comparison (Z.compare p q) Lt *)
assumption.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.lt p q), Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
intros.
(* Goal: Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
unfold Zlt in H.
(* Goal: Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
simpl in H.
(* Goal: Z.lt (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
discriminate H.
Qed.
Lemma Zle_mult_l :
forall p q r : Z, (0 < r)%Z -> (p <= q)%Z -> (r * p <= r * q)%Z.
Proof.
(* Goal: forall (p q r : Z) (_ : Z.lt Z0 r) (_ : Z.le p q), Z.le (Z.mul r p) (Z.mul r q) *)
simple induction r.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
(* Goal: forall (_ : Z.lt Z0 Z0) (_ : Z.le p q), Z.le (Z.mul Z0 p) (Z.mul Z0 q) *)
intros.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
(* Goal: Z.le (Z.mul Z0 p) (Z.mul Z0 q) *)
simpl in |- *.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
(* Goal: Z.le Z0 Z0 *)
apply Zeq_le.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
(* Goal: @eq Z Z0 Z0 *)
reflexivity.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zpos p0)) (_ : Z.le p q), Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
intros.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: Z.le (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q) *)
unfold Zle in |- *.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: not (@eq comparison (Z.compare (Z.mul (Zpos p0) p) (Z.mul (Zpos p0) q)) Gt) *)
rewrite (Zcompare_mult_compat p0 p q).
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
(* Goal: not (@eq comparison (Z.compare p q) Gt) *)
assumption.
(* Goal: forall (p0 : positive) (_ : Z.lt Z0 (Zneg p0)) (_ : Z.le p q), Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
intros.
(* Goal: Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
unfold Zlt in H.
(* Goal: Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
simpl in H.
(* Goal: Z.le (Z.mul (Zneg p0) p) (Z.mul (Zneg p0) q) *)
discriminate H.
Qed.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearright.
Require Export GeoCoq.Elements.OriginalProofs.lemma_rightreverse.
Require Export GeoCoq.Elements.OriginalProofs.lemma_altitudebisectsbase.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_droppedperpendicularunique :
forall A J M P,
Per A M P -> Per A J P -> Col A M J ->
eq M J.
Proof.
(* Goal: forall (A J M P : @Point Ax0) (_ : @Per Ax0 A M P) (_ : @Per Ax0 A J P) (_ : @Col Ax0 A M J), @eq Ax0 M J *)
intros.
(* Goal: @eq Ax0 M J *)
assert (~ neq M J).
(* Goal: @eq Ax0 M J *)
(* Goal: not (@neq Ax0 M J) *)
{
(* Goal: not (@neq Ax0 M J) *)
intro.
(* Goal: False *)
assert (neq J M) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists E, (BetS M J E /\ Cong J E M J)) by (conclude lemma_extension);destruct Tf as [E];spliter.
(* Goal: False *)
assert (neq M E) by (forward_using lemma_betweennotequal).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists F, (BetS J M F /\ Cong M F M E)) by (conclude lemma_extension);destruct Tf as [F];spliter.
(* Goal: False *)
assert (BetS E J M) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (BetS E J F) by (conclude lemma_3_7b).
(* Goal: False *)
assert (BetS F J E) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (BetS E M F) by (conclude lemma_3_7a).
(* Goal: False *)
assert (neq J F) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq F J) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col J M F) by (conclude_def Col ).
(* Goal: False *)
assert (Col M J F) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col M J A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq J M) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq M J) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col J F A) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A J F) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Per F J P) by (conclude lemma_collinearright).
(* Goal: False *)
assert (Col J M F) by (conclude_def Col ).
(* Goal: False *)
assert (Col J M A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col M F A) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A M F) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq M F) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq F M) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Per F M P) by (conclude lemma_collinearright).
(* Goal: False *)
assert (Cong F M M E) by (forward_using lemma_congruenceflip).
(* Goal: False *)
assert (Per F M P) by (conclude lemma_collinearright).
(* Goal: False *)
assert (BetS F M E) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (Cong F P E P) by (conclude lemma_rightreverse).
(* Goal: False *)
assert (Midpoint F J E) by (conclude lemma_altitudebisectsbase).
(* Goal: False *)
assert (BetS F M E) by (conclude axiom_betweennesssymmetry).
(* Goal: False *)
assert (Cong F M M E) by (forward_using lemma_congruenceflip).
(* Goal: False *)
assert (Midpoint F M E) by (conclude_def Midpoint ).
(* Goal: False *)
assert (eq J M) by (conclude lemma_midpointunique).
(* Goal: False *)
contradict.
(* BG Goal: @eq Ax0 M J *)
}
(* Goal: @eq Ax0 M J *)
close.
Qed.
End Euclid.
|
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 extremal.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Local Open Scope ring_scope.
Import GroupScope GRing.Theory.
Reserved Notation "p ^{1+2}" (at level 2, format "p ^{1+2}").
Reserved Notation "p ^{1+2* n }"
(at level 2, n at level 2, format "p ^{1+2* n }").
Reserved Notation "''D^' n" (at level 8, n at level 2, format "''D^' n").
Reserved Notation "''D^' n * 'Q'"
(at level 8, n at level 2, format "''D^' n * 'Q'").
Module Pextraspecial.
Section Construction.
Variable p : nat.
Definition act ij (k : 'Z_p) := let: (i, j) := ij in (i + k * j, j).
Lemma actP : is_action [set: 'Z_p] act.
Proof.
(* Goal: @is_action (Zp_finGroupType (S (Zp_trunc p))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (prod (GRing.Zmodule.sort (GRing.Ring.zmodType (Zp_ringType (Zp_trunc p)))) (GRing.Ring.sort (Zp_ringType (Zp_trunc p)))) act *)
apply: is_total_action=> [] [i j] => [|k1 k2] /=; first by rewrite mul0r addr0.
(* Goal: @eq (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))) (@pair (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))) (@GRing.add (GRing.Ring.zmodType (Zp_ringType (Zp_trunc p))) i (@GRing.mul (Zp_ringType (Zp_trunc p)) (@mulg (Zp_baseFinGroupType (S (Zp_trunc p))) k1 k2) j)) j) (@pair (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))) (@GRing.add (GRing.Ring.zmodType (Zp_ringType (Zp_trunc p))) (@GRing.add (GRing.Ring.zmodType (Zp_ringType (Zp_trunc p))) i (@GRing.mul (Zp_ringType (Zp_trunc p)) k1 j)) (@GRing.mul (Zp_ringType (Zp_trunc p)) k2 j)) j) *)
by rewrite mulrDl addrA.
Qed.
Canonical action := Action actP.
Lemma gactP : is_groupAction [set: 'Z_p * 'Z_p] action.
Proof.
(* Goal: @is_groupAction (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setTfor (prod_finType (ordinal_finType (S (S (Zp_trunc p)))) (ordinal_finType (S (S (Zp_trunc p))))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) action *)
move=> k _ /=; rewrite inE.
(* Goal: is_true (andb (@perm_on (FinGroup.arg_finType (FinGroup.base (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))))) (@setTfor (prod_finType (ordinal_finType (S (S (Zp_trunc p)))) (ordinal_finType (S (S (Zp_trunc p))))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (@actperm (Zp_finGroupType (S (Zp_trunc p))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) action k)) (@morphic (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setTfor (prod_finType (ordinal_finType (S (S (Zp_trunc p)))) (ordinal_finType (S (S (Zp_trunc p))))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))))) (@actperm (Zp_finGroupType (S (Zp_trunc p))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) action k)))) *)
apply/andP; split; first by apply/subsetP=> ij _; rewrite inE.
(* Goal: is_true (@morphic (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setTfor (prod_finType (ordinal_finType (S (S (Zp_trunc p)))) (ordinal_finType (S (S (Zp_trunc p))))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))))) (@actperm (Zp_finGroupType (S (Zp_trunc p))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) action k))) *)
apply/morphicP=> /= [[i1 j1] [i2 j2] _ _].
(* Goal: @eq (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))) (@PermDef.fun_of_perm (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) (@actperm (Zp_finGroupType (S (Zp_trunc p))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) action k) (@mulg (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@pair (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))) i1 j1) (@pair (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))) i2 j2))) (@mulg (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@PermDef.fun_of_perm (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) (@actperm (Zp_finGroupType (S (Zp_trunc p))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) action k) (@pair (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))) i1 j1)) (@PermDef.fun_of_perm (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) (@actperm (Zp_finGroupType (S (Zp_trunc p))) (@setTfor (ordinal_finType (S (S (Zp_trunc p)))) (Phant (ordinal (S (S (Zp_trunc p)))))) (FinGroup.arg_finType (extprod_baseFinGroupType (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p))))) action k) (@pair (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))) i2 j2))) *)
by rewrite !permE /= mulrDr -addrA (addrCA i2) (addrA i1).
Qed.
Definition groupAction := GroupAction gactP.
Definition gtype := locked_with gtype_key (sdprod_groupType groupAction).
Definition ngtype := ncprod [set: gtype].
End Construction.
Definition ngtypeQ n := xcprod [set: ngtype 2 n] 'Q_8.
End Pextraspecial.
Notation "p ^{1+2}" := (Pextraspecial.gtype p) : type_scope.
Notation "p ^{1+2}" := [set: gsort p^{1+2}] : group_scope.
Notation "p ^{1+2}" := [set: gsort p^{1+2}]%G : Group_scope.
Notation "p ^{1+2* n }" := (Pextraspecial.ngtype p n) : type_scope.
Notation "p ^{1+2* n }" := [set: gsort p^{1+2*n}] : group_scope.
Notation "p ^{1+2* n }" := [set: gsort p^{1+2*n}]%G : Group_scope.
Notation "''D^' n" := (Pextraspecial.ngtype 2 n) : type_scope.
Notation "''D^' n" := [set: gsort 'D^n] : group_scope.
Notation "''D^' n" := [set: gsort 'D^n]%G : Group_scope.
Notation "''D^' n * 'Q'" := (Pextraspecial.ngtypeQ n) : type_scope.
Notation "''D^' n * 'Q'" := [set: gsort 'D^n*Q] : group_scope.
Notation "''D^' n * 'Q'" := [set: gsort 'D^n*Q]%G : Group_scope.
Section ExponentPextraspecialTheory.
Variable p : nat.
Hypothesis p_pr : prime p.
Let p_gt1 := prime_gt1 p_pr.
Let p_gt0 := ltnW p_gt1.
Local Notation gtype := Pextraspecial.gtype.
Local Notation actp := (Pextraspecial.groupAction p).
Lemma card_pX1p2 : #|p^{1+2}| = (p ^ 3)%N.
Proof.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))))) (expn p (S (S (S O)))) *)
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))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)))) (@morphim (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)) (@gval (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))))))) (@sdpair1_morphism (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)) (@MorPhantom (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)) (@sdpair1 (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p))) (@gval (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p)))))))))))) (@card (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)))) (@morphim (Zp_finGroupType (S (Zp_trunc p))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p))))))) (@sdpair2_morphism (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)) (@MorPhantom (Zp_finGroupType (S (Zp_trunc p))) (@sdprod_groupType (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p)) (@sdpair2 (Zp_finGroupType (S (Zp_trunc p))) (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))) (@setT_group (prod_group (Zp_finGroupType (S (Zp_trunc p))) (Zp_finGroupType (S (Zp_trunc p)))) (Phant (prod (ordinal (S (S (Zp_trunc p)))) (ordinal (S (S (Zp_trunc p))))))) (Pextraspecial.groupAction p))) (@gval (Zp_finGroupType (S (Zp_trunc p))) (@setT_group (Zp_finGroupType (S (Zp_trunc p))) (Phant (ordinal (S (S (Zp_trunc p)))))))))))) (expn p (S (S (S O)))) *)
rewrite !card_injm ?injm_sdpair1 ?injm_sdpair2 // !cardsT card_prod card_ord.
(* Goal: @eq nat (muln (muln (S (S (Zp_trunc p))) (S (S (Zp_trunc p)))) (S (S (Zp_trunc p)))) (expn p (S (S (S O)))) *)
by rewrite -mulnA Zp_cast.
Qed.
Lemma Grp_pX1p2 :
p^{1+2} \isog Grp (x : y : (x ^+ p, y ^+ p, [~ x, y, x], [~ x, y, y])).
Lemma pX1p2_pgroup : p.-group p^{1+2}.
Proof.
(* Goal: is_true (@pgroup (Pextraspecial.gtype p) (nat_pred_of_nat p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) *)
by rewrite /pgroup card_pX1p2 pnat_exp pnat_id.
Qed.
Lemma pX1p2_extraspecial : extraspecial p^{1+2}.
Lemma exponent_pX1p2 : odd p -> exponent p^{1+2} %| p.
Proof.
(* Goal: forall _ : is_true (odd p), is_true (dvdn (@exponent (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) p) *)
move=> p_odd; have pG := pX1p2_pgroup.
(* Goal: is_true (dvdn (@exponent (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) p) *)
have ->: p^{1+2} = 'Ohm_1(p^{1+2}).
(* Goal: is_true (dvdn (@exponent (Pextraspecial.gtype p) (@Ohm (S O) (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))) p) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@Ohm (S O) (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) *)
apply/eqP; rewrite eqEsubset Ohm_sub andbT (OhmE 1 pG).
(* Goal: is_true (dvdn (@exponent (Pextraspecial.gtype p) (@Ohm (S O) (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))) p) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@generated (Pextraspecial.gtype p) (@setI (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) (Ldiv (Pextraspecial.gtype p) (expn p (S O)))))))) *)
case/existsP: (isoGrp_hom Grp_pX1p2) => [[x y]] /=.
(* Goal: is_true (dvdn (@exponent (Pextraspecial.gtype p) (@Ohm (S O) (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))) p) *)
(* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (prod_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (prod_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (prod_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) (@joing (Pextraspecial.gtype p) (@cycle (Pextraspecial.gtype p) x) (@cycle (Pextraspecial.gtype p) y)) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@expgn (FinGroup.base (Pextraspecial.gtype p)) x p) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))) (@expgn (FinGroup.base (Pextraspecial.gtype p)) y p) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (@commg (Pextraspecial.gtype p) (@commg (Pextraspecial.gtype p) x y) x) (@commg (Pextraspecial.gtype p) (@commg (Pextraspecial.gtype p) x y) y))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (oneg (FinGroup.base (Pextraspecial.gtype p))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))) (oneg (FinGroup.base (Pextraspecial.gtype p))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (oneg (FinGroup.base (Pextraspecial.gtype p))) (oneg (FinGroup.base (Pextraspecial.gtype p)))))))), is_true (@subset (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@generated (Pextraspecial.gtype p) (@setI (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (Ldiv (Pextraspecial.gtype p) (expn p (S O)))))))) *)
case/eqP=> <- xp yp _ _; rewrite joing_idl joing_idr genS //.
(* Goal: is_true (dvdn (@exponent (Pextraspecial.gtype p) (@Ohm (S O) (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))) p) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@setU (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@set1 (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) x) (@set1 (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) y)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@setI (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@joing (Pextraspecial.gtype p) (@set1 (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) x) (@set1 (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) y)) (Ldiv (Pextraspecial.gtype p) (expn p (S O))))))) *)
by rewrite subsetI subset_gen subUset !sub1set !inE xp yp!eqxx.
(* Goal: is_true (dvdn (@exponent (Pextraspecial.gtype p) (@Ohm (S O) (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))) p) *)
rewrite exponent_Ohm1_class2 ?card_pX1p2 ?odd_exp // nil_class2.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@derived_at (S O) (Pextraspecial.gtype p) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@center (Pextraspecial.gtype p) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))))))) *)
by have [[_ ->] _ ] := pX1p2_extraspecial.
Qed.
Lemma isog_pX1p2 (gT : finGroupType) (G : {group gT}) :
extraspecial G -> exponent G %| p -> #|G| = (p ^ 3)%N -> G \isog p^{1+2}.
End ExponentPextraspecialTheory.
Section GeneralExponentPextraspecialTheory.
Variable p : nat.
Lemma pX1p2id : p^{1+2*1} \isog p^{1+2}.
Proof.
(* Goal: is_true (@isog (Pextraspecial.ngtype p (S O)) (Pextraspecial.gtype p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p (S O)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p (S O)))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) *)
exact: ncprod1.
Qed.
Lemma pX1p2S n : xcprod_spec p^{1+2} p^{1+2*n} p^{1+2*n.+1}%type.
Proof.
(* Goal: @xcprod_spec (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) (Pextraspecial.ngtype p (S n)) *)
exact: ncprodS.
Qed.
Lemma card_pX1p2n n : prime p -> #|p^{1+2*n}| = (p ^ n.*2.+1)%N.
Proof.
(* Goal: forall _ : is_true (prime p), @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n)))))))) (expn p (S (double n))) *)
move=> p_pr; have pG := pX1p2_pgroup p_pr.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n)))))))) (expn p (S (double n))) *)
have oG := card_pX1p2 p_pr; have esG := pX1p2_extraspecial p_pr.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n)))))))) (expn p (S (double n))) *)
have oZ := card_center_extraspecial pG esG.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n)))))))) (expn p (S (double n))) *)
elim: n => [|n IHn]; first by rewrite (card_isog (ncprod0 _)) oZ.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p (S n)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p (S n))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p (S n)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p (S n)))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p (S n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p (S n))))))))) (expn p (S (double (S n)))) *)
case: pX1p2S => gz isoZ; rewrite -im_cpair cardMg_divn setI_im_cpair.
(* Goal: @eq nat (divn (muln (@card (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@gval (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@morphim_group (Pextraspecial.gtype p) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@cpairg1 (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@MorPhantom (Pextraspecial.gtype p) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@mfun (Pextraspecial.gtype p) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) (@cpairg1 (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))))))) (@card (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@gval (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@morphim_group (Pextraspecial.ngtype p n) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) (@cpair1g (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@MorPhantom (Pextraspecial.ngtype p n) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@mfun (Pextraspecial.ngtype p n) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@gval (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n)))))) (@cpair1g (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))))))))) (@card (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@center (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@morphim (Pextraspecial.gtype p) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) (@cpairg1 (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@MorPhantom (Pextraspecial.gtype p) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@mfun (Pextraspecial.gtype p) (@cprod_by (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))) (@cpairg1 (Pextraspecial.gtype p) (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n))))) gz isoZ))) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p)))))))))))) (expn p (S (double (S n)))) *)
rewrite -injm_center ?{1}card_injm ?injm_cpairg1 ?injm_cpair1g ?center_sub //.
(* Goal: @eq nat (divn (muln (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))))) (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (@gval (Pextraspecial.ngtype p n) (@setT_group (Pextraspecial.ngtype p n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n)))))))))) (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype p))) (@center (Pextraspecial.gtype p) (@gval (Pextraspecial.gtype p) (@setT_group (Pextraspecial.gtype p) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype p))))))))))) (expn p (S (double (S n)))) *)
by rewrite oG oZ IHn -expnD mulKn ?prime_gt0.
Qed.
Lemma pX1p2n_pgroup n : prime p -> p.-group p^{1+2*n}.
Proof.
(* Goal: forall _ : is_true (prime p), is_true (@pgroup (Pextraspecial.ngtype p n) (nat_pred_of_nat p) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype p n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype p n)))))) *)
by move=> p_pr; rewrite /pgroup card_pX1p2n // pnat_exp pnat_id.
Qed.
Lemma exponent_pX1p2n n : prime p -> odd p -> exponent p^{1+2*n} = p.
Lemma pX1p2n_extraspecial n : prime p -> n > 0 -> extraspecial p^{1+2*n}.
Lemma Ohm1_extraspecial_odd (gT : finGroupType) (G : {group gT}) :
p.-group G -> extraspecial G -> odd #|G| ->
Lemma isog_pX1p2n n (gT : finGroupType) (G : {group gT}) :
prime p -> extraspecial G -> #|G| = (p ^ n.*2.+1)%N -> exponent G %| p ->
End GeneralExponentPextraspecialTheory.
Lemma isog_2X1p2 : 2^{1+2} \isog 'D_8.
Proof.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (S (S (S (S (S (S (S (S O))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (S (S (S (S (S (S (S (S O)))))))))))))) *)
have pr2: prime 2 by []; have oG := card_pX1p2 pr2; rewrite -[8]oG.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
case/existsP: (isoGrp_hom (Grp_pX1p2 pr2)) => [[x y]] /=.
(* Goal: forall _ : is_true (@eq_op (Finite.eqType (prod_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (prod_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod_finType (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))) (@joing (Pextraspecial.gtype (S (S O))) (@cycle (Pextraspecial.gtype (S (S O))) x) (@cycle (Pextraspecial.gtype (S (S O))) y)) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@expgn (FinGroup.base (Pextraspecial.gtype (S (S O)))) x (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@expgn (FinGroup.base (Pextraspecial.gtype (S (S O)))) y (S (S O))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@commg (Pextraspecial.gtype (S (S O))) (@commg (Pextraspecial.gtype (S (S O))) x y) x) (@commg (Pextraspecial.gtype (S (S O))) (@commg (Pextraspecial.gtype (S (S O))) x y) y))))) (@pair (@set_of (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (oneg (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (prod (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (oneg (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@pair (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (oneg (FinGroup.base (Pextraspecial.gtype (S (S O))))) (oneg (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))), is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
rewrite -/2^{1+2}; case/eqP=> defG x2 y2 _ _.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
have not_oG_2: ~~ (#|2^{1+2}| %| 2) by rewrite oG.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
have ox: #[x] = 2.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
(* Goal: @eq nat (@order (Pextraspecial.gtype (S (S O))) x) (S (S O)) *)
apply: nt_prime_order => //; apply: contra not_oG_2 => x1.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
(* Goal: is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))) (S (S O))) *)
by rewrite -defG (eqP x1) cycle1 joing1G order_dvdn y2.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
have oy: #[y] = 2.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
(* Goal: @eq nat (@order (Pextraspecial.gtype (S (S O))) y) (S (S O)) *)
apply: nt_prime_order => //; apply: contra not_oG_2 => y1.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
(* Goal: is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))) (S (S O))) *)
by rewrite -defG (eqP y1) cycle1 joingG1 order_dvdn x2.
(* Goal: is_true (@isog (Pextraspecial.gtype (S (S O))) (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O))))) (predPredType (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.gtype (S (S O)))))))))))))))) *)
rewrite -defG joing_idl joing_idr involutions_gen_dihedral //.
(* Goal: is_true (negb (@eq_op (FinGroup.arg_eqType (FinGroup.base (Pextraspecial.gtype (S (S O))))) x y)) *)
apply: contra not_oG_2 => eq_xy; rewrite -defG (eqP eq_xy) (joing_idPl _) //.
(* Goal: is_true (dvdn (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O)))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.gtype (S (S O))))) (@gval (Pextraspecial.gtype (S (S O))) (@cycle_group (Pextraspecial.gtype (S (S O))) y))))) (S (S O))) *)
by rewrite -orderE oy.
Qed.
Lemma Q8_extraspecial : extraspecial 'Q_8.
Proof.
(* Goal: @extraspecial (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@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 gt32: 3 > 2 by []; have isoQ: 'Q_8 \isog 'Q_(2 ^ 3) by apply: isog_refl.
(* Goal: @extraspecial (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@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 y] genQ _] := generators_quaternion gt32 isoQ.
(* Goal: @extraspecial (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@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 [_ [defQ' defPhiQ _ _]] := quaternion_structure gt32 genQ isoQ.
(* Goal: forall (_ : and5 (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))) (@center (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))) (@cycle (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@expgn (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x (expn (S (S O)) (Nat.pred (Nat.pred (S (S (S O))))))))) (@eq nat (@card (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@center (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))))) (S (S O))) (forall (u : Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) u (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))))) (_ : @eq nat (@order (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) u) (S (S O))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) u (@expgn (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x (expn (S (S O)) (Nat.pred (Nat.pred (S (S (S O)))))))) (and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))) (@Ohm (S O) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))) (@cycle (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@expgn (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x (expn (S (S O)) (Nat.pred (Nat.pred (S (S (S O))))))))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))) (@Ohm (S (S O)) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))) (forall (k : nat) (_ : is_true (leq (S O) k)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))) (@Mho k (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))) (@cycle (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@expgn (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x (expn (S (S O)) k))))) (_ : and (and (@eq (@set_of (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))))) (@setU (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) y (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@mulg (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x y) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))) (@setD (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))) (@cycle (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) x))) (is_true (@disjoint (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) y (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@mulg (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x y) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))))))) (forall M : @group_of (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)))))))))))), @eq bool (@maximal (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) M) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))) (@pred_of_simpl (Equality.sort (set_of_eqType (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@pred3 (set_of_eqType (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (@cycle (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) x) (@generated (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) y (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))) (@generated (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@mulg (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x y) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) M)))) (_ : forall _ : is_true (leq (S (S (S (S O)))) (S (S (S O)))), and3 (is_true (@isog (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (quaternion_gtype (expn (S (S O)) (Nat.pred (S (S (S O)))))) (@generated (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) y (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (Nat.pred (S (S (S O)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (Nat.pred (S (S (S O)))))))))))) (is_true (@isog (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (quaternion_gtype (expn (S (S O)) (Nat.pred (S (S (S O)))))) (@generated (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@class (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@mulg (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))) x y) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (expn (S (S O)) (Nat.pred (S (S (S O)))))))) (Phant (FinGroup.arg_sort (FinGroup.base (quaternion_gtype (expn (S (S O)) (Nat.pred (S (S (S O)))))))))))) (forall (U : @set_of (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 (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) U)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) U)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))))) (_ : @eq nat (@indexg (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))) U) (S (S O))), @eq (@set_of (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))))))))))))) U (@cycle (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) x))), @extraspecial (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@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))))))))))))) *)
case=> defZ oZ _ _ _ _ _; split; last by rewrite oZ.
(* Goal: @special (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@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 split; rewrite ?defPhiQ defZ.
Qed.
Lemma DnQ_P n : xcprod_spec 'D^n 'Q_8 ('D^n*Q)%type.
Proof.
(* Goal: @xcprod_spec (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) (Pextraspecial.ngtypeQ n) *)
have pQ: 2.-group 'Q_(2 ^ 3) by rewrite /pgroup card_quaternion.
(* Goal: @xcprod_spec (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) (Pextraspecial.ngtypeQ n) *)
have{pQ} oZQ := card_center_extraspecial pQ Q8_extraspecial.
(* Goal: @xcprod_spec (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) (Pextraspecial.ngtypeQ n) *)
suffices oZDn: #|'Z('D^n)| = 2.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@center (Pextraspecial.ngtype (S (S O)) n) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))))))) (S (S O)) *)
(* Goal: @xcprod_spec (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) (Pextraspecial.ngtypeQ n) *)
by apply: xcprodP; rewrite isog_cyclic_card ?prime_cyclic ?oZQ ?oZDn.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@center (Pextraspecial.ngtype (S (S O)) n) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))))))) (S (S O)) *)
have [-> | n_gt0] := posnP n; first by rewrite center_ncprod0 card_pX1p2n.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@center (Pextraspecial.ngtype (S (S O)) n) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))))))) (S (S O)) *)
have pr2: prime 2 by []; have pDn := pX1p2n_pgroup n pr2.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@center (Pextraspecial.ngtype (S (S O)) n) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))))))) (S (S O)) *)
exact: card_center_extraspecial (pX1p2n_extraspecial pr2 n_gt0).
Qed.
Lemma card_DnQ n : #|'D^n*Q| = (2 ^ n.+1.*2.+1)%N.
Proof.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))))) (expn (S (S O)) (S (double (S n)))) *)
have oQ: #|'Q_(2 ^ 3)| = 8 by rewrite card_quaternion.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))))) (expn (S (S O)) (S (double (S n)))) *)
have pQ: 2.-group 'Q_8 by rewrite /pgroup oQ.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))))) (expn (S (S O)) (S (double (S n)))) *)
case: DnQ_P => gz isoZ.
(* Goal: @eq nat (@card (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@setTfor (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (Phant (FinGroup.arg_sort (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ)))))))) (expn (S (S O)) (S (double (S n)))) *)
rewrite -im_cpair cardMg_divn setI_im_cpair cpair_center_id.
(* Goal: @eq nat (divn (muln (@card (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@gval (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@morphim_group (Pextraspecial.ngtype (S (S O)) n) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@cpairg1 (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@MorPhantom (Pextraspecial.ngtype (S (S O)) n) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@mfun (Pextraspecial.ngtype (S (S O)) n) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@gval (Pextraspecial.ngtype (S (S O)) n) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))))) (@cpairg1 (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))))))))) (@card (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@gval (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@morphim_group (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@setT_group (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))))))))))))) (@cpair1g (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@MorPhantom (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@mfun (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))) (@cpair1g (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@setT_group (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))))))))))))))))))) (@card (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@center (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@morphim (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))) (@cpair1g (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@MorPhantom (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@mfun (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@cprod_by (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))) (@cpair1g (Pextraspecial.ngtype (S (S O)) n) (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setT_group (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))))))))))))) gz isoZ))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))))))) (expn (S (S O)) (S (double (S n)))) *)
rewrite -injm_center 3?{1}card_injm ?injm_cpairg1 ?injm_cpair1g ?center_sub //.
(* Goal: @eq nat (divn (muln (@card (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (@gval (Pextraspecial.ngtype (S (S O)) n) (@setT_group (Pextraspecial.ngtype (S (S O)) n) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))))))) (@card (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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)))))))))))))))))) (@card (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O)))))))))))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))))) (@center (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval (quaternion_gtype (S (S (S (S (S (S (S (S O))))))))) (@setT_group (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))))))))))))))))))) (expn (S (S O)) (S (double (S n)))) *)
rewrite oQ card_pX1p2n // (card_center_extraspecial pQ Q8_extraspecial).
(* Goal: @eq nat (divn (muln (expn (S (S O)) (S (double n))) (S (S (S (S (S (S (S (S O))))))))) (S (S O))) (expn (S (S O)) (S (double (S n)))) *)
by rewrite -muln_divA // mulnC -(expnD 2 2).
Qed.
Lemma DnQ_pgroup n : 2.-group 'D^n*Q.
Proof.
(* Goal: is_true (@pgroup (Pextraspecial.ngtypeQ n) (nat_pred_of_nat (S (S O))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))) *)
by rewrite /pgroup card_DnQ pnat_exp.
Qed.
Lemma DnQ_extraspecial n : extraspecial 'D^n*Q.
Lemma card_isog8_extraspecial (gT : finGroupType) (G : {group gT}) :
#|G| = 8 -> extraspecial G -> (G \isog 'D_8) || (G \isog 'Q_8).
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 (S (S (S (S (S (S (S O))))))))) (_ : @extraspecial gT (@gval gT G)), is_true (orb (@isog gT (dihedral_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (S (S (S (S (S (S (S (S O)))))))))))))) (@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=> oG esG; have pG: 2.-group G by rewrite /pgroup oG.
(* Goal: is_true (orb (@isog gT (dihedral_gtype (S (S (S (S (S (S (S (S O))))))))) (@gval gT G) (@setTfor (FinGroup.arg_finType (FinGroup.base (dihedral_gtype (S (S (S (S (S (S (S (S O))))))))))) (Phant (FinGroup.arg_sort (FinGroup.base (dihedral_gtype (S (S (S (S (S (S (S (S O)))))))))))))) (@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))))))))))))))) *)
apply/norP=> [[notG_D8 notG_Q8]].
(* Goal: False *)
have not_extG: extremal_class G = NotExtremal.
(* Goal: False *)
(* Goal: @eq extremal_group_type (@extremal_class gT (@gval gT G)) NotExtremal *)
by rewrite /extremal_class oG andFb (negPf notG_D8) (negPf notG_Q8).
(* Goal: False *)
have [x Gx ox] := exponent_witness (pgroup_nil pG).
(* Goal: False *)
pose X := <[x]>; have cycX: cyclic X := cycle_cyclic x.
(* Goal: False *)
have sXG: X \subset G by rewrite cycle_subG.
(* Goal: False *)
have iXG: #|G : X| = 2.
(* Goal: False *)
(* Goal: @eq nat (@indexg gT (@gval gT G) X) (S (S O)) *)
by rewrite -divgS // oG -orderE -ox exponent_2extraspecial.
(* Goal: False *)
have not_cGG := extraspecial_nonabelian esG.
(* Goal: False *)
have:= maximal_cycle_extremal pG not_cGG cycX sXG iXG.
(* Goal: forall _ : is_true (orb (@eq_op extremal_group_eqType (@extremal_class gT (@gval gT G)) ModularGroup) (andb (@eq_op nat_eqType (S (S O)) (S (S O))) (@extremal2 gT (@gval gT G)))), False *)
by rewrite /extremal2 not_extG.
Qed.
Lemma isog_2extraspecial (gT : finGroupType) (G : {group gT}) n :
#|G| = (2 ^ n.*2.+1)%N -> extraspecial G -> G \isog 'D^n \/ G \isog 'D^n.-1*Q.
Lemma rank_Dn n : 'r_2('D^n) = n.+1.
Proof.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtype (S (S O)) n) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n)))))) (S n) *)
elim: n => [|n IHn]; first by rewrite p_rank_abelem ?prime_abelem ?card_pX1p2n.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtype (S (S O)) (S n)) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n))))))) (S (S n)) *)
have oDDn: #|'D^n.+1| = (2 ^ n.+1.*2.+1)%N by apply: card_pX1p2n.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtype (S (S O)) (S n)) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n))))))) (S (S n)) *)
have esDDn: extraspecial 'D^n.+1 by apply: pX1p2n_extraspecial.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtype (S (S O)) (S n)) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n))))))) (S (S n)) *)
do [case: pX1p2S => gz isoZ; set DDn := [set: _]] in oDDn esDDn *.
have pDDn: 2.-group DDn by rewrite /pgroup oDDn pnat_exp.
apply/eqP; rewrite eqn_leq; apply/andP; split.
(* Goal: is_true (leq (S (S n)) (@p_rank (Pextraspecial.ngtype (S (S O)) (S n)) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))))))) *)
(* Goal: is_true (leq (@p_rank (Pextraspecial.ngtype (S (S O)) (S n)) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n))))))) (S (S n))) *)
have [E EprE]:= p_rank_witness 2 [group of DDn].
have [sEDDn abelE <-] := pnElemP EprE; have [pE cEE _]:= and3P abelE.
rewrite -(@leq_exp2l 2) // -p_part part_pnat_id // -leq_sqr -expnM -mulnn.
rewrite muln2 doubleS expnS -oDDn -(@leq_pmul2r #|'C_DDn(E)|) ?cardG_gt0 //.
rewrite {1}(card_subcent_extraspecial pDDn) // mulnCA -mulnA Lagrange //=.
rewrite mulnAC mulnA leq_pmul2r ?cardG_gt0 // setTI.
have ->: (2 * #|'C(E)| = #|'Z(DDn)| * #|'C(E)|)%N.
by rewrite (card_center_extraspecial pDDn).
by rewrite leq_mul ?subset_leq_card ?subsetIl.
have [inj1 injn] := (injm_cpairg1 isoZ, injm_cpair1g isoZ).
pose D := cpairg1 isoZ @* 2^{1+2}; pose Dn := cpair1g isoZ @* 'D^n.
have [E EprE] := p_rank_witness 2 [group of Dn].
rewrite injm_p_rank //= IHn in EprE; have [sEDn abelE dimE]:= pnElemP EprE.
have [x [Dx ox] notDnx]: exists x, [/\ x \in D, #[x] = 2 & x \notin Dn].
have isoD: D \isog 'D_(2 ^ 3).
by rewrite isog_sym -(isog_transl _ isog_2X1p2) sub_isog.
have [//| [x y] genD [oy _]] := generators_2dihedral _ isoD.
have [_ _ _ X'y] := genD; case/setDP: X'y; rewrite /= -/D => Dy notXy.
exists y; split=> //; apply: contra notXy => Dny.
case/dihedral2_structure: genD => // _ _ _ _ [defZD _ _ _ _].
by rewrite (subsetP (cycleX x 2)) // -defZD -setI_im_cpair inE Dy.
have def_xE: <[x]> \x E = <[x]> <*> E.
rewrite dprodEY ?prime_TIg -?orderE ?ox //.
by rewrite (centSS sEDn _ (im_cpair_cent _)) ?cycle_subG.
by rewrite cycle_subG (contra (subsetP sEDn x)).
apply/p_rank_geP; exists (<[x]> <*> E)%G.
rewrite 2!inE subsetT (dprod_abelem _ def_xE) abelE -(dprod_card def_xE).
by rewrite prime_abelem -?orderE ?ox //= lognM ?cardG_gt0 ?dimE.
Qed.
Qed.
Lemma rank_DnQ n : 'r_2('D^n*Q) = n.+1.
Proof.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtypeQ n) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))) (S n) *)
have pDnQ: 2.-group 'D^n*Q := DnQ_pgroup n.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtypeQ n) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))) (S n) *)
have esDnQ: extraspecial 'D^n*Q := DnQ_extraspecial n.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtypeQ n) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))) (S n) *)
do [case: DnQ_P => gz isoZ; set DnQ := setT] in pDnQ esDnQ *.
suffices [E]: exists2 E, E \in 'E*_2(DnQ) & logn 2 #|E| = n.+1.
by rewrite (pmaxElem_extraspecial pDnQ esDnQ); case/pnElemP=> _ _ <-.
have oZ: #|'Z(DnQ)| = 2 by apply: card_center_extraspecial.
pose Dn := cpairg1 isoZ @* 'D^n; pose Q := cpair1g isoZ @* 'Q_8.
have [injDn injQ] := (injm_cpairg1 isoZ, injm_cpair1g isoZ).
have [E EprE]:= p_rank_witness 2 [group of Dn].
have [sEDn abelE dimE] := pnElemP EprE; have [pE cEE eE]:= and3P abelE.
rewrite injm_p_rank // rank_Dn in dimE; exists E => //.
have sZE: 'Z(DnQ) \subset E.
have maxE := subsetP (p_rankElem_max _ _) E EprE.
have abelZ: 2.-abelem 'Z(DnQ) by rewrite prime_abelem ?oZ.
rewrite -(Ohm1_id abelZ) (OhmE _ (abelem_pgroup abelZ)) gen_subG.
rewrite -(pmaxElem_LdivP _ maxE) // setSI //=.
by rewrite -cpairg1_center injm_center // setIS ?centS.
have scE: 'C_Dn(E) = E.
apply/eqP; rewrite eq_sym eqEcard subsetI sEDn -abelianE cEE /=.
have [n0 | n_gt0] := posnP n.
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtypeQ n) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))) (S n) *)
(* Goal: @eq nat (@p_rank (Pextraspecial.ngtypeQ n) (S (S O)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n)))))) (S n) *)
rewrite subset_leq_card // subIset // (subset_trans _ sZE) //.
by rewrite -cpairg1_center morphimS // n0 center_ncprod0.
have pDn: 2.-group Dn by rewrite morphim_pgroup ?pX1p2n_pgroup.
have esDn: extraspecial Dn.
exact: injm_extraspecial (pX1p2n_extraspecial _ _).
rewrite dvdn_leq ?cardG_gt0 // (card_subcent_extraspecial pDn) //=.
rewrite -injm_center // cpairg1_center (setIidPl sZE) oZ.
rewrite -(dvdn_pmul2l (cardG_gt0 E)) mulnn mulnCA Lagrange //.
rewrite card_injm ?card_pX1p2n // -expnS pfactor_dvdn ?expn_gt0 ?cardG_gt0 //.
by rewrite lognX dimE mul2n.
apply/pmaxElemP; split=> [|F E2F sEF]; first by rewrite inE subsetT abelE.
have{E2F} [_ abelF] := pElemP E2F; have [pF cFF eF] := and3P abelF.
apply/eqP; rewrite eqEsubset sEF andbT; apply/subsetP=> x Fx.
have DnQx: x \in Dn * Q by rewrite im_cpair inE.
have{DnQx} [y z Dn_y Qz def_x]:= imset2P DnQx.
have{Dn_y} Ey: y \in E.
have cEz: z \in 'C(E).
by rewrite (subsetP (centS sEDn)) // (subsetP (im_cpair_cent _)).
rewrite -scE inE Dn_y -(groupMr _ cEz) -def_x (subsetP (centS sEF)) //.
by rewrite (subsetP cFF).
rewrite def_x groupMl // (subsetP sZE) // -cpair1g_center injm_center //= -/Q.
have: z \in 'Ohm_1(Q).
rewrite (OhmE 1 (pgroupS (subsetT Q) pDnQ)) mem_gen // !inE Qz /=.
rewrite -[z](mulKg y) -def_x (exponentP eF) ?groupM //.
by rewrite groupV (subsetP sEF).
have isoQ: Q \isog 'Q_(2 ^ 3) by rewrite isog_sym sub_isog.
have [//|[u v] genQ _] := generators_quaternion _ isoQ.
by case/quaternion_structure: genQ => // _ _ [-> _ _ [-> _] _] _ _.
Qed.
Qed.
Lemma not_isog_Dn_DnQ n : ~~ ('D^n \isog 'D^n.-1*Q).
Proof.
(* Goal: is_true (negb (@isog (Pextraspecial.ngtype (S (S O)) n) (Pextraspecial.ngtypeQ (Nat.pred n)) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) n))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ (Nat.pred n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ (Nat.pred n)))))))) *)
case: n => [|n] /=; first by rewrite isogEcard card_pX1p2n // card_DnQ andbF.
(* Goal: is_true (negb (@isog (Pextraspecial.ngtype (S (S O)) (S n)) (Pextraspecial.ngtypeQ n) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtype (S (S O)) (S n)))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Pextraspecial.ngtypeQ n))) (Phant (FinGroup.arg_sort (FinGroup.base (Pextraspecial.ngtypeQ n))))))) *)
apply: contraL (leqnn n.+1) => isoDn1DnQ.
(* Goal: is_true (negb (leq (S n) (S n))) *)
by rewrite -ltnNge -rank_Dn (isog_p_rank isoDn1DnQ) rank_DnQ.
Qed.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Parts.
Section Union1.
Variable E : Setoid.
Definition union : part_set E -> part_set E -> part_set E.
Proof.
(* Goal: forall (_ : Carrier (part_set E)) (_ : Carrier (part_set E)), Carrier (part_set E) *)
intros A B.
(* Goal: Carrier (part_set E) *)
apply (Build_Predicate (Pred_fun:=fun x : E => in_part x A \/ in_part x B)).
(* Goal: @pred_compatible E (fun x : Carrier E => or (@in_part E x A) (@in_part E x B)) *)
red in |- *.
(* Goal: forall (x y : Carrier E) (_ : or (@in_part E x A) (@in_part E x B)) (_ : @Equal E y x), or (@in_part E y A) (@in_part E y B) *)
intros x y H' H'0; try assumption.
(* Goal: or (@in_part E y A) (@in_part E y B) *)
elim H'; [ intros H'1; try exact H'1; clear H' | intros H'1; clear H' ].
(* Goal: or (@in_part E y A) (@in_part E y B) *)
(* Goal: or (@in_part E y A) (@in_part E y B) *)
left; try assumption.
(* Goal: or (@in_part E y A) (@in_part E y B) *)
(* Goal: @in_part E y A *)
apply in_part_comp_l with x; auto with algebra.
(* Goal: or (@in_part E y A) (@in_part E y B) *)
right; try assumption.
(* Goal: @in_part E y B *)
apply in_part_comp_l with x; auto with algebra.
Qed.
Lemma included_union_l : forall A B : part_set E, included A (union A B).
Proof.
(* Goal: forall A B : Carrier (part_set E), @included E A (union A B) *)
unfold included in |- *; simpl in |- *; intuition.
Qed.
Lemma included_union_r : forall A B : part_set E, included B (union A B).
Proof.
(* Goal: forall A B : Carrier (part_set E), @included E B (union A B) *)
unfold included in |- *; simpl in |- *; intuition.
Qed.
Lemma in_part_union_l :
forall (A B : part_set E) (x : E), in_part x A -> in_part x (union A B).
Proof.
(* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @in_part E x (union A B) *)
simpl in |- *; intuition.
Qed.
Lemma in_part_union_r :
forall (A B : part_set E) (x : E), in_part x B -> in_part x (union A B).
Proof.
(* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x B), @in_part E x (union A B) *)
simpl in |- *; intuition.
Qed.
Parameter
in_part_union_or :
forall (A B : part_set E) (x : E),
in_part x A \/ in_part x B -> in_part x (union A B).
Lemma in_part_union :
forall (A B : part_set E) (x : E),
in_part x (union A B) -> in_part x A \/ in_part x B.
Proof.
(* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x (union A B)), or (@in_part E x A) (@in_part E x B) *)
intros A B x; try assumption.
(* Goal: forall _ : @in_part E x (union A B), or (@in_part E x A) (@in_part E x B) *)
unfold union in |- *; intuition.
Qed.
Lemma union_not_in_l :
forall (A B : part_set E) (x : E),
in_part x (union A B) -> ~ in_part x A -> in_part x B.
Proof.
(* Goal: forall (A B : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x (union A B)) (_ : not (@in_part E x A)), @in_part E x B *)
unfold union in |- *; simpl in |- *; intuition.
Qed.
Lemma included2_union :
forall A B C : part_set E,
included A C -> included B C -> included (union A B) C.
Proof.
(* Goal: forall (A B C : Carrier (part_set E)) (_ : @included E A C) (_ : @included E B C), @included E (union A B) C *)
unfold included in |- *; simpl in |- *; intuition.
Qed.
Lemma union_comp :
forall A A' B B' : part_set E,
Equal A A' -> Equal B B' -> Equal (union A B) (union A' B').
Proof.
(* Goal: forall (A A' B B' : Carrier (part_set E)) (_ : @Equal (part_set E) A A') (_ : @Equal (part_set E) B B'), @Equal (part_set E) (union A B) (union A' B') *)
unfold union in |- *; simpl in |- *.
(* Goal: forall (A A' B B' : Predicate E) (_ : @eq_part E A A') (_ : @eq_part E B B'), @eq_part E (@Build_Predicate E (fun x : Carrier E => or (@in_part E x A) (@in_part E x B)) (fun (x y : Carrier E) (H' : or (@in_part E x A) (@in_part E x B)) (H'0 : @Equal E y x) => @or_ind (@in_part E x A) (@in_part E x B) (or (@in_part E y A) (@in_part E y B)) (fun H'1 : @in_part E x A => @or_introl (@in_part E y A) (@in_part E y B) (@in_part_comp_l E A x y H'1 H'0)) (fun H'1 : @in_part E x B => @or_intror (@in_part E y A) (@in_part E y B) (@in_part_comp_l E B x y H'1 H'0)) H')) (@Build_Predicate E (fun x : Carrier E => or (@in_part E x A') (@in_part E x B')) (fun (x y : Carrier E) (H' : or (@in_part E x A') (@in_part E x B')) (H'0 : @Equal E y x) => @or_ind (@in_part E x A') (@in_part E x B') (or (@in_part E y A') (@in_part E y B')) (fun H'1 : @in_part E x A' => @or_introl (@in_part E y A') (@in_part E y B') (@in_part_comp_l E A' x y H'1 H'0)) (fun H'1 : @in_part E x B' => @or_intror (@in_part E y A') (@in_part E y B') (@in_part_comp_l E B' x y H'1 H'0)) H')) *)
unfold eq_part in |- *; simpl in |- *.
(* Goal: forall (A A' B B' : Predicate E) (_ : forall x : Carrier E, and (forall _ : @in_part E x A, @in_part E x A') (forall _ : @in_part E x A', @in_part E x A)) (_ : forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x B') (forall _ : @in_part E x B', @in_part E x B)) (x : Carrier E), and (forall _ : or (@in_part E x A) (@in_part E x B), or (@in_part E x A') (@in_part E x B')) (forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B)) *)
intros A A' B B' H' H'0 x; split; [ intros H'1; try assumption | idtac ].
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
(* Goal: or (@in_part E x A') (@in_part E x B') *)
elim H'1; [ intros H'2; try exact H'2; clear H'1 | intros H'2; clear H'1 ].
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
(* Goal: or (@in_part E x A') (@in_part E x B') *)
(* Goal: or (@in_part E x A') (@in_part E x B') *)
left; try assumption.
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
(* Goal: or (@in_part E x A') (@in_part E x B') *)
(* Goal: @in_part E x A' *)
elim (H' x); intros H'3 H'4; lapply H'3; [ intros H'5; try exact H'5; clear H'3 | clear H'3 ].
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
(* Goal: or (@in_part E x A') (@in_part E x B') *)
(* Goal: @in_part E x A *)
auto with algebra.
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
(* Goal: or (@in_part E x A') (@in_part E x B') *)
right; try assumption.
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
(* Goal: @in_part E x B' *)
elim (H'0 x); intros H'3 H'4; lapply H'3; [ intros H'5; try exact H'5; clear H'3 | clear H'3 ].
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
(* Goal: @in_part E x B *)
auto with algebra.
(* Goal: forall _ : or (@in_part E x A') (@in_part E x B'), or (@in_part E x A) (@in_part E x B) *)
intros H'1; try assumption.
(* Goal: or (@in_part E x A) (@in_part E x B) *)
elim H'1; [ intros H'2; try exact H'2; clear H'1 | intros H'2; clear H'1 ].
(* Goal: or (@in_part E x A) (@in_part E x B) *)
(* Goal: or (@in_part E x A) (@in_part E x B) *)
left; try assumption.
(* Goal: or (@in_part E x A) (@in_part E x B) *)
(* Goal: @in_part E x A *)
elim (H' x); intros H'3 H'4; lapply H'4; [ intros H'5; try exact H'5; clear H'4 | clear H'4 ].
(* Goal: or (@in_part E x A) (@in_part E x B) *)
(* Goal: @in_part E x A' *)
auto with algebra.
(* Goal: or (@in_part E x A) (@in_part E x B) *)
right; try assumption.
(* Goal: @in_part E x B *)
elim (H'0 x); intros H'3 H'4; lapply H'4; [ intros H'5; try exact H'5; clear H'4 | clear H'4 ].
(* Goal: @in_part E x B' *)
auto with algebra.
Qed.
Lemma union_assoc :
forall A B C : part_set E, Equal (union A (union B C)) (union (union A B) C).
Proof.
(* Goal: forall A B C : Carrier (part_set E), @Equal (part_set E) (union A (union B C)) (union (union A B) C) *)
unfold union in |- *; simpl in |- *.
(* Goal: forall A B C : Predicate E, @eq_part E (@Build_Predicate E (fun x : Carrier E => or (@in_part E x A) (or (@in_part E x B) (@in_part E x C))) (fun (x y : Carrier E) (H' : or (@in_part E x A) (or (@in_part E x B) (@in_part E x C))) (H'0 : @Equal E y x) => @or_ind (@in_part E x A) (or (@in_part E x B) (@in_part E x C)) (or (@in_part E y A) (or (@in_part E y B) (@in_part E y C))) (fun H'1 : @in_part E x A => @or_introl (@in_part E y A) (or (@in_part E y B) (@in_part E y C)) (@in_part_comp_l E A x y H'1 H'0)) (fun H'1 : or (@in_part E x B) (@in_part E x C) => @or_intror (@in_part E y A) (or (@in_part E y B) (@in_part E y C)) (@in_part_comp_l E (@Build_Predicate E (fun x0 : Carrier E => or (@in_part E x0 B) (@in_part E x0 C)) (fun (x0 y0 : Carrier E) (H'2 : or (@in_part E x0 B) (@in_part E x0 C)) (H'3 : @Equal E y0 x0) => @or_ind (@in_part E x0 B) (@in_part E x0 C) (or (@in_part E y0 B) (@in_part E y0 C)) (fun H'4 : @in_part E x0 B => @or_introl (@in_part E y0 B) (@in_part E y0 C) (@in_part_comp_l E B x0 y0 H'4 H'3)) (fun H'4 : @in_part E x0 C => @or_intror (@in_part E y0 B) (@in_part E y0 C) (@in_part_comp_l E C x0 y0 H'4 H'3)) H'2)) x y H'1 H'0)) H')) (@Build_Predicate E (fun x : Carrier E => or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C)) (fun (x y : Carrier E) (H' : or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C)) (H'0 : @Equal E y x) => @or_ind (or (@in_part E x A) (@in_part E x B)) (@in_part E x C) (or (or (@in_part E y A) (@in_part E y B)) (@in_part E y C)) (fun H'1 : or (@in_part E x A) (@in_part E x B) => @or_introl (or (@in_part E y A) (@in_part E y B)) (@in_part E y C) (@in_part_comp_l E (@Build_Predicate E (fun x0 : Carrier E => or (@in_part E x0 A) (@in_part E x0 B)) (fun (x0 y0 : Carrier E) (H'2 : or (@in_part E x0 A) (@in_part E x0 B)) (H'3 : @Equal E y0 x0) => @or_ind (@in_part E x0 A) (@in_part E x0 B) (or (@in_part E y0 A) (@in_part E y0 B)) (fun H'4 : @in_part E x0 A => @or_introl (@in_part E y0 A) (@in_part E y0 B) (@in_part_comp_l E A x0 y0 H'4 H'3)) (fun H'4 : @in_part E x0 B => @or_intror (@in_part E y0 A) (@in_part E y0 B) (@in_part_comp_l E B x0 y0 H'4 H'3)) H'2)) x y H'1 H'0)) (fun H'1 : @in_part E x C => @or_intror (or (@in_part E y A) (@in_part E y B)) (@in_part E y C) (@in_part_comp_l E C x y H'1 H'0)) H')) *)
unfold eq_part in |- *; simpl in |- *.
(* Goal: forall (A B C : Predicate E) (x : Carrier E), and (forall _ : or (@in_part E x A) (or (@in_part E x B) (@in_part E x C)), or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C)) (forall _ : or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C), or (@in_part E x A) (or (@in_part E x B) (@in_part E x C))) *)
intros A B C x; split; [ try assumption | idtac ].
(* Goal: forall _ : or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C), or (@in_part E x A) (or (@in_part E x B) (@in_part E x C)) *)
(* Goal: forall _ : or (@in_part E x A) (or (@in_part E x B) (@in_part E x C)), or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C) *)
intuition.
(* Goal: forall _ : or (or (@in_part E x A) (@in_part E x B)) (@in_part E x C), or (@in_part E x A) (or (@in_part E x B) (@in_part E x C)) *)
intuition.
Qed.
Lemma union_com : forall A B : part_set E, Equal (union A B) (union B A).
Proof.
(* Goal: forall A B : Carrier (part_set E), @Equal (part_set E) (union A B) (union B A) *)
unfold union in |- *; simpl in |- *.
(* Goal: forall A B : Predicate E, @eq_part E (@Build_Predicate E (fun x : Carrier E => or (@in_part E x A) (@in_part E x B)) (fun (x y : Carrier E) (H' : or (@in_part E x A) (@in_part E x B)) (H'0 : @Equal E y x) => @or_ind (@in_part E x A) (@in_part E x B) (or (@in_part E y A) (@in_part E y B)) (fun H'1 : @in_part E x A => @or_introl (@in_part E y A) (@in_part E y B) (@in_part_comp_l E A x y H'1 H'0)) (fun H'1 : @in_part E x B => @or_intror (@in_part E y A) (@in_part E y B) (@in_part_comp_l E B x y H'1 H'0)) H')) (@Build_Predicate E (fun x : Carrier E => or (@in_part E x B) (@in_part E x A)) (fun (x y : Carrier E) (H' : or (@in_part E x B) (@in_part E x A)) (H'0 : @Equal E y x) => @or_ind (@in_part E x B) (@in_part E x A) (or (@in_part E y B) (@in_part E y A)) (fun H'1 : @in_part E x B => @or_introl (@in_part E y B) (@in_part E y A) (@in_part_comp_l E B x y H'1 H'0)) (fun H'1 : @in_part E x A => @or_intror (@in_part E y B) (@in_part E y A) (@in_part_comp_l E A x y H'1 H'0)) H')) *)
unfold eq_part in |- *; simpl in |- *.
(* Goal: forall (A B : Predicate E) (x : Carrier E), and (forall _ : or (@in_part E x A) (@in_part E x B), or (@in_part E x B) (@in_part E x A)) (forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B)) *)
intros A B x; split; [ try assumption | idtac ].
(* Goal: forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B) *)
(* Goal: forall _ : or (@in_part E x A) (@in_part E x B), or (@in_part E x B) (@in_part E x A) *)
intuition.
(* Goal: forall _ : or (@in_part E x B) (@in_part E x A), or (@in_part E x A) (@in_part E x B) *)
intuition.
Qed.
Parameter union_empty_l : forall A : part_set E, Equal (union (empty E) A) A.
Parameter union_empty_r : forall A : part_set E, Equal (union A (empty E)) A.
End Union1.
Hint Resolve included_union_l included_union_r in_part_union_l
in_part_union_r included2_union union_comp union_assoc union_empty_l
union_empty_r: algebra.
Hint Immediate union_com: algebra. |
From mathcomp
Require Import ssreflect ssrbool ssrfun ssrnat eqtype.
From LemmaOverloading
Require Import rels prelude.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Module Poset.
Section RawMixin.
Record mixin_of (T : Type) := Mixin {
mx_leq : T -> T -> Prop;
mx_bot : T;
_ : forall x, mx_leq mx_bot x;
_ : forall x, mx_leq x x;
_ : forall x y, mx_leq x y -> mx_leq y x -> x = y;
_ : forall x y z, mx_leq x y -> mx_leq y z -> mx_leq x z}.
End RawMixin.
Section ClassDef.
Record class_of T := Class {mixin : mixin_of T}.
Structure type : Type := Pack {sort : Type; _ : class_of sort; _ : Type}.
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 T.
Definition pack (m0 : mixin_of T) :=
fun m & phant_id m0 m => Pack (@Class T m) T.
Definition leq := mx_leq (mixin class).
Definition bot := mx_bot (mixin class).
End ClassDef.
Module Exports.
Coercion sort : type >-> Sortclass.
Notation poset := Poset.type.
Notation PosetMixin := Poset.Mixin.
Notation Poset T m := (@pack T _ m id).
Notation "[ 'poset' 'of' T 'for' cT ]" := (@clone T cT _ id)
(at level 0, format "[ 'poset' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'poset' 'of' T ]" := (@clone T _ _ id)
(at level 0, format "[ 'poset' 'of' T ]") : form_scope.
Notation "x <== y" := (Poset.leq x y) (at level 70).
Notation bot := Poset.bot.
Arguments Poset.bot [cT].
Prenex Implicits Poset.bot.
Section Laws.
Variable T : poset.
Lemma botP (x : T) : bot <== x.
Proof.
(* Goal: @leq T (@Poset.bot T) x *)
by case: T x=>s [[leq b B]].
Qed.
Lemma poset_refl (x : T) : x <== x.
Proof.
(* Goal: @leq T x x *)
by case: T x=>S [[leq b B R]].
Qed.
Lemma poset_asym (x y : T) : x <== y -> y <== x -> x = y.
Proof.
(* Goal: forall (_ : @leq T x y) (_ : @leq T y x), @eq (sort T) x y *)
by case: T x y=>S [[l b B R A Tr]] *; apply: (A).
Qed.
Lemma poset_trans (y x z : T) : x <== y -> y <== z -> x <== z.
Proof.
(* Goal: forall (_ : @leq T x y) (_ : @leq T y z), @leq T x z *)
by case: T y x z=>S [[l b B R A Tr]] ? x y z; apply: (Tr).
Qed.
End Laws.
Hint Resolve botP poset_refl : core.
Add Parametric Relation (T : poset) : T (@Poset.leq T)
reflexivity proved by (@poset_refl _)
transitivity proved by (fun x y => @poset_trans _ y x) as poset_rel.
End Exports.
End Poset.
Export Poset.Exports.
Definition monotone (T1 T2 : poset) (f : T1 -> T2) :=
forall x y, x <== y -> f x <== f y.
Section IdealDef.
Variable T : poset.
Structure ideal (P : T) := Ideal {id_val : T; id_pf : id_val <== P}.
Lemma relaxP (P1 P2 : T) : P1 <== P2 -> forall p, p <== P1 -> p <== P2.
Proof.
(* Goal: forall (_ : @Poset.leq T P1 P2) (p : Poset.sort T) (_ : @Poset.leq T p P1), @Poset.leq T p P2 *)
by move=>H1 p H2; apply: poset_trans H1.
Qed.
Definition relax (P1 P2 : T) (x : ideal P1) (pf : P1 <== P2) :=
Ideal (relaxP pf (id_pf x)).
End IdealDef.
Section SubPoset.
Variables (T : poset) (s : Pred T) (C : bot \In s).
Local Notation tp := {x : T | x \In s}.
Definition sub_bot : tp := exist _ bot C.
Definition sub_leq (p1 p2 : tp) := sval p1 <== sval p2.
Lemma sub_botP x : sub_leq sub_bot x.
Proof.
(* Goal: sub_leq sub_bot x *)
by apply: botP.
Qed.
Lemma sub_refl x : sub_leq x x.
Proof.
(* Goal: sub_leq x x *)
by rewrite /sub_leq.
Qed.
Lemma sub_asym x y : sub_leq x y -> sub_leq y x -> x = y.
Lemma sub_trans x y z : sub_leq x y -> sub_leq y z -> sub_leq x z.
Proof.
(* Goal: forall (_ : sub_leq x y) (_ : sub_leq y z), sub_leq x z *)
move: x y z=>[x Hx][y Hy][z Hz]; rewrite /sub_leq /=.
(* Goal: forall (_ : @leq T x y) (_ : @leq T y z), @leq T x z *)
by apply: poset_trans.
Qed.
Definition subPosetMixin := PosetMixin sub_botP sub_refl sub_asym sub_trans.
Definition subPoset := Eval hnf in Poset tp subPosetMixin.
End SubPoset.
Section PairPoset.
Variable (A B : poset).
Local Notation tp := (A * B)%type.
Definition pair_bot : tp := (bot, bot).
Definition pair_leq (p1 p2 : tp) := p1.1 <== p2.1 /\ p1.2 <== p2.2.
Lemma pair_botP x : pair_leq pair_bot x.
Proof.
(* Goal: pair_leq pair_bot x *)
by split; apply: botP.
Qed.
Lemma pair_refl x : pair_leq x x.
Proof.
(* Goal: pair_leq x x *)
by [].
Qed.
Lemma pair_asym x y : pair_leq x y -> pair_leq y x -> x = y.
Proof.
(* Goal: forall (_ : pair_leq x y) (_ : pair_leq y x), @eq (prod (Poset.sort A) (Poset.sort B)) x y *)
move: x y=>[x1 x2][y1 y2][/= H1 H2][/= H3 H4].
(* Goal: @eq (prod (Poset.sort A) (Poset.sort B)) (@pair (Poset.sort A) (Poset.sort B) x1 x2) (@pair (Poset.sort A) (Poset.sort B) y1 y2) *)
by congr (_, _); apply: poset_asym.
Qed.
Lemma pair_trans x y z : pair_leq x y -> pair_leq y z -> pair_leq x z.
Proof.
(* Goal: forall (_ : pair_leq x y) (_ : pair_leq y z), pair_leq x z *)
move: x y z=>[x1 x2][y1 y2][z1 z2][/= H1 H2][/= H3 H4]; split=>/=.
(* Goal: @Poset.leq B x2 z2 *)
(* Goal: @Poset.leq A x1 z1 *)
-
(* Goal: @Poset.leq B x2 z2 *)
(* Goal: @Poset.leq A x1 z1 *)
by apply: poset_trans H3.
(* Goal: @Poset.leq B x2 z2 *)
by apply: poset_trans H4.
Qed.
Definition pairPosetMixin :=
PosetMixin pair_botP pair_refl pair_asym pair_trans.
Canonical pairPoset := Eval hnf in Poset tp pairPosetMixin.
End PairPoset.
Section FunPoset.
Variable (A : Type) (B : poset).
Local Notation tp := (A -> B).
Definition fun_bot : tp := fun x => bot.
Definition fun_leq (p1 p2 : tp) := forall x, p1 x <== p2 x.
Lemma fun_botP x : fun_leq fun_bot x.
Proof.
(* Goal: fun_leq fun_bot x *)
by move=>y; apply: botP.
Qed.
Lemma fun_refl x : fun_leq x x.
Proof.
(* Goal: fun_leq x x *)
by [].
Qed.
Lemma fun_asym x y : fun_leq x y -> fun_leq y x -> x = y.
Proof.
(* Goal: forall (_ : fun_leq x y) (_ : fun_leq y x), @eq (forall _ : A, Poset.sort B) x y *)
move=>H1 H2; apply: fext=>z; by apply: poset_asym; [apply: H1 | apply: H2].
Qed.
Lemma fun_trans x y z : fun_leq x y -> fun_leq y z -> fun_leq x z.
Proof.
(* Goal: forall (_ : fun_leq x y) (_ : fun_leq y z), fun_leq x z *)
by move=>H1 H2 t; apply: poset_trans (H2 t).
Qed.
Definition funPosetMixin := PosetMixin fun_botP fun_refl fun_asym fun_trans.
Canonical funPoset := Eval hnf in Poset tp funPosetMixin.
End FunPoset.
Section DFunPoset.
Variables (A : Type) (B : A -> poset).
Local Notation tp := (forall x, B x).
Definition dfun_bot : tp := fun x => bot.
Definition dfun_leq (p1 p2 : tp) := forall x, p1 x <== p2 x.
Lemma dfun_botP x : dfun_leq dfun_bot x.
Proof.
(* Goal: dfun_leq dfun_bot x *)
by move=>y; apply: botP.
Qed.
Lemma dfun_refl x : dfun_leq x x.
Proof.
(* Goal: dfun_leq x x *)
by [].
Qed.
Lemma dfun_asym x y : dfun_leq x y -> dfun_leq y x -> x = y.
Proof.
(* Goal: forall (_ : dfun_leq x y) (_ : dfun_leq y x), @eq (forall x : A, Poset.sort (B x)) x y *)
move=>H1 H2; apply: fext=>z; by apply: poset_asym; [apply: H1 | apply: H2].
Qed.
Lemma dfun_trans x y z : dfun_leq x y -> dfun_leq y z -> dfun_leq x z.
Proof.
(* Goal: forall (_ : dfun_leq x y) (_ : dfun_leq y z), dfun_leq x z *)
by move=>H1 H2 t; apply: poset_trans (H2 t).
Qed.
Definition dfunPosetMixin :=
PosetMixin dfun_botP dfun_refl dfun_asym dfun_trans.
Definition dfunPoset := Eval hnf in Poset tp dfunPosetMixin.
End DFunPoset.
Section IdealPoset.
Variable (T : poset) (P : T).
Definition ideal_bot := Ideal (botP P).
Definition ideal_leq (p1 p2 : ideal P) := id_val p1 <== id_val p2.
Lemma ideal_botP x : ideal_leq ideal_bot x.
Proof.
(* Goal: ideal_leq ideal_bot x *)
by apply: botP.
Qed.
Lemma ideal_refl x : ideal_leq x x.
Proof.
(* Goal: ideal_leq x x *)
by case: x=>x H; rewrite /ideal_leq.
Qed.
Lemma ideal_asym x y : ideal_leq x y -> ideal_leq y x -> x = y.
Proof.
(* Goal: forall (_ : ideal_leq x y) (_ : ideal_leq y x), @eq (@ideal T P) x y *)
move: x y=>[x1 H1][x2 H2]; rewrite /ideal_leq /= => H3 H4; move: H1 H2.
(* Goal: forall (H1 : @Poset.leq T x1 P) (H2 : @Poset.leq T x2 P), @eq (@ideal T P) (@Ideal T P x1 H1) (@Ideal T P x2 H2) *)
rewrite (poset_asym H3 H4)=>H1 H2.
(* Goal: @eq (@ideal T P) (@Ideal T P x2 H1) (@Ideal T P x2 H2) *)
congr Ideal; apply: proof_irrelevance.
Qed.
Lemma ideal_trans x y z : ideal_leq x y -> ideal_leq y z -> ideal_leq x z.
Proof.
(* Goal: forall (_ : ideal_leq x y) (_ : ideal_leq y z), ideal_leq x z *)
by apply: poset_trans.
Qed.
Definition idealPosetMixin :=
PosetMixin ideal_botP ideal_refl ideal_asym ideal_trans.
Canonical idealPoset := Eval hnf in Poset (ideal P) idealPosetMixin.
End IdealPoset.
Section PropPoset.
Definition prop_bot := False.
Definition prop_leq (p1 p2 : Prop) := p1 -> p2.
Lemma prop_botP x : prop_leq prop_bot x.
Proof.
(* Goal: prop_leq prop_bot x *)
by [].
Qed.
Lemma prop_refl x : prop_leq x x.
Proof.
(* Goal: prop_leq x x *)
by [].
Qed.
Lemma prop_asym x y : prop_leq x y -> prop_leq y x -> x = y.
Proof.
(* Goal: forall (_ : prop_leq x y) (_ : prop_leq y x), @eq Prop x y *)
by move=>H1 H2; apply: pext.
Qed.
Lemma prop_trans x y z : prop_leq x y -> prop_leq y z -> prop_leq x z.
Proof.
(* Goal: forall (_ : prop_leq x y) (_ : prop_leq y z), prop_leq x z *)
by move=>H1 H2; move/H1.
Qed.
Definition propPosetMixin :=
PosetMixin prop_botP prop_refl prop_asym prop_trans.
Canonical propPoset := Eval hnf in Poset Prop propPosetMixin.
End PropPoset.
Section PredPoset.
Variable A : Type.
Definition predPosetMixin : Poset.mixin_of (Pred A) :=
funPosetMixin A propPoset.
Canonical predPoset := Eval hnf in Poset (Pred A) predPosetMixin.
End PredPoset.
Section NatPoset.
Lemma nat_botP x : 0 <= x. Proof. by []. Qed.
Proof.
(* Goal: is_true (leq O x) *)
by [].
Qed.
Lemma nat_asym x y : x <= y -> y <= x -> x = y.
Proof.
(* Goal: forall (_ : is_true (leq x y)) (_ : is_true (leq y x)), @eq nat x y *)
by move=>H1 H2; apply: anti_leq; rewrite H1 H2.
Qed.
Lemma nat_trans x y z : x <= y -> y <= z -> x <= z.
Proof.
(* Goal: forall (_ : is_true (leq x y)) (_ : is_true (leq y z)), is_true (leq x z) *)
by apply: leq_trans.
Qed.
Definition natPosetMixin := PosetMixin nat_botP nat_refl nat_asym nat_trans.
Canonical natPoset := Eval hnf in Poset nat natPosetMixin.
End NatPoset.
Module Lattice.
Section RawMixin.
Variable T : poset.
Record mixin_of := Mixin {
mx_sup : Pred T -> T;
_ : forall (s : Pred T) x, x \In s -> x <== mx_sup s;
_ : forall (s : Pred T) x,
(forall y, y \In s -> y <== x) -> mx_sup s <== x}.
End RawMixin.
Section ClassDef.
Record class_of (T : Type) := Class {
base : Poset.class_of T;
mixin : mixin_of (Poset.Pack base T)}.
Local Coercion base : class_of >-> Poset.class_of.
Structure type : Type := Pack {sort : Type; _ : class_of sort; _ : Type}.
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 T.
Definition pack b0 (m0 : mixin_of (Poset.Pack b0 T)) :=
fun m & phant_id m0 m => Pack (@Class T b0 m) T.
Definition sup (s : Pred cT) : cT := mx_sup (mixin class) s.
Definition poset := Poset.Pack class cT.
End ClassDef.
Module Exports.
Coercion base : class_of >-> Poset.class_of.
Coercion sort : type >-> Sortclass.
Coercion poset : type >-> Poset.type.
Canonical Structure poset.
Notation lattice := Lattice.type.
Notation LatticeMixin := Lattice.Mixin.
Notation Lattice T m := (@pack T _ _ m id).
Notation "[ 'lattice' 'of' T 'for' cT ]" := (@clone T cT _ id)
(at level 0, format "[ 'lattice' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'lattice' 'of' T ]" := (@clone T _ _ id)
(at level 0, format "[ 'lattice' 'of' T ]") : form_scope.
Arguments Lattice.sup [cT].
Prenex Implicits Lattice.sup.
Notation sup := Lattice.sup.
Section Laws.
Variable T : lattice.
Lemma supP (s : Pred T) x : x \In s -> x <== sup s.
Proof.
(* Goal: forall _ : @InMem (sort T) x (@Mem (sort T) (PredPredType (sort T)) s), @Poset.leq (poset T) x (@Lattice.sup T s) *)
by case: T s x=>S [[p]][/= s H1 *]; apply: H1.
Qed.
Lemma supM (s : Pred T) x : (forall y, y \In s -> y <== x) -> sup s <== x.
Proof.
(* Goal: forall _ : forall (y : sort T) (_ : @InMem (sort T) y (@Mem (sort T) (PredPredType (sort T)) s)), @Poset.leq (poset T) y x, @Poset.leq (poset T) (@Lattice.sup T s) x *)
by case: T s x=>S [[p]][/= s H1 H2 *]; apply: (H2).
Qed.
End Laws.
End Exports.
End Lattice.
Export Lattice.Exports.
Section Infimum.
Variable T : lattice.
Definition inf (s : Pred T) :=
sup [Pred x : T | forall y, y \In s -> x <== y].
Lemma infP s : forall x, x \In s -> inf s <== x.
Proof.
(* Goal: forall (x : Lattice.sort T) (_ : @InMem (Lattice.sort T) x (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @Poset.leq (Lattice.poset T) (inf s) x *)
by move=>x H; apply: supM=>y; apply.
Qed.
Lemma infM s : forall x, (forall y, y \In s -> x <== y) -> x <== inf s.
Proof.
(* Goal: forall (x : Poset.sort (Lattice.poset T)) (_ : forall (y : Poset.sort (Lattice.poset T)) (_ : @InMem (Poset.sort (Lattice.poset T)) y (@Mem (Poset.sort (Lattice.poset T)) (PredPredType (Poset.sort (Lattice.poset T))) s)), @Poset.leq (Lattice.poset T) x y), @Poset.leq (Lattice.poset T) x (inf s) *)
by apply: supP.
Qed.
End Infimum.
Section Lat.
Variable T : lattice.
Definition tarski_lfp (f : T -> T) := inf [Pred x : T | f x <== x].
Definition tarski_gfp (f : T -> T) := sup [Pred x : T | x <== f x].
Definition sup_closed (T : lattice) :=
[Pred s : Pred T |
bot \In s /\ forall d, d <=p s -> sup d \In s].
Definition sup_closure (T : lattice) (s : Pred T) :=
[Pred p : T | forall t : Pred T, s <=p t -> t \In sup_closed T -> p \In t].
End Lat.
Arguments sup_closed [T].
Arguments sup_closure [T].
Prenex Implicits sup_closed sup_closure.
Section BasicProperties.
Variable T : lattice.
Lemma sup_mono (s1 s2 : Pred T) : s1 <=p s2 -> sup s1 <== sup s2.
Proof.
(* Goal: forall _ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s1) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s2), @Poset.leq (Lattice.poset T) (@Lattice.sup T s1) (@Lattice.sup T s2) *)
by move=>H; apply: supM=>y; move/H; apply: supP.
Qed.
Lemma supE (s1 s2 : Pred T) : s1 =p s2 -> sup s1 = sup s2.
Proof.
(* Goal: forall _ : @EqMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s1) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s2), @eq (Lattice.sort T) (@Lattice.sup T s1) (@Lattice.sup T s2) *)
by move=>H; apply: poset_asym; apply: supM=>y; move/H; apply: supP.
Qed.
Lemma tarski_lfp_fixed (f : T -> T) :
monotone f -> f (tarski_lfp f) = tarski_lfp f.
Proof.
(* Goal: forall _ : @monotone (Lattice.poset T) (Lattice.poset T) f, @eq (Lattice.sort T) (f (@tarski_lfp T f)) (@tarski_lfp T f) *)
move=>M; suff L: f (tarski_lfp f) <== tarski_lfp f.
(* Goal: @Poset.leq (Lattice.poset T) (f (@tarski_lfp T f)) (@tarski_lfp T f) *)
(* Goal: @eq (Lattice.sort T) (f (@tarski_lfp T f)) (@tarski_lfp T f) *)
-
(* Goal: @Poset.leq (Lattice.poset T) (f (@tarski_lfp T f)) (@tarski_lfp T f) *)
(* Goal: @eq (Lattice.sort T) (f (@tarski_lfp T f)) (@tarski_lfp T f) *)
by apply: poset_asym=>//; apply: infP; apply: M L.
(* Goal: @Poset.leq (Lattice.poset T) (f (@tarski_lfp T f)) (@tarski_lfp T f) *)
by apply: infM=>x L; apply: poset_trans (L); apply: M; apply: infP.
Qed.
Lemma tarski_lfp_least f : forall x : T, f x = x -> tarski_lfp f <== x.
Proof.
(* Goal: forall (x : Lattice.sort T) (_ : @eq (Lattice.sort T) (f x) x), @Poset.leq (Lattice.poset T) (@tarski_lfp T f) x *)
by move=>x H; apply: infP; rewrite InE /= H.
Qed.
Lemma tarski_gfp_fixed (f : T -> T) :
monotone f -> f (tarski_gfp f) = tarski_gfp f.
Proof.
(* Goal: forall _ : @monotone (Lattice.poset T) (Lattice.poset T) f, @eq (Lattice.sort T) (f (@tarski_gfp T f)) (@tarski_gfp T f) *)
move=>M; suff L: tarski_gfp f <== f (tarski_gfp f).
(* Goal: @Poset.leq (Lattice.poset T) (@tarski_gfp T f) (f (@tarski_gfp T f)) *)
(* Goal: @eq (Lattice.sort T) (f (@tarski_gfp T f)) (@tarski_gfp T f) *)
-
(* Goal: @Poset.leq (Lattice.poset T) (@tarski_gfp T f) (f (@tarski_gfp T f)) *)
(* Goal: @eq (Lattice.sort T) (f (@tarski_gfp T f)) (@tarski_gfp T f) *)
by apply: poset_asym=>//; apply: supP; apply: M L.
(* Goal: @Poset.leq (Lattice.poset T) (@tarski_gfp T f) (f (@tarski_gfp T f)) *)
by apply: supM=>x L; apply: poset_trans (L) _; apply: M; apply: supP.
Qed.
Lemma tarski_gfp_greatest f : forall x : T, f x = x -> x <== tarski_gfp f.
Proof.
(* Goal: forall (x : Lattice.sort T) (_ : @eq (Lattice.sort T) (f x) x), @Poset.leq (Lattice.poset T) x (@tarski_gfp T f) *)
by move=>x H; apply: supP; rewrite InE /= H.
Qed.
Lemma sup_clos_sub (s : Pred T) : s <=p sup_closure s.
Proof.
(* Goal: @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s) (@Mem (Lattice.sort T) (SimplPredPredType (Lattice.sort T)) (@sup_closure T s)) *)
by move=>p H1 t H2 H3; apply: H2 H1.
Qed.
Lemma sup_clos_min (s : Pred T) :
forall t, s <=p t -> sup_closed t -> sup_closure s <=p t.
Proof.
(* Goal: forall (t : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) t)) (_ : @Pred_of_Simpl (Pred (Lattice.sort T)) (@sup_closed T) t), @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (SimplPredPredType (Lattice.sort T)) (@sup_closure T s)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) t) *)
by move=>t H1 H2 p; move/(_ _ H1 H2).
Qed.
Lemma sup_closP (s : Pred T) : sup_closed (sup_closure s).
Proof.
(* Goal: @Pred_of_Simpl (Pred (Lattice.sort T)) (@sup_closed T) (@Pred_of_Simpl (Lattice.sort T) (@sup_closure T s)) *)
split; first by move=>t _ [].
(* Goal: forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) (@Pred_of_Simpl (Lattice.sort T) (@sup_closure T s)))), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) (@Pred_of_Simpl (Lattice.sort T) (@sup_closure T s))) *)
move=>d H1 t H3 H4; move: (sup_clos_min H3 H4)=>{H3} H3.
(* Goal: @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) t) *)
by case: H4=>_; apply=>// x; move/H1; move/H3.
Qed.
Lemma sup_clos_idemp (s : Pred T) : sup_closed s -> sup_closure s =p s.
Proof.
(* Goal: forall _ : @Pred_of_Simpl (Pred (Lattice.sort T)) (@sup_closed T) s, @EqMem (Lattice.sort T) (@Mem (Lattice.sort T) (SimplPredPredType (Lattice.sort T)) (@sup_closure T s)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s) *)
by move=>p; split; [apply: sup_clos_min | apply: sup_clos_sub].
Qed.
Lemma sup_clos_mono (s1 s2 : Pred T) :
s1 <=p s2 -> sup_closure s1 <=p sup_closure s2.
Proof.
(* Goal: forall _ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s1) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s2), @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (SimplPredPredType (Lattice.sort T)) (@sup_closure T s1)) (@Mem (Lattice.sort T) (SimplPredPredType (Lattice.sort T)) (@sup_closure T s2)) *)
move=>H1; apply: sup_clos_min (sup_closP s2)=>p H2.
(* Goal: @InMem (Lattice.sort T) p (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) (@Pred_of_Simpl (Lattice.sort T) (@sup_closure T s2))) *)
by apply: sup_clos_sub; apply: H1.
Qed.
End BasicProperties.
Section SubLattice.
Variables (T : lattice) (s : Pred T) (C : sup_closed s).
Local Notation tp := (subPoset (proj1 C)).
Definition sub_sup' (u : Pred tp) : T :=
sup [Pred x : T | exists y, y \In u /\ x = sval y].
Lemma sub_supX (u : Pred tp) : sub_sup' u \In s.
Proof.
(* Goal: @InMem (Lattice.sort T) (sub_sup' u) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s) *)
by case: C u=>P /= H u; apply: H=>t [[y]] H1 [_] ->.
Qed.
Definition sub_sup (u : Pred tp) : tp :=
exist _ (sub_sup' u) (sub_supX u).
Lemma sub_supP (u : Pred tp) (x : tp) : x \In u -> x <== sub_sup u.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C))) x (@Mem (Poset.sort (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C))) (PredPredType (Poset.sort (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C)))) u), @Poset.leq (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C)) x (sub_sup u) *)
by move=>H; apply: supP; exists x.
Qed.
Lemma sub_supM (u : Pred tp) (x : tp) :
(forall y, y \In u -> y <== x) -> sub_sup u <== x.
Proof.
(* Goal: forall _ : forall (y : Poset.sort (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C))) (_ : @InMem (Poset.sort (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C))) y (@Mem (Poset.sort (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C))) (PredPredType (Poset.sort (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C)))) u)), @Poset.leq (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C)) y x, @Poset.leq (@subPoset (Lattice.poset T) s (@proj1 (@InMem (Poset.sort (Lattice.poset T)) (@Poset.bot (Lattice.poset T)) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) (forall (d : @Pred_Sort (Lattice.sort T) (PredPredType (Lattice.sort T))) (_ : @SubMem (Lattice.sort T) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)), @InMem (Lattice.sort T) (@Lattice.sup T d) (@Mem (Lattice.sort T) (PredPredType (Lattice.sort T)) s)) C)) (sub_sup u) x *)
by move=>H; apply: supM=>y [z][H1] ->; apply: H H1.
Qed.
Definition subLatticeMixin := LatticeMixin sub_supP sub_supM.
Definition subLattice := Eval hnf in Lattice {x : T | x \In s} subLatticeMixin.
End SubLattice.
Section PairLattice.
Variables (A B : lattice).
Local Notation tp := (A * B)%type.
Definition pair_sup (s : Pred tp) : tp :=
(sup [Pred p | exists f, p = f.1 /\ f \In s],
sup [Pred p | exists f, p = f.2 /\ f \In s]).
Lemma pair_supP (s : Pred tp) (p : tp) : p \In s -> p <== pair_sup s.
Proof.
(* Goal: forall _ : @InMem (prod (Lattice.sort A) (Lattice.sort B)) p (@Mem (prod (Lattice.sort A) (Lattice.sort B)) (PredPredType (prod (Lattice.sort A) (Lattice.sort B))) s), @Poset.leq (pairPoset (Lattice.poset A) (Lattice.poset B)) p (pair_sup s) *)
by move=>H; split; apply: supP; exists p.
Qed.
Lemma pair_supM (s : Pred tp) (p : tp) :
(forall q, q \In s -> q <== p) -> pair_sup s <== p.
Proof.
(* Goal: forall _ : forall (q : prod (Lattice.sort A) (Lattice.sort B)) (_ : @InMem (prod (Lattice.sort A) (Lattice.sort B)) q (@Mem (prod (Lattice.sort A) (Lattice.sort B)) (PredPredType (prod (Lattice.sort A) (Lattice.sort B))) s)), @Poset.leq (pairPoset (Lattice.poset A) (Lattice.poset B)) q p, @Poset.leq (pairPoset (Lattice.poset A) (Lattice.poset B)) (pair_sup s) p *)
by move=>H; split; apply: supM=>y [f][->]; case/H.
Qed.
Definition pairLatticeMixin := LatticeMixin pair_supP pair_supM.
Canonical pairLattice := Eval hnf in Lattice tp pairLatticeMixin.
End PairLattice.
Section FunLattice.
Variables (A : Type) (B : lattice).
Local Notation tp := (A -> B).
Definition fun_sup (s : Pred tp) : tp :=
fun x => sup [Pred p | exists f, f \In s /\ p = f x].
Lemma fun_supP (s : Pred tp) (p : tp) : p \In s -> p <== fun_sup s.
Proof.
(* Goal: forall _ : @InMem (forall _ : A, Lattice.sort B) p (@Mem (forall _ : A, Lattice.sort B) (PredPredType (forall _ : A, Lattice.sort B)) s), @Poset.leq (funPoset A (Lattice.poset B)) p (fun_sup s) *)
by move=>H x; apply: supP; exists p.
Qed.
Lemma fun_supM (s : Pred tp) (p : tp) :
(forall q, q \In s -> q <== p) -> fun_sup s <== p.
Proof.
(* Goal: forall _ : forall (q : forall _ : A, Lattice.sort B) (_ : @InMem (forall _ : A, Lattice.sort B) q (@Mem (forall _ : A, Lattice.sort B) (PredPredType (forall _ : A, Lattice.sort B)) s)), @Poset.leq (funPoset A (Lattice.poset B)) q p, @Poset.leq (funPoset A (Lattice.poset B)) (fun_sup s) p *)
by move=>H t; apply: supM=>x [f][H1] ->; apply: H.
Qed.
Definition funLatticeMixin := LatticeMixin fun_supP fun_supM.
Canonical funLattice := Eval hnf in Lattice tp funLatticeMixin.
End FunLattice.
Section DFunLattice.
Variables (A : Type) (B : A -> lattice).
Local Notation tp := (dfunPoset B).
Definition dfun_sup (s : Pred tp) : tp :=
fun x => sup [Pred p | exists f, f \In s /\ p = f x].
Lemma dfun_supP (s : Pred tp) (p : tp) :
p \In s -> p <== dfun_sup s.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (@dfunPoset A (fun x : A => Lattice.poset (B x)))) p (@Mem (Poset.sort (@dfunPoset A (fun x : A => Lattice.poset (B x)))) (PredPredType (Poset.sort (@dfunPoset A (fun x : A => Lattice.poset (B x))))) s), @Poset.leq (@dfunPoset A (fun x : A => Lattice.poset (B x))) p (dfun_sup s) *)
by move=>H x; apply: supP; exists p.
Qed.
Lemma dfun_supM (s : Pred tp) (p : tp) :
(forall q, q \In s -> q <== p) -> dfun_sup s <== p.
Proof.
(* Goal: forall _ : forall (q : Poset.sort (@dfunPoset A (fun x : A => Lattice.poset (B x)))) (_ : @InMem (Poset.sort (@dfunPoset A (fun x : A => Lattice.poset (B x)))) q (@Mem (Poset.sort (@dfunPoset A (fun x : A => Lattice.poset (B x)))) (PredPredType (Poset.sort (@dfunPoset A (fun x : A => Lattice.poset (B x))))) s)), @Poset.leq (@dfunPoset A (fun x : A => Lattice.poset (B x))) q p, @Poset.leq (@dfunPoset A (fun x : A => Lattice.poset (B x))) (dfun_sup s) p *)
by move=>H t; apply: supM=>x [f][H1] ->; apply: H.
Qed.
Definition dfunLatticeMixin := LatticeMixin dfun_supP dfun_supM.
Definition dfunLattice := Eval hnf in Lattice (forall x, B x) dfunLatticeMixin.
End DFunLattice.
Lemma sup_appE A (B : lattice) (s : Pred (A -> B)) (x : A) :
sup s x = sup [Pred y : B | exists f, f \In s /\ y = f x].
Proof.
(* Goal: @eq (Lattice.sort B) (@Lattice.sup (funLattice A B) s x) (@Lattice.sup B (@Pred_of_Simpl (Lattice.sort B) (@SimplPred (Lattice.sort B) (fun y : Lattice.sort B => @ex (forall _ : A, Lattice.sort B) (fun f : forall _ : A, Lattice.sort B => and (@InMem (forall _ : A, Lattice.sort B) f (@Mem (forall _ : A, Lattice.sort B) (PredPredType (forall _ : A, Lattice.sort B)) s)) (@eq (Lattice.sort B) y (f x))))))) *)
by [].
Qed.
Lemma sup_dappE A (B : A -> lattice) (s : Pred (dfunLattice B)) (x : A) :
sup s x = sup [Pred y : B x | exists f, f \In s /\ y = f x].
Proof.
(* Goal: @eq (Lattice.sort (B x)) (@Lattice.sup (@dfunLattice A B) s x) (@Lattice.sup (B x) (@Pred_of_Simpl (Lattice.sort (B x)) (@SimplPred (Lattice.sort (B x)) (fun y : Lattice.sort (B x) => @ex (Lattice.sort (@dfunLattice A B)) (fun f : Lattice.sort (@dfunLattice A B) => and (@InMem (Lattice.sort (@dfunLattice A B)) f (@Mem (Lattice.sort (@dfunLattice A B)) (PredPredType (Lattice.sort (@dfunLattice A B))) s)) (@eq (Lattice.sort (B x)) y (f x))))))) *)
by [].
Qed.
Section IdealLattice.
Variables (T : lattice) (P : T).
Definition ideal_sup' (s : Pred (ideal P)) :=
sup [Pred x | exists p, p \In s /\ id_val p = x].
Lemma ideal_supP' (s : Pred (ideal P)) : ideal_sup' s <== P.
Proof.
(* Goal: @Poset.leq (Lattice.poset T) (ideal_sup' s) P *)
by apply: supM=>y [[x]] H /= [_] <-.
Qed.
Definition ideal_sup (s : Pred (ideal P)) := Ideal (ideal_supP' s).
Lemma ideal_supP (s : Pred (ideal P)) p :
p \In s -> p <== ideal_sup s.
Proof.
(* Goal: forall _ : @InMem (@ideal (Lattice.poset T) P) p (@Mem (@ideal (Lattice.poset T) P) (PredPredType (@ideal (Lattice.poset T) P)) s), @Poset.leq (@idealPoset (Lattice.poset T) P) p (ideal_sup s) *)
by move=>H; apply: supP; exists p.
Qed.
Lemma ideal_supM (s : Pred (ideal P)) p :
(forall q, q \In s -> q <== p) -> ideal_sup s <== p.
Proof.
(* Goal: forall _ : forall (q : @ideal (Lattice.poset T) P) (_ : @InMem (@ideal (Lattice.poset T) P) q (@Mem (@ideal (Lattice.poset T) P) (PredPredType (@ideal (Lattice.poset T) P)) s)), @Poset.leq (@idealPoset (Lattice.poset T) P) q p, @Poset.leq (@idealPoset (Lattice.poset T) P) (ideal_sup s) p *)
by move=>H; apply: supM=>y [q][H1] <-; apply: H.
Qed.
Definition idealLatticeMixin := LatticeMixin ideal_supP ideal_supM.
Canonical idealLattice := Eval hnf in Lattice (ideal P) idealLatticeMixin.
End IdealLattice.
Section PropLattice.
Definition prop_sup (s : Pred Prop) : Prop := exists p, p \In s /\ p.
Lemma prop_supP (s : Pred Prop) p : p \In s -> p <== prop_sup s.
Proof.
(* Goal: forall _ : @InMem Prop p (@Mem Prop (PredPredType Prop) s), @Poset.leq propPoset p (prop_sup s) *)
by exists p.
Qed.
Lemma prop_supM (s : Pred Prop) p :
(forall q, q \In s -> q <== p) -> prop_sup s <== p.
Proof.
(* Goal: forall _ : forall (q : Prop) (_ : @InMem Prop q (@Mem Prop (PredPredType Prop) s)), @Poset.leq propPoset q p, @Poset.leq propPoset (prop_sup s) p *)
by move=>H [r][]; move/H.
Qed.
Definition propLatticeMixin := LatticeMixin prop_supP prop_supM.
Canonical propLattice := Eval hnf in Lattice Prop propLatticeMixin.
End PropLattice.
Section PredLattice.
Variable A : Type.
Definition predLatticeMixin := funLatticeMixin A propLattice.
Canonical predLattice := Eval hnf in Lattice (Pred A) predLatticeMixin.
End PredLattice.
Section Chains.
Variable T : poset.
Definition chain_axiom (s : Pred T) :=
(exists d, d \In s) /\
(forall x y, x \In s -> y \In s -> x <== y \/ y <== x).
Structure chain := Chain {
pred_of :> Pred T;
_ : chain_axiom pred_of}.
Canonical chainPredType := @mkPredType T chain pred_of.
End Chains.
Lemma chainE (T : poset) (s1 s2 : chain T) :
s1 = s2 <-> pred_of s1 =p pred_of s2.
Proof.
(* Goal: iff (@eq (chain T) s1 s2) (@EqMem (Poset.sort T) (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) (@pred_of T s1)) (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) (@pred_of T s2))) *)
split=>[->//|]; move: s1 s2=>[s1 H1][s2 H2] /= E; move: H1 H2.
(* Goal: forall (H1 : @chain_axiom T s1) (H2 : @chain_axiom T s2), @eq (chain T) (@Chain T s1 H1) (@Chain T s2 H2) *)
suff: s1 = s2 by move=>-> H1 H2; congr Chain; apply: proof_irrelevance.
(* Goal: @eq (Pred (Poset.sort T)) s1 s2 *)
by apply: fext=>x; apply: pext; split; move/E.
Qed.
Section LiftChain.
Variable (T : poset) (s : chain T).
Lemma lift_chainP : chain_axiom [Pred x : T | x = bot \/ x \In s].
Proof.
(* Goal: @chain_axiom T (@Pred_of_Simpl (Poset.sort T) (@SimplPred (Poset.sort T) (fun x : Poset.sort T => or (@eq (Poset.sort T) x (@Poset.bot T)) (@InMem (Poset.sort T) x (@Mem (Poset.sort T) (chainPredType T) s))))) *)
case: s=>p [[d H1] H2] /=; split=>[|x y]; first by exists d; right.
(* Goal: forall (_ : @InMem (Poset.sort T) x (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) (@Pred_of_Simpl (Poset.sort T) (@SimplPred (Poset.sort T) (fun x : Poset.sort T => or (@eq (Poset.sort T) x (@Poset.bot T)) (@InMem (Poset.sort T) x (@Mem (Poset.sort T) (chainPredType T) (@Chain T p (@conj (@ex (Poset.sort T) (fun d : Poset.sort T => @InMem (Poset.sort T) d (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p))) (forall (x0 y : Poset.sort T) (_ : @InMem (Poset.sort T) x0 (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p)) (_ : @InMem (Poset.sort T) y (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p)), or (@Poset.leq T x0 y) (@Poset.leq T y x0)) (@ex_intro (Poset.sort T) (fun d : Poset.sort T => @InMem (Poset.sort T) d (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p)) d H1) H2))))))))) (_ : @InMem (Poset.sort T) y (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) (@Pred_of_Simpl (Poset.sort T) (@SimplPred (Poset.sort T) (fun x : Poset.sort T => or (@eq (Poset.sort T) x (@Poset.bot T)) (@InMem (Poset.sort T) x (@Mem (Poset.sort T) (chainPredType T) (@Chain T p (@conj (@ex (Poset.sort T) (fun d : Poset.sort T => @InMem (Poset.sort T) d (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p))) (forall (x0 y : Poset.sort T) (_ : @InMem (Poset.sort T) x0 (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p)) (_ : @InMem (Poset.sort T) y (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p)), or (@Poset.leq T x0 y) (@Poset.leq T y x0)) (@ex_intro (Poset.sort T) (fun d : Poset.sort T => @InMem (Poset.sort T) d (@Mem (Poset.sort T) (PredPredType (Poset.sort T)) p)) d H1) H2))))))))), or (@Poset.leq T x y) (@Poset.leq T y x) *)
by case=>[->|H3][->|H4]; auto.
Qed.
Definition lift_chain := Chain lift_chainP.
End LiftChain.
Section ImageChain.
Variables (T1 T2 : poset) (s : chain T1) (f : T1 -> T2) (M : monotone f).
Lemma image_chainP :
chain_axiom [Pred x2 : T2 | exists x1, x2 = f x1 /\ x1 \In s].
Proof.
(* Goal: @chain_axiom T2 (@Pred_of_Simpl (Poset.sort T2) (@SimplPred (Poset.sort T2) (fun x2 : Poset.sort T2 => @ex (Poset.sort T1) (fun x1 : Poset.sort T1 => and (@eq (Poset.sort T2) x2 (f x1)) (@InMem (Poset.sort T1) x1 (@Mem (Poset.sort T1) (chainPredType T1) s)))))) *)
case: s=>p [[d H1] H2]; split=>[|x y]; first by exists (f d); exists d.
(* Goal: forall (_ : @InMem (Poset.sort T2) x (@Mem (Poset.sort T2) (PredPredType (Poset.sort T2)) (@Pred_of_Simpl (Poset.sort T2) (@SimplPred (Poset.sort T2) (fun x2 : Poset.sort T2 => @ex (Poset.sort T1) (fun x1 : Poset.sort T1 => and (@eq (Poset.sort T2) x2 (f x1)) (@InMem (Poset.sort T1) x1 (@Mem (Poset.sort T1) (chainPredType T1) (@Chain T1 p (@conj (@ex (Poset.sort T1) (fun d : Poset.sort T1 => @InMem (Poset.sort T1) d (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p))) (forall (x y : Poset.sort T1) (_ : @InMem (Poset.sort T1) x (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p)) (_ : @InMem (Poset.sort T1) y (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p)), or (@Poset.leq T1 x y) (@Poset.leq T1 y x)) (@ex_intro (Poset.sort T1) (fun d : Poset.sort T1 => @InMem (Poset.sort T1) d (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p)) d H1) H2)))))))))) (_ : @InMem (Poset.sort T2) y (@Mem (Poset.sort T2) (PredPredType (Poset.sort T2)) (@Pred_of_Simpl (Poset.sort T2) (@SimplPred (Poset.sort T2) (fun x2 : Poset.sort T2 => @ex (Poset.sort T1) (fun x1 : Poset.sort T1 => and (@eq (Poset.sort T2) x2 (f x1)) (@InMem (Poset.sort T1) x1 (@Mem (Poset.sort T1) (chainPredType T1) (@Chain T1 p (@conj (@ex (Poset.sort T1) (fun d : Poset.sort T1 => @InMem (Poset.sort T1) d (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p))) (forall (x y : Poset.sort T1) (_ : @InMem (Poset.sort T1) x (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p)) (_ : @InMem (Poset.sort T1) y (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p)), or (@Poset.leq T1 x y) (@Poset.leq T1 y x)) (@ex_intro (Poset.sort T1) (fun d : Poset.sort T1 => @InMem (Poset.sort T1) d (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) p)) d H1) H2)))))))))), or (@Poset.leq T2 x y) (@Poset.leq T2 y x) *)
case=>x1 [->] H3 [y1][->] H4; rewrite -!toPredE /= in H3 H4.
(* Goal: or (@Poset.leq T2 (f x1) (f y1)) (@Poset.leq T2 (f y1) (f x1)) *)
by case: (H2 x1 y1 H3 H4)=>L; [left | right]; apply: M L.
Qed.
Definition image_chain := Chain image_chainP.
End ImageChain.
Notation "[ f '^^' s 'by' M ]" := (@image_chain _ _ s f M)
(at level 0, format "[ f '^^' s 'by' M ]") : form_scope.
Section ChainId.
Variables (T : poset) (s : chain T).
Lemma id_mono : monotone (@id T).
Proof.
(* Goal: @monotone T T (fun x : Poset.sort T => x) *)
by [].
Qed.
Lemma id_chainE (M : monotone id) : [id ^^ s by M] = s.
Proof.
(* Goal: @eq (chain T) (@image_chain T T s (fun x : Poset.sort T => x) M) s *)
by apply/chainE=>x; split; [case=>y [<-]|exists x].
Qed.
End ChainId.
Arguments id_mono [T].
Prenex Implicits id_mono.
Section ChainConst.
Variables (T1 T2 : poset) (y : T2).
Lemma const_mono : monotone (fun x : T1 => y).
Proof.
(* Goal: @monotone T1 T2 (fun _ : Poset.sort T1 => y) *)
by [].
Qed.
Lemma const_chainP : chain_axiom (Pred1 y).
Proof.
(* Goal: @chain_axiom T2 (@Pred_of_Simpl (Poset.sort T2) (@Pred1 (Poset.sort T2) y)) *)
by split; [exists y | move=>x1 x2 ->->; left].
Qed.
Definition const_chain := Chain const_chainP.
Lemma const_chainE s : [_ ^^ s by const_mono] = const_chain.
Proof.
(* Goal: @eq (chain T2) (@image_chain T1 T2 s (fun _ : Poset.sort T1 => y) const_mono) const_chain *)
apply/chainE=>z1; split; first by case=>z2 [->].
(* Goal: forall _ : @InMem (Poset.sort T2) z1 (@Mem (Poset.sort T2) (PredPredType (Poset.sort T2)) (@pred_of T2 const_chain)), @InMem (Poset.sort T2) z1 (@Mem (Poset.sort T2) (PredPredType (Poset.sort T2)) (@pred_of T2 (@image_chain T1 T2 s (fun _ : Poset.sort T1 => y) const_mono))) *)
by case: s=>s [[d] H1] H2; move=><-; exists d.
Qed.
End ChainConst.
Arguments const_mono [T1 T2 y].
Prenex Implicits const_mono.
Section ChainCompose.
Variables (T1 T2 T3 : poset) (f1 : T2 -> T1) (f2 : T3 -> T2).
Variables (s : chain T3) (M1 : monotone f1) (M2 : monotone f2).
Lemma comp_mono : monotone (f1 \o f2).
Proof.
(* Goal: @monotone T3 T1 (@funcomp (Poset.sort T1) (Poset.sort T2) (Poset.sort T3) tt f1 f2) *)
by move=>x y H; apply: M1; apply: M2.
Qed.
Lemma comp_chainE :
[f1 ^^ [f2 ^^ s by M2] by M1] = [f1 \o f2 ^^ s by comp_mono].
Proof.
(* Goal: @eq (chain T1) (@image_chain T2 T1 (@image_chain T3 T2 s f2 M2) f1 M1) (@image_chain T3 T1 s (@funcomp (Poset.sort T1) (Poset.sort T2) (Poset.sort T3) tt f1 f2) comp_mono) *)
apply/chainE=>x1; split; first by case=>x2 [->][x3][->]; exists x3.
(* Goal: forall _ : @InMem (Poset.sort T1) x1 (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) (@pred_of T1 (@image_chain T3 T1 s (@funcomp (Poset.sort T1) (Poset.sort T2) (Poset.sort T3) tt f1 f2) comp_mono))), @InMem (Poset.sort T1) x1 (@Mem (Poset.sort T1) (PredPredType (Poset.sort T1)) (@pred_of T1 (@image_chain T2 T1 (@image_chain T3 T2 s f2 M2) f1 M1))) *)
by case=>x3 [->]; exists (f2 x3); split=>//; exists x3.
Qed.
End ChainCompose.
Arguments comp_mono [T1 T2 T3 f1 f2].
Prenex Implicits comp_mono.
Section ProjChain.
Variables (T1 T2 : poset) (s : chain [poset of T1 * T2]).
Lemma proj1_mono : monotone (@fst T1 T2).
Proof.
(* Goal: @monotone (pairPoset T1 T2) T1 (@fst (Poset.sort T1) (Poset.sort T2)) *)
by case=>x1 x2 [y1 y2][].
Qed.
Lemma proj2_mono : monotone (@snd T1 T2).
Proof.
(* Goal: @monotone (pairPoset T1 T2) T2 (@snd (Poset.sort T1) (Poset.sort T2)) *)
by case=>x1 x2 [y1 y2][].
Qed.
Definition proj1_chain := [@fst _ _ ^^ s by proj1_mono].
Definition proj2_chain := [@snd _ _ ^^ s by proj2_mono].
End ProjChain.
Arguments proj1_mono [T1 T2].
Arguments proj2_mono [T1 T2].
Prenex Implicits proj1_mono proj2_mono.
Section DiagChain.
Variable (T : poset) (s : chain T).
Lemma diag_mono : monotone (fun x : T => (x, x)).
Proof.
(* Goal: @monotone T (pairPoset T T) (fun x : Poset.sort T => @pair (Poset.sort T) (Poset.sort T) x x) *)
by [].
Qed.
Definition diag_chain := [_ ^^ s by diag_mono].
Lemma proj1_diagE : proj1_chain diag_chain = s.
Proof.
(* Goal: @eq (chain T) (@proj1_chain T T diag_chain) s *)
by rewrite /proj1_chain /diag_chain comp_chainE id_chainE.
Qed.
Lemma proj2_diagE : proj2_chain diag_chain = s.
Proof.
(* Goal: @eq (chain T) (@proj2_chain T T diag_chain) s *)
by rewrite /proj2_chain /diag_chain comp_chainE id_chainE.
Qed.
End DiagChain.
Arguments diag_mono [T].
Prenex Implicits diag_mono.
Section AppChain.
Variables (A : Type) (T : poset) (s : chain [poset of A -> T]).
Lemma app_mono x : monotone (fun f : A -> T => f x).
Proof.
(* Goal: @monotone (funPoset A T) T (fun f : forall _ : A, Poset.sort T => f x) *)
by move=>f1 f2; apply.
Qed.
Definition app_chain x := [_ ^^ s by app_mono x].
End AppChain.
Arguments app_mono [A T].
Prenex Implicits app_mono.
Section DAppChain.
Variables (A : Type) (T : A -> poset) (s : chain (dfunPoset T)).
Lemma dapp_mono x : monotone (fun f : dfunPoset T => f x).
Proof.
(* Goal: @monotone (@dfunPoset A T) (T x) (fun f : Poset.sort (@dfunPoset A T) => f x) *)
by move=>f1 f2; apply.
Qed.
Definition dapp_chain x := [_ ^^ s by dapp_mono x].
End DAppChain.
Arguments dapp_mono [A T].
Prenex Implicits dapp_mono.
Section ProdChain.
Variables (S1 S2 T1 T2 : poset) (f1 : S1 -> T1) (f2 : S2 -> T2).
Variables (M1 : monotone f1) (M2 : monotone f2).
Variable (s : chain [poset of S1 * S2]).
Lemma prod_mono : monotone (f1 \* f2).
Proof.
(* Goal: @monotone (pairPoset S1 S2) (pairPoset T1 T2) (@fprod (Poset.sort S1) (Poset.sort S2) (Poset.sort T1) (Poset.sort T2) f1 f2) *)
by case=>x1 x2 [y1 y2][/= H1 H2]; split; [apply: M1 | apply: M2].
Qed.
Definition prod_chain := [f1 \* f2 ^^ s by prod_mono].
Lemma proj1_prodE : proj1_chain prod_chain = [f1 ^^ proj1_chain s by M1].
Proof.
(* Goal: @eq (chain T1) (@proj1_chain T1 T2 prod_chain) (@image_chain S1 T1 (@proj1_chain S1 S2 s) f1 M1) *)
rewrite /proj1_chain /prod_chain !comp_chainE !/comp /=.
(* Goal: @eq (chain T1) (@image_chain (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) T1 s (fun x : prod (Poset.sort S1) (Poset.sort S2) => f1 (@fst (Poset.sort S1) (Poset.sort S2) x)) (@comp_mono T1 (@Poset.clone (prod (Poset.sort T1) (Poset.sort T2)) (pairPoset T1 T2) (@Poset.Class (prod (Poset.sort T1) (Poset.sort T2)) (pairPosetMixin T1 T2)) (fun x : phantom (Poset.class_of (prod (Poset.sort T1) (Poset.sort T2))) (@Poset.Class (prod (Poset.sort T1) (Poset.sort T2)) (pairPosetMixin T1 T2)) => x)) (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) (@fst (Poset.sort T1) (Poset.sort T2)) (@fprod (Poset.sort S1) (Poset.sort S2) (Poset.sort T1) (Poset.sort T2) f1 f2) (@proj1_mono T1 T2) prod_mono)) (@image_chain (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) T1 s (fun x : prod (Poset.sort S1) (Poset.sort S2) => f1 (@fst (Poset.sort S1) (Poset.sort S2) x)) (@comp_mono T1 S1 (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) f1 (@fst (Poset.sort S1) (Poset.sort S2)) M1 (@proj1_mono S1 S2))) *)
by apply/chainE.
Qed.
Lemma proj2_prodE : proj2_chain prod_chain = [f2 ^^ proj2_chain s by M2].
Proof.
(* Goal: @eq (chain T2) (@proj2_chain T1 T2 prod_chain) (@image_chain S2 T2 (@proj2_chain S1 S2 s) f2 M2) *)
rewrite /proj2_chain /prod_chain !comp_chainE !/comp /=.
(* Goal: @eq (chain T2) (@image_chain (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) T2 s (fun x : prod (Poset.sort S1) (Poset.sort S2) => f2 (@snd (Poset.sort S1) (Poset.sort S2) x)) (@comp_mono T2 (@Poset.clone (prod (Poset.sort T1) (Poset.sort T2)) (pairPoset T1 T2) (@Poset.Class (prod (Poset.sort T1) (Poset.sort T2)) (pairPosetMixin T1 T2)) (fun x : phantom (Poset.class_of (prod (Poset.sort T1) (Poset.sort T2))) (@Poset.Class (prod (Poset.sort T1) (Poset.sort T2)) (pairPosetMixin T1 T2)) => x)) (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) (@snd (Poset.sort T1) (Poset.sort T2)) (@fprod (Poset.sort S1) (Poset.sort S2) (Poset.sort T1) (Poset.sort T2) f1 f2) (@proj2_mono T1 T2) prod_mono)) (@image_chain (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) T2 s (fun x : prod (Poset.sort S1) (Poset.sort S2) => f2 (@snd (Poset.sort S1) (Poset.sort S2) x)) (@comp_mono T2 S2 (@Poset.clone (prod (Poset.sort S1) (Poset.sort S2)) (pairPoset S1 S2) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) (fun x : phantom (Poset.class_of (prod (Poset.sort S1) (Poset.sort S2))) (@Poset.Class (prod (Poset.sort S1) (Poset.sort S2)) (pairPosetMixin S1 S2)) => x)) f2 (@snd (Poset.sort S1) (Poset.sort S2)) M2 (@proj2_mono S1 S2))) *)
by apply/chainE.
Qed.
End ProdChain.
Arguments prod_mono [S1 S2 T1 T2 f1 f2].
Prenex Implicits prod_mono.
Section NatChain.
Lemma nat_chain_axiom : chain_axiom (@PredT nat).
Proof.
(* Goal: @chain_axiom natPoset (@Pred_of_Simpl nat (@PredT nat)) *)
split=>[|x y _ _]; first by exists 0.
(* Goal: or (@Poset.leq natPoset x y) (@Poset.leq natPoset y x) *)
rewrite /Poset.leq /= [y <= x]leq_eqVlt.
(* Goal: or (is_true (leq x y)) (is_true (orb (@eq_op nat_eqType y x) (leq (S y) x))) *)
by case: leqP; [left | rewrite orbT; right].
Qed.
Definition nat_chain := Chain nat_chain_axiom.
End NatChain.
Module CPO.
Section RawMixin.
Record mixin_of (T : poset) := Mixin {
mx_lim : chain T -> T;
_ : forall (s : chain T) x, x \In s -> x <== mx_lim s;
_ : forall (s : chain T) x,
(forall y, y \In s -> y <== x) -> mx_lim s <== x}.
End RawMixin.
Section ClassDef.
Record class_of (T : Type) := Class {
base : Poset.class_of T;
mixin : mixin_of (Poset.Pack base T)}.
Local Coercion base : class_of >-> Poset.class_of.
Structure type : Type := Pack {sort; _ : class_of sort; _ : Type}.
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 T.
Definition pack b0 (m0 : mixin_of (Poset.Pack b0 T)) :=
fun m & phant_id m0 m => Pack (@Class T b0 m) T.
Definition poset := Poset.Pack class cT.
Definition lim (s : chain poset) : cT := mx_lim (mixin class) s.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> Poset.class_of.
Coercion sort : type >-> Sortclass.
Coercion poset : type >-> Poset.type.
Canonical Structure poset.
Notation cpo := type.
Notation CPOMixin := Mixin.
Notation CPO T m := (@pack T _ _ m id).
Notation "[ 'cpo' 'of' T 'for' cT ]" := (@clone T cT _ idfun)
(at level 0, format "[ 'cpo' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'cpo' 'of' T ]" := (@clone T _ _ id)
(at level 0, format "[ 'cpo' 'of' T ]") : form_scope.
Arguments CPO.lim {cT}.
Notation lim := CPO.lim.
Section Laws.
Variable D : cpo.
Lemma limP (s : chain D) x : x \In s -> x <== lim s.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (poset D)) x (@Mem (Poset.sort (poset D)) (chainPredType (poset D)) s), @Poset.leq (poset D) x (@CPO.lim D s) *)
by case: D s x=>S [[p]][/= l H1 *]; apply: (H1).
Qed.
Lemma limM (s : chain D) x : (forall y, y \In s -> y <== x) -> lim s <== x.
Proof.
(* Goal: forall _ : forall (y : Poset.sort (poset D)) (_ : @InMem (Poset.sort (poset D)) y (@Mem (Poset.sort (poset D)) (chainPredType (poset D)) s)), @Poset.leq (poset D) y x, @Poset.leq (poset D) (@CPO.lim D s) x *)
by case: D s x=>S [[p]][/= l H1 H2 *]; apply: (H2).
Qed.
End Laws.
End Exports.
End CPO.
Export CPO.Exports.
Section PairCPO.
Variables (A B : cpo).
Local Notation tp := [poset of A * B].
Definition pair_lim (s : chain tp) : tp :=
(lim (proj1_chain s), lim (proj2_chain s)).
Lemma pair_limP (s : chain tp) x : x \In s -> x <== pair_lim s.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x))) x (@Mem (Poset.sort (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x))) (chainPredType (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x))) s), @Poset.leq (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x)) x (pair_lim s) *)
by split; apply: limP; exists x.
Qed.
Lemma pair_limM (s : chain tp) x :
(forall y, y \In s -> y <== x) -> pair_lim s <== x.
Proof.
(* Goal: forall _ : forall (y : Poset.sort (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x))) (_ : @InMem (Poset.sort (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x))) y (@Mem (Poset.sort (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x))) (chainPredType (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x))) s)), @Poset.leq (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x)) y x, @Poset.leq (@Poset.clone (prod (CPO.sort A) (CPO.sort B)) (pairPoset (CPO.poset A) (CPO.poset B)) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (pairPoset (CPO.poset A) (CPO.poset B)))) (Poset.class (pairPoset (CPO.poset A) (CPO.poset B))) => x)) (pair_lim s) x *)
by split; apply: limM=>y [z][->]; case/H.
Qed.
Definition pairCPOMixin := CPOMixin pair_limP pair_limM.
Canonical pairCPO := Eval hnf in CPO (A * B) pairCPOMixin.
End PairCPO.
Section FunCPO.
Variable (A : Type) (B : cpo).
Local Notation tp := [poset of A -> B].
Definition fun_lim (s : chain tp) : tp :=
fun x => lim (app_chain s x).
Lemma fun_limP (s : chain tp) x : x \In s -> x <== fun_lim s.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x))) x (@Mem (Poset.sort (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x))) (chainPredType (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x))) s), @Poset.leq (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x)) x (fun_lim s) *)
by move=>H t; apply: limP; exists x.
Qed.
Lemma fun_limM (s : chain tp) x :
(forall y, y \In s -> y <== x) -> fun_lim s <== x.
Proof.
(* Goal: forall _ : forall (y : Poset.sort (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x))) (_ : @InMem (Poset.sort (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x))) y (@Mem (Poset.sort (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x))) (chainPredType (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x))) s)), @Poset.leq (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x)) y x, @Poset.leq (@Poset.clone (forall _ : A, CPO.sort B) (funPoset A (CPO.poset B)) (Poset.class (funPoset A (CPO.poset B))) (fun x : phantom (Poset.class_of (Poset.sort (funPoset A (CPO.poset B)))) (Poset.class (funPoset A (CPO.poset B))) => x)) (fun_lim s) x *)
by move=>H1 t; apply: limM=>y [f][->] H2; apply: H1.
Qed.
Definition funCPOMixin := CPOMixin fun_limP fun_limM.
Canonical funCPO := Eval hnf in CPO (A -> B) funCPOMixin.
End FunCPO.
Section DFunCPO.
Variable (A : Type) (B : A -> cpo).
Local Notation tp := (dfunPoset B).
Definition dfun_lim (s : chain tp) : tp :=
fun x => lim (dapp_chain s x).
Lemma dfun_limP (s : chain tp) x : x \In s -> x <== dfun_lim s.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (@dfunPoset A (fun x : A => CPO.poset (B x)))) x (@Mem (Poset.sort (@dfunPoset A (fun x : A => CPO.poset (B x)))) (chainPredType (@dfunPoset A (fun x : A => CPO.poset (B x)))) s), @Poset.leq (@dfunPoset A (fun x : A => CPO.poset (B x))) x (dfun_lim s) *)
by move=>H t; apply: limP; exists x.
Qed.
Lemma dfun_limM (s : chain tp) x :
(forall y, y \In s -> y <== x) -> dfun_lim s <== x.
Proof.
(* Goal: forall _ : forall (y : Poset.sort (@dfunPoset A (fun x : A => CPO.poset (B x)))) (_ : @InMem (Poset.sort (@dfunPoset A (fun x : A => CPO.poset (B x)))) y (@Mem (Poset.sort (@dfunPoset A (fun x : A => CPO.poset (B x)))) (chainPredType (@dfunPoset A (fun x : A => CPO.poset (B x)))) s)), @Poset.leq (@dfunPoset A (fun x : A => CPO.poset (B x))) y x, @Poset.leq (@dfunPoset A (fun x : A => CPO.poset (B x))) (dfun_lim s) x *)
by move=>H1 t; apply: limM=>y [f][->] H2; apply: H1.
Qed.
Definition dfunCPOMixin := CPOMixin dfun_limP dfun_limM.
Definition dfunCPO := Eval hnf in CPO (forall x, B x) dfunCPOMixin.
End DFunCPO.
Section PropCPO.
Local Notation tp := [poset of Prop].
Definition prop_lim (s : chain tp) : tp := exists p, p \In s /\ p.
Lemma prop_limP (s : chain tp) p : p \In s -> p <== prop_lim s.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x))) p (@Mem (Poset.sort (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x))) (chainPredType (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x))) s), @Poset.leq (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x)) p (prop_lim s) *)
by exists p.
Qed.
Lemma prop_limM (s : chain tp) p :
(forall q, q \In s -> q <== p) -> prop_lim s <== p.
Proof.
(* Goal: forall _ : forall (q : Poset.sort (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x))) (_ : @InMem (Poset.sort (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x))) q (@Mem (Poset.sort (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x))) (chainPredType (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x))) s)), @Poset.leq (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x)) q p, @Poset.leq (@Poset.clone Prop propPoset (Poset.class propPoset) (fun x : phantom (Poset.class_of (Poset.sort propPoset)) (Poset.class propPoset) => x)) (prop_lim s) p *)
by move=>H [r][]; move/H.
Qed.
Definition propCPOMixin := CPOMixin prop_limP prop_limM.
Canonical propCPO := Eval hnf in CPO Prop propCPOMixin.
End PropCPO.
Section PredCPO.
Variable A : Type.
Definition predCPOMixin := funCPOMixin A propCPO.
Canonical predCPO := Eval hnf in CPO (Pred A) predCPOMixin.
End PredCPO.
Section LatticeCPO.
Variable A : lattice.
Local Notation tp := (Lattice.poset A).
Definition lat_lim (s : chain tp) : tp := sup s.
Lemma lat_limP (s : chain tp) x : x \In s -> x <== lat_lim s.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (Lattice.poset A)) x (@Mem (Poset.sort (Lattice.poset A)) (chainPredType (Lattice.poset A)) s), @Poset.leq (Lattice.poset A) x (lat_lim s) *)
by apply: supP.
Qed.
Lemma lat_limM (s : chain tp) x :
(forall y, y \In s -> y <== x) -> lat_lim s <== x.
Proof.
(* Goal: forall _ : forall (y : Poset.sort (Lattice.poset A)) (_ : @InMem (Poset.sort (Lattice.poset A)) y (@Mem (Poset.sort (Lattice.poset A)) (chainPredType (Lattice.poset A)) s)), @Poset.leq (Lattice.poset A) y x, @Poset.leq (Lattice.poset A) (lat_lim s) x *)
by apply: supM.
Qed.
Definition latCPOMixin := CPOMixin lat_limP lat_limM.
Definition latCPO := Eval hnf in CPO tp latCPOMixin.
End LatticeCPO.
Section AdmissibleClosure.
Variable T : cpo.
Definition chain_closed :=
[Pred s : Pred T |
bot \In s /\ forall d : chain T, d <=p s -> lim d \In s].
Definition chain_closure (s : Pred T) :=
[Pred p : T | forall t : Pred T, s <=p t -> chain_closed t -> p \In t].
Lemma chain_clos_sub (s : Pred T) : s <=p chain_closure s.
Proof.
(* Goal: @SubMem (CPO.sort T) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) s) (@Mem (CPO.sort T) (SimplPredPredType (CPO.sort T)) (chain_closure s)) *)
by move=>p H1 t H2 H3; apply: H2 H1.
Qed.
Lemma chain_clos_min (s : Pred T) t :
s <=p t -> chain_closed t -> chain_closure s <=p t.
Proof.
(* Goal: forall (_ : @SubMem (CPO.sort T) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) s) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) t)) (_ : @Pred_of_Simpl (Pred (CPO.sort T)) chain_closed t), @SubMem (CPO.sort T) (@Mem (CPO.sort T) (SimplPredPredType (CPO.sort T)) (chain_closure s)) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) t) *)
by move=>H1 H2 p; move/(_ _ H1 H2).
Qed.
Lemma chain_closP (s : Pred T) : chain_closed (chain_closure s).
Proof.
(* Goal: @Pred_of_Simpl (Pred (CPO.sort T)) chain_closed (@Pred_of_Simpl (CPO.sort T) (chain_closure s)) *)
split; first by move=>t _ [].
(* Goal: forall (d : chain (CPO.poset T)) (_ : @SubMem (Poset.sort (CPO.poset T)) (@Mem (Poset.sort (CPO.poset T)) (chainPredType (CPO.poset T)) d) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) (@Pred_of_Simpl (CPO.sort T) (chain_closure s)))), @InMem (CPO.sort T) (@CPO.lim T d) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) (@Pred_of_Simpl (CPO.sort T) (chain_closure s))) *)
move=>d H1 t H3 H4; move: (chain_clos_min H3 H4)=>{H3} H3.
(* Goal: @InMem (CPO.sort T) (@CPO.lim T d) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) t) *)
by case: H4=>_; apply=>// x; move/H1; move/H3.
Qed.
Lemma chain_clos_idemp (s : Pred T) :
chain_closed s -> chain_closure s =p s.
Proof.
(* Goal: forall _ : @Pred_of_Simpl (Pred (CPO.sort T)) chain_closed s, @EqMem (CPO.sort T) (@Mem (CPO.sort T) (SimplPredPredType (CPO.sort T)) (chain_closure s)) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) s) *)
move=>p; split; last by apply: chain_clos_sub.
(* Goal: forall _ : @InMem (CPO.sort T) x (@Mem (CPO.sort T) (SimplPredPredType (CPO.sort T)) (chain_closure s)), @InMem (CPO.sort T) x (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) s) *)
by apply: chain_clos_min=>//; apply: chain_closP.
Qed.
Lemma chain_clos_mono (s1 s2 : Pred T) :
s1 <=p s2 -> chain_closure s1 <=p chain_closure s2.
Proof.
(* Goal: forall _ : @SubMem (CPO.sort T) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) s1) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) s2), @SubMem (CPO.sort T) (@Mem (CPO.sort T) (SimplPredPredType (CPO.sort T)) (chain_closure s1)) (@Mem (CPO.sort T) (SimplPredPredType (CPO.sort T)) (chain_closure s2)) *)
move=>H1; apply: chain_clos_min (chain_closP s2)=>p H2.
(* Goal: @InMem (CPO.sort T) p (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) (@Pred_of_Simpl (CPO.sort T) (chain_closure s2))) *)
by apply: chain_clos_sub; apply: H1.
Qed.
Lemma chain_closI (s1 s2 : Pred T) :
chain_closed s1 -> chain_closed s2 -> chain_closed (PredI s1 s2).
Proof.
(* Goal: forall (_ : @Pred_of_Simpl (Pred (CPO.sort T)) chain_closed s1) (_ : @Pred_of_Simpl (Pred (CPO.sort T)) chain_closed s2), @Pred_of_Simpl (Pred (CPO.sort T)) chain_closed (@Pred_of_Simpl (CPO.sort T) (@PredI (CPO.sort T) s1 s2)) *)
move=>[H1 S1][H2 S2]; split=>// d H.
(* Goal: @InMem (CPO.sort T) (@CPO.lim T d) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) (@Pred_of_Simpl (CPO.sort T) (@PredI (CPO.sort T) s1 s2))) *)
by split; [apply: S1 | apply: S2]=>// x; case/H.
Qed.
End AdmissibleClosure.
Arguments chain_closed {T}.
Lemma chain_clos_diag (T : cpo) (s : Pred (T * T)) :
chain_closed s -> chain_closed [Pred t : T | (t, t) \In s].
Proof.
(* Goal: forall _ : @Pred_of_Simpl (Pred (CPO.sort (pairCPO T T))) (@chain_closed (pairCPO T T)) s, @Pred_of_Simpl (Pred (CPO.sort T)) (@chain_closed T) (@Pred_of_Simpl (CPO.sort T) (@SimplPred (CPO.sort T) (fun t : CPO.sort T => @InMem (prod (CPO.sort T) (CPO.sort T)) (@pair (CPO.sort T) (CPO.sort T) t t) (@Mem (prod (CPO.sort T) (CPO.sort T)) (PredPredType (prod (CPO.sort T) (CPO.sort T))) s)))) *)
move=>[B H1]; split=>// d H2.
(* Goal: @InMem (CPO.sort T) (@CPO.lim T d) (@Mem (CPO.sort T) (PredPredType (CPO.sort T)) (@Pred_of_Simpl (CPO.sort T) (@SimplPred (CPO.sort T) (fun t : CPO.sort T => @InMem (prod (CPO.sort T) (CPO.sort T)) (@pair (CPO.sort T) (CPO.sort T) t t) (@Mem (prod (CPO.sort T) (CPO.sort T)) (PredPredType (prod (CPO.sort T) (CPO.sort T))) s))))) *)
rewrite InE /= -{1}(proj1_diagE d) -{2}(proj2_diagE d).
(* Goal: @InMem (prod (CPO.sort T) (CPO.sort T)) (@pair (CPO.sort T) (CPO.sort T) (@CPO.lim T (@proj1_chain (CPO.poset T) (CPO.poset T) (@diag_chain (CPO.poset T) d))) (@CPO.lim T (@proj2_chain (CPO.poset T) (CPO.poset T) (@diag_chain (CPO.poset T) d)))) (@Mem (prod (CPO.sort T) (CPO.sort T)) (PredPredType (prod (CPO.sort T) (CPO.sort T))) s) *)
by apply: H1; case=>x1 x2 [x][[<- <-]]; apply: H2.
Qed.
Section SubCPO.
Variables (D : cpo) (s : Pred D) (C : chain_closed s).
Local Notation tp := (subPoset (proj1 C)).
Lemma sval_mono : monotone (sval : tp -> D).
Proof.
(* Goal: @monotone (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C)) (CPO.poset D) (@proj1_sig (Poset.sort (CPO.poset D)) (fun x : Poset.sort (CPO.poset D) => @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (PredPredType (Poset.sort (CPO.poset D))) s)) : forall _ : Poset.sort (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C)), CPO.sort D) *)
by move=>[x1 H1][x2 H2]; apply.
Qed.
Lemma sub_limX (u : chain tp) : lim [sval ^^ u by sval_mono] \In s.
Proof.
(* Goal: @InMem (CPO.sort D) (@CPO.lim D (@image_chain (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C)) (CPO.poset D) u (@proj1_sig (Poset.sort (CPO.poset D)) (fun x : Poset.sort (CPO.poset D) => @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (PredPredType (Poset.sort (CPO.poset D))) s))) sval_mono)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s) *)
by case: C u=>P H u; apply: (H)=>t [[y]] H1 [->].
Qed.
Definition sub_lim (u : chain tp) : tp :=
exist _ (lim [sval ^^ u by sval_mono]) (sub_limX u).
Lemma sub_limP (u : chain tp) x : x \In u -> x <== sub_lim u.
Proof.
(* Goal: forall _ : @InMem (Poset.sort (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C))) x (@Mem (Poset.sort (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C))) (chainPredType (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C))) u), @Poset.leq (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C)) x (sub_lim u) *)
by move=>H; apply: limP; exists x.
Qed.
Lemma sub_limM (u : chain tp) x :
(forall y, y \In u -> y <== x) -> sub_lim u <== x.
Proof.
(* Goal: forall _ : forall (y : Poset.sort (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C))) (_ : @InMem (Poset.sort (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C))) y (@Mem (Poset.sort (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C))) (chainPredType (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C))) u)), @Poset.leq (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C)) y x, @Poset.leq (@subPoset (CPO.poset D) s (@proj1 (@InMem (Poset.sort (CPO.poset D)) (@Poset.bot (CPO.poset D)) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) (forall (d : chain (CPO.poset D)) (_ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)), @InMem (CPO.sort D) (@CPO.lim D d) (@Mem (CPO.sort D) (PredPredType (CPO.sort D)) s)) C)) (sub_lim u) x *)
by move=>H; apply: limM=>y [z][->]; apply: H.
Qed.
Definition subCPOMixin := CPOMixin sub_limP sub_limM.
Definition subCPO := Eval hnf in CPO {x : D | x \In s} subCPOMixin.
End SubCPO.
Lemma lim_mono (D : cpo) (s1 s2 : chain D) :
s1 <=p s2 -> lim s1 <== lim s2.
Proof.
(* Goal: forall _ : @SubMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) s1) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) s2), @Poset.leq (CPO.poset D) (@CPO.lim D s1) (@CPO.lim D s2) *)
by move=>H; apply: limM=>y; move/H; apply: limP.
Qed.
Lemma limE (D : cpo) (s1 s2 : chain D) :
s1 =p s2 -> lim s1 = lim s2.
Proof.
(* Goal: forall _ : @EqMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) s1) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) s2), @eq (CPO.sort D) (@CPO.lim D s1) (@CPO.lim D s2) *)
by move=>H; apply: poset_asym; apply: lim_mono=>x; rewrite H.
Qed.
Lemma lim_liftE (D : cpo) (s : chain D) :
lim s = lim (lift_chain s).
Proof.
(* Goal: @eq (CPO.sort D) (@CPO.lim D s) (@CPO.lim D (@lift_chain (CPO.poset D) s)) *)
apply: poset_asym; apply: limM=>y H; first by apply: limP; right.
(* Goal: @Poset.leq (CPO.poset D) y (@CPO.lim D s) *)
by case: H; [move=>-> | apply: limP].
Qed.
Lemma lim_appE A (D : cpo) (s : chain [cpo of A -> D]) (x : A) :
lim s x = lim (app_chain s x).
Proof.
(* Goal: @eq (CPO.sort D) (@CPO.lim (@CPO.clone (forall _ : A, CPO.sort D) (funCPO A D) (CPO.class (funCPO A D)) (fun x : phantom (CPO.class_of (CPO.sort (funCPO A D))) (CPO.class (funCPO A D)) => x)) s x) (@CPO.lim D (@app_chain A (CPO.poset D) s x)) *)
by [].
Qed.
Lemma lim_dappE A (D : A -> cpo) (s : chain (dfunCPO D)) (x : A) :
lim s x = lim (dapp_chain s x).
Proof.
(* Goal: @eq (CPO.sort (D x)) (@CPO.lim (@dfunCPO A D) s x) (@CPO.lim (D x) (@dapp_chain A (fun x : A => CPO.poset (D x)) s x)) *)
by [].
Qed.
Section Continuity.
Variables (D1 D2 : cpo) (f : D1 -> D2).
Definition continuous :=
exists M : monotone f,
forall s : chain D1, f (lim s) = lim [f ^^ s by M].
Lemma cont_mono : continuous -> monotone f.
Proof.
(* Goal: forall _ : continuous, @monotone (CPO.poset D1) (CPO.poset D2) f *)
by case.
Qed.
Lemma contE (s : chain D1) (C : continuous) :
f (lim s) = lim [f ^^ s by cont_mono C].
End Continuity.
Section Kleene.
Variables (D : cpo) (f : D -> D) (C : continuous f).
Fixpoint pow m := if m is n.+1 then f (pow n) else bot.
Lemma pow_mono : monotone pow.
Proof.
(* Goal: @monotone natPoset (CPO.poset D) pow *)
move=>m n; elim: n m=>[|n IH] m /=; first by case: m.
(* Goal: forall _ : @Poset.leq natPoset m (S n), @Poset.leq (CPO.poset D) (pow m) (f (pow n)) *)
rewrite {1}/Poset.leq /= leq_eqVlt ltnS.
(* Goal: forall _ : is_true (orb (@eq_op nat_eqType m (S n)) (leq m n)), @Poset.leq (CPO.poset D) (pow m) (f (pow n)) *)
case/orP; first by move/eqP=>->.
(* Goal: forall _ : is_true (leq m n), @Poset.leq (CPO.poset D) (pow m) (f (pow n)) *)
move/IH=>{IH} H; apply: poset_trans H _.
(* Goal: @Poset.leq (CPO.poset D) (pow n) (f (pow n)) *)
by elim: n=>[|n IH] //=; apply: cont_mono IH.
Qed.
Definition pow_chain := [pow ^^ nat_chain by pow_mono].
Lemma reindex : pow_chain =p lift_chain [f ^^ pow_chain by cont_mono C].
Proof.
(* Goal: @EqMem (Poset.sort (CPO.poset D)) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) pow_chain) (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))) *)
move=>x; split.
(* Goal: forall _ : @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))), @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) pow_chain) *)
(* Goal: forall _ : @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) pow_chain), @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))) *)
-
(* Goal: forall _ : @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))), @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) pow_chain) *)
(* Goal: forall _ : @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) pow_chain), @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))) *)
case; case=>[|n][->] /=; first by left.
(* Goal: forall _ : @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))), @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) pow_chain) *)
(* Goal: forall _ : @InMem nat (S n) (@Mem nat (chainPredType natPoset) nat_chain), @InMem (CPO.sort D) (f (pow n)) (@Mem (CPO.sort D) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))) *)
by right; exists (pow n); split=>//; exists n.
(* Goal: forall _ : @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) (@lift_chain (CPO.poset D) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C)))), @InMem (Poset.sort (CPO.poset D)) x (@Mem (Poset.sort (CPO.poset D)) (chainPredType (CPO.poset D)) pow_chain) *)
case=>/=; first by move=>->; exists 0.
(* Goal: forall _ : @InMem (CPO.sort D) x (@Mem (CPO.sort D) (chainPredType (CPO.poset D)) (@image_chain (CPO.poset D) (CPO.poset D) pow_chain f (@cont_mono D D f C))), @InMem (CPO.sort D) x (@Mem (CPO.sort D) (chainPredType (CPO.poset D)) pow_chain) *)
by case=>y [->][n][->]; exists n.+1.
Qed.
Definition kleene_lfp := lim pow_chain.
Lemma kleene_lfp_fixed : f kleene_lfp = kleene_lfp.
Proof.
(* Goal: @eq (CPO.sort D) (f kleene_lfp) kleene_lfp *)
by rewrite (@contE _ _ f) lim_liftE; apply: limE; rewrite reindex.
Qed.
Lemma kleene_lfp_least : forall x, f x = x -> kleene_lfp <== x.
Proof.
(* Goal: forall (x : CPO.sort D) (_ : @eq (CPO.sort D) (f x) x), @Poset.leq (CPO.poset D) kleene_lfp x *)
move=>x H; apply: limM=>y [n][->] _.
(* Goal: @Poset.leq (CPO.poset D) (pow n) x *)
by elim: n=>[|n IH] //=; rewrite -H; apply: cont_mono IH.
Qed.
End Kleene.
Lemma id_cont (D : cpo) : continuous (@id D).
Proof.
(* Goal: @continuous D D (fun x : CPO.sort D => x) *)
by exists id_mono; move=>d; rewrite id_chainE.
Qed.
Arguments id_cont {D}.
Lemma const_cont (D1 D2 : cpo) (y : D2) : continuous (fun x : D1 => y).
Arguments const_cont {D1 D2 y}.
Lemma comp_cont (D1 D2 D3 : cpo) (f1 : D2 -> D1) (f2 : D3 -> D2) :
continuous f1 -> continuous f2 -> continuous (f1 \o f2).
Proof.
(* Goal: forall (_ : @continuous D2 D1 f1) (_ : @continuous D3 D2 f2), @continuous D3 D1 (@funcomp (CPO.sort D1) (CPO.sort D2) (CPO.sort D3) tt f1 f2) *)
case=>M1 H1 [M2 H2]; exists (comp_mono M1 M2); move=>d.
(* Goal: @eq (CPO.sort D1) (@funcomp (CPO.sort D1) (CPO.sort D2) (CPO.sort D3) tt f1 f2 (@CPO.lim D3 d)) (@CPO.lim D1 (@image_chain (CPO.poset D3) (CPO.poset D1) d (@funcomp (CPO.sort D1) (CPO.sort D2) (CPO.sort D3) tt f1 f2) (@comp_mono (CPO.poset D1) (CPO.poset D2) (CPO.poset D3) f1 f2 M1 M2))) *)
by rewrite /= H2 H1 comp_chainE.
Qed.
Arguments comp_cont {D1 D2 D3 f1 f2}.
Lemma proj1_cont (D1 D2 : cpo) : continuous (@fst D1 D2).
Proof.
(* Goal: @continuous (pairCPO D1 D2) D1 (@fst (CPO.sort D1) (CPO.sort D2)) *)
by exists proj1_mono.
Qed.
Lemma proj2_cont (D1 D2 : cpo) : continuous (@snd D1 D2).
Proof.
(* Goal: @continuous (pairCPO D1 D2) D2 (@snd (CPO.sort D1) (CPO.sort D2)) *)
by exists proj2_mono.
Qed.
Arguments proj1_cont {D1 D2}.
Arguments proj2_cont {D1 D2}.
Lemma diag_cont (D : cpo) : continuous (fun x : D => (x, x)).
Proof.
(* Goal: @continuous D (pairCPO D D) (fun x : CPO.sort D => @pair (CPO.sort D) (CPO.sort D) x x) *)
exists diag_mono=>d; apply: poset_asym; by split=>/=; [rewrite proj1_diagE | rewrite proj2_diagE].
Qed.
Arguments diag_cont {D}.
Lemma app_cont A (D : cpo) x : continuous (fun f : A -> D => f x).
Proof.
(* Goal: @continuous (funCPO A D) D (fun f : forall _ : A, CPO.sort D => f x) *)
by exists (app_mono x).
Qed.
Lemma dapp_cont A (D : A -> cpo) x : continuous (fun f : dfunCPO D => f x).
Proof.
(* Goal: @continuous (@dfunCPO A D) (D x) (fun f : CPO.sort (@dfunCPO A D) => f x) *)
by exists (dapp_mono x).
Qed.
Arguments app_cont {A D}.
Arguments dapp_cont {A D}.
Lemma prod_cont (S1 S2 T1 T2 : cpo) (f1 : S1 -> T1) (f2 : S2 -> T2) :
continuous f1 -> continuous f2 -> continuous (f1 \* f2).
Arguments prod_cont {S1 S2 T1 T2 f1 f2}.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_3_7a.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_3_5b :
forall A B C D,
BetS A B D -> BetS B C D ->
BetS A C D.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @BetS Ax0 A B D) (_ : @BetS Ax0 B C D), @BetS Ax0 A C D *)
intros.
(* Goal: @BetS Ax0 A C D *)
assert (BetS A B C) by (conclude axiom_innertransitivity).
(* Goal: @BetS Ax0 A C D *)
assert (BetS A C D) by (conclude lemma_3_7a).
(* Goal: @BetS Ax0 A C D *)
close.
Qed.
End Euclid.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_ABCequalsCBA.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglestransitive.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_equalanglesflip :
forall A B C D E F,
CongA A B C D E F ->
CongA C B A F E D.
Proof.
(* Goal: forall (A B C D E F : @Point Ax0) (_ : @CongA Ax0 A B C D E F), @CongA Ax0 C B A F E D *)
intros.
(* Goal: @CongA Ax0 C B A F E D *)
assert (nCol D E F) by (conclude lemma_equalanglesNC).
(* Goal: @CongA Ax0 C B A F E D *)
assert (CongA D E F A B C) by (conclude lemma_equalanglessymmetric).
(* Goal: @CongA Ax0 C B A F E D *)
assert (nCol A B C) by (conclude lemma_equalanglesNC).
(* Goal: @CongA Ax0 C B A F E D *)
assert (~ Col C B A).
(* Goal: @CongA Ax0 C B A F E D *)
(* Goal: not (@Col Ax0 C B A) *)
{
(* Goal: not (@Col Ax0 C B A) *)
intro.
(* Goal: False *)
assert (Col A B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @CongA Ax0 C B A F E D *)
}
(* Goal: @CongA Ax0 C B A F E D *)
assert (CongA C B A A B C) by (conclude lemma_ABCequalsCBA).
(* Goal: @CongA Ax0 C B A F E D *)
assert (CongA C B A D E F) by (conclude lemma_equalanglestransitive).
(* Goal: @CongA Ax0 C B A F E D *)
assert (CongA D E F F E D) by (conclude lemma_ABCequalsCBA).
(* Goal: @CongA Ax0 C B A F E D *)
assert (CongA C B A F E D) by (conclude lemma_equalanglestransitive).
(* Goal: @CongA Ax0 C B A F E D *)
close.
Qed.
End Euclid.
|
Require Import Ensembles.
Require Import Laws.
Require Import Group_definitions.
Section group_trivialities.
Variable U : Type.
Variable Gr : Group U.
Let G : Ensemble U := G_ U Gr.
Let star : U -> U -> U := star_ U Gr.
Let inv : U -> U := inv_ U Gr.
Let 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.
Theorem triv1 : forall a b : U, star (inv a) (star a b) = b.
Proof.
(* Goal: forall a b : U, @eq U (star (inv a) (star a b)) b *)
intros a b; try assumption.
(* Goal: @eq U (star (inv a) (star a b)) b *)
rewrite (G1 (inv a) a b); auto.
(* Goal: @eq U (star (star (inv a) a) b) b *)
rewrite G3c; auto.
Qed.
Theorem triv2 : forall a b : U, star (star b a) (inv a) = b.
Proof.
(* Goal: forall a b : U, @eq U (star (star b a) (inv a)) b *)
intros a b; try assumption.
(* Goal: @eq U (star (star b a) (inv a)) b *)
rewrite <- (G1 b a (inv a)); auto.
(* Goal: @eq U (star b (star a (inv a))) b *)
rewrite (G3b a); auto.
Qed.
Theorem resolve : forall a b : U, star b a = e -> b = inv a.
Proof.
(* Goal: forall (a b : U) (_ : @eq U (star b a) e), @eq U b (inv a) *)
intros a b H'1.
(* Goal: @eq U b (inv a) *)
cut (star (star b a) (inv a) = inv a).
(* Goal: @eq U (star (star b a) (inv a)) (inv a) *)
(* Goal: forall _ : @eq U (star (star b a) (inv a)) (inv a), @eq U b (inv a) *)
rewrite <- (G1 b a (inv a)); auto.
(* Goal: @eq U (star (star b a) (inv a)) (inv a) *)
(* Goal: forall _ : @eq U (star b (star a (inv a))) (inv a), @eq U b (inv a) *)
rewrite (G3b a); auto.
(* Goal: @eq U (star (star b a) (inv a)) (inv a) *)
(* Goal: forall _ : @eq U (star b e) (inv a), @eq U b (inv a) *)
rewrite (G2c b); auto.
(* Goal: @eq U (star (star b a) (inv a)) (inv a) *)
rewrite H'1.
(* Goal: @eq U (star e (inv a)) (inv a) *)
rewrite (G2b (inv a)); auto.
Qed.
Theorem self_inv : e = inv e.
Proof.
(* Goal: @eq U e (inv e) *)
apply resolve; auto.
Qed.
Theorem inv_star : forall a b : U, star (inv b) (inv a) = inv (star a b).
Proof.
(* Goal: forall a b : U, @eq U (star (inv b) (inv a)) (inv (star a b)) *)
intros a b.
(* Goal: @eq U (star (inv b) (inv a)) (inv (star a b)) *)
apply resolve.
(* Goal: @eq U (star (star (inv b) (inv a)) (star a b)) e *)
rewrite <- (G1 (inv b) (inv a) (star a b)).
(* Goal: @eq U (star (inv b) (star (inv a) (star a b))) e *)
rewrite (G1 (inv a) a b).
(* Goal: @eq U (star (inv b) (star (star (inv a) a) b)) e *)
rewrite (G3c a).
(* Goal: @eq U (star (inv b) (star e b)) e *)
rewrite (G2b b); auto.
Qed.
Theorem cancellation : forall a b : U, star a b = a -> b = e.
Proof.
(* Goal: forall (a b : U) (_ : @eq U (star a b) a), @eq U b e *)
intros a b H'.
(* Goal: @eq U b e *)
cut (star (inv a) (star a b) = b).
(* Goal: @eq U (star (inv a) (star a b)) b *)
(* Goal: forall _ : @eq U (star (inv a) (star a b)) b, @eq U b e *)
rewrite H'.
(* Goal: @eq U (star (inv a) (star a b)) b *)
(* Goal: forall _ : @eq U (star (inv a) a) b, @eq U b e *)
rewrite (G3c a); auto.
(* Goal: @eq U (star (inv a) (star a b)) b *)
rewrite (G1 (inv a) a b).
(* Goal: @eq U (star (star (inv a) a) b) b *)
rewrite (G3c a); auto.
Qed.
Theorem inv_involution : forall a : U, a = inv (inv a).
Proof.
(* Goal: forall a : U, @eq U a (inv (inv a)) *)
intro a; apply resolve; auto.
Qed.
End group_trivialities.
Hint Resolve G1.
Hint Resolve G2a G2b G2c.
Hint Resolve G3a G3b G3c.
Hint Resolve G0.
Hint Resolve triv1 triv2 resolve self_inv inv_star inv_involution.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelNC.
Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelsymmetric.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearparallel.
Require Export GeoCoq.Elements.OriginalProofs.proposition_29.
Section Euclid.
Context `{Ax:euclidean_euclidean}.
Lemma proposition_29C :
forall B D E G H,
Par G B H D -> OS B D G H -> BetS E G H ->
CongA E G B G H D /\ RT B G H G H D.
Proof.
(* Goal: forall (B D E G H : @Point Ax0) (_ : @Par Ax0 G B H D) (_ : @OS Ax0 B D G H) (_ : @BetS Ax0 E G H), and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
intros.
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (nCol G B H) by (forward_using lemma_parallelNC).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (~ eq G B).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
(* Goal: not (@eq Ax0 G B) *)
{
(* Goal: not (@eq Ax0 G B) *)
intro.
(* Goal: False *)
assert (Col G B H) by (conclude_def Col ).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
}
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq B G) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
let Tf:=fresh in assert (Tf:exists A, (BetS B G A /\ Cong G A B G)) by (conclude lemma_extension);destruct Tf as [A];spliter.
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (BetS A G B) by (conclude axiom_betweennesssymmetry).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq A B) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col A B G) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col G B A) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Par H D G B) by (conclude lemma_parallelsymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Par H D A B) by (conclude lemma_collinearparallel).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Par H D B A) by (forward_using lemma_parallelflip).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col B A G) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq G A) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Par H D G A) by (conclude lemma_collinearparallel).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Par H D A G) by (forward_using lemma_parallelflip).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Par A G H D) by (conclude lemma_parallelsymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
let Tf:=fresh in assert (Tf:exists a g h d m, (neq A G /\ neq H D /\ Col A G a /\ Col A G g /\ neq a g /\ Col H D h /\ Col H D d /\ neq h d /\ ~ Meet A G H D /\ BetS a m d /\ BetS h m g)) by (conclude_def Par );destruct Tf as [a[g[h[d[m]]]]];spliter.
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq D H) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
let Tf:=fresh in assert (Tf:exists C, (BetS D H C /\ Cong H C D H)) by (conclude lemma_extension);destruct Tf as [C];spliter.
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (BetS H G E) by (conclude axiom_betweennesssymmetry).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq A B) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq B A) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq D C) by (forward_using lemma_betweennotequal).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq C D) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col A G B) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col G A B) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col G A a) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (neq G A) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col A B a) by (conclude lemma_collinear4).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col G A g) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col A B g) by (conclude lemma_collinear4).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col D H C) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col H D C) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col D C h) by (conclude lemma_collinear4).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col C D h) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col D d C) by (conclude lemma_collinear4).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col C D d) by (forward_using lemma_collinearorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (~ Meet A B C D).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H 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 M, (neq A B /\ neq C D /\ Col A B M /\ Col C D M)) by (conclude_def Meet );destruct Tf as [M];spliter.
(* Goal: False *)
assert (Col B A G) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col B A M) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col A G M) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col C D H) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col D H M) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col H D M) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Meet A G H D) by (conclude_def Meet ).
(* Goal: False *)
contradict.
(* BG Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
}
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Par A B C D) by (conclude_def Par ).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (BetS C H D) by (conclude axiom_betweennesssymmetry).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (BetS E G H) by (conclude axiom_betweennesssymmetry).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (eq G G) by (conclude cn_equalityreflexive).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (Col G H G) by (conclude_def Col ).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (nCol G B H) by (forward_using lemma_parallelNC).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (nCol G H B) by (forward_using lemma_NCorder).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (OS D B G H) by (forward_using lemma_samesidesymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (TS B G H A) by (conclude_def TS ).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (TS D G H A) by (conclude lemma_planeseparation).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert (TS A G H D) by (conclude lemma_oppositesidesymmetric).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
assert ((CongA A G H G H D /\ CongA E G B G H D /\ RT B G H G H D)) by (conclude proposition_29).
(* Goal: and (@CongA Ax0 E G B G H D) (@RT Ax0 B G H G H D) *)
close.
Qed.
End Euclid.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Parts.
Section Diff.
Variable E : Setoid.
Definition diff : part_set E -> part_set E -> part_set E.
Proof.
(* Goal: forall (_ : Carrier (part_set E)) (_ : Carrier (part_set E)), Carrier (part_set E) *)
intros A B.
(* Goal: Carrier (part_set E) *)
apply (Build_Predicate (Pred_fun:=fun x : E => in_part x A /\ ~ in_part x B)).
(* Goal: @pred_compatible E (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) *)
red in |- *.
(* Goal: forall (x y : Carrier E) (_ : and (@in_part E x A) (not (@in_part E x B))) (_ : @Equal E y x), and (@in_part E y A) (not (@in_part E y B)) *)
intros x y H' H'0; try assumption.
(* Goal: and (@in_part E y A) (not (@in_part E y B)) *)
elim H'; intros H'1 H'2; try exact H'1; clear H'.
(* Goal: and (@in_part E y A) (not (@in_part E y B)) *)
split; [ try assumption | idtac ].
(* Goal: not (@in_part E y B) *)
(* Goal: @in_part E y A *)
apply in_part_comp_l with x; auto with algebra.
(* Goal: not (@in_part E y B) *)
red in |- *.
(* Goal: forall _ : @in_part E y B, False *)
intros H'; try assumption.
(* Goal: False *)
absurd (in_part x B); auto with algebra.
(* Goal: @in_part E x B *)
apply in_part_comp_l with y; auto with algebra.
Qed.
Lemma diff_comp :
forall A A' B B' : part_set E,
Equal A A' -> Equal B B' -> Equal (diff A B) (diff A' B').
Proof.
(* Goal: forall (A A' B B' : Carrier (part_set E)) (_ : @Equal (part_set E) A A') (_ : @Equal (part_set E) B B'), @Equal (part_set E) (diff A B) (diff A' B') *)
intros A A' B B'; try assumption.
(* Goal: forall (_ : @Equal (part_set E) A A') (_ : @Equal (part_set E) B B'), @Equal (part_set E) (diff A B) (diff A' B') *)
unfold diff in |- *; simpl in |- *.
(* Goal: forall (_ : @eq_part E A A') (_ : @eq_part E B B'), @eq_part E (@Build_Predicate E (fun x : Carrier E => and (@in_part E x A) (not (@in_part E x B))) (fun (x y : Carrier E) (H' : and (@in_part E x A) (not (@in_part E x B))) (H'0 : @Equal E y x) => @and_ind (@in_part E x A) (not (@in_part E x B)) (and (@in_part E y A) (not (@in_part E y B))) (fun (H'1 : @in_part E x A) (H'2 : not (@in_part E x B)) => @conj (@in_part E y A) (not (@in_part E y B)) (@in_part_comp_l E A x y H'1 H'0) (fun H'3 : @in_part E y B => False_ind False (H'2 (@in_part_comp_l E B y x H'3 (@Sym E y x H'0))))) H')) (@Build_Predicate E (fun x : Carrier E => and (@in_part E x A') (not (@in_part E x B'))) (fun (x y : Carrier E) (H' : and (@in_part E x A') (not (@in_part E x B'))) (H'0 : @Equal E y x) => @and_ind (@in_part E x A') (not (@in_part E x B')) (and (@in_part E y A') (not (@in_part E y B'))) (fun (H'1 : @in_part E x A') (H'2 : not (@in_part E x B')) => @conj (@in_part E y A') (not (@in_part E y B')) (@in_part_comp_l E A' x y H'1 H'0) (fun H'3 : @in_part E y B' => False_ind False (H'2 (@in_part_comp_l E B' y x H'3 (@Sym E y x H'0))))) H')) *)
unfold eq_part in |- *; simpl in |- *.
(* Goal: forall (_ : forall x : Carrier E, and (forall _ : @in_part E x A, @in_part E x A') (forall _ : @in_part E x A', @in_part E x A)) (_ : forall x : Carrier E, and (forall _ : @in_part E x B, @in_part E x B') (forall _ : @in_part E x B', @in_part E x B)) (x : Carrier E), and (forall _ : and (@in_part E x A) (not (@in_part E x B)), and (@in_part E x A') (not (@in_part E x B'))) (forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B))) *)
intros H' H'0 x; split; [ intros H'1; split; [ try assumption | idtac ] | idtac ].
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: not (@in_part E x B') *)
(* Goal: @in_part E x A' *)
elim (H' x); intros H'3 H'4; lapply H'3; [ intros H'5; try exact H'5; clear H'3 | clear H'3 ].
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: not (@in_part E x B') *)
(* Goal: @in_part E x A *)
elim H'1; intros H'2 H'3; try exact H'2; clear H'1.
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: not (@in_part E x B') *)
red in |- *.
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: forall _ : @in_part E x B', False *)
intros H'2; try assumption.
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: False *)
absurd (in_part x B); auto with algebra.
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: @in_part E x B *)
(* Goal: not (@in_part E x B) *)
elim H'1; intros H'3 H'4; try exact H'4; clear H'1.
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: @in_part E x B *)
elim (H'0 x); intros H'4 H'5; lapply H'5; [ intros H'6; try exact H'6; clear H'5 | clear H'5 ].
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
(* Goal: @in_part E x B' *)
auto with algebra.
(* Goal: forall _ : and (@in_part E x A') (not (@in_part E x B')), and (@in_part E x A) (not (@in_part E x B)) *)
intros H'1; split; [ try assumption | idtac ].
(* Goal: not (@in_part E x B) *)
(* Goal: @in_part E x A *)
elim (H' x); intros H'3 H'4; lapply H'4; [ intros H'5; try exact H'5; clear H'4 | clear H'4 ].
(* Goal: not (@in_part E x B) *)
(* Goal: @in_part E x A' *)
elim H'1; intros H'2 H'4; try exact H'2; clear H'1.
(* Goal: not (@in_part E x B) *)
red in |- *.
(* Goal: forall _ : @in_part E x B, False *)
intros H'2; try assumption.
(* Goal: False *)
absurd (in_part x B'); auto with algebra.
(* Goal: @in_part E x B' *)
(* Goal: not (@in_part E x B') *)
elim H'1; intros H'3 H'4; try exact H'4; clear H'1.
(* Goal: @in_part E x B' *)
elim (H'0 x); intros H'4 H'5; lapply H'4; [ intros H'6; try exact H'6; clear H'4 | clear H'4 ].
(* Goal: @in_part E x B *)
try exact H'2.
Qed.
End Diff.
Hint Resolve diff_comp: algebra. |
Require Export GeoCoq.Elements.OriginalProofs.proposition_29.
Section Euclid.
Context `{Ax:euclidean_euclidean}.
Lemma proposition_29B :
forall A D G H,
Par A G H D -> TS A G H D ->
CongA A G H G H D.
Proof.
(* Goal: forall (A D G H : @Point Ax0) (_ : @Par Ax0 A G H D) (_ : @TS Ax0 A G H D), @CongA Ax0 A G H G H D *)
intros.
(* Goal: @CongA Ax0 A G H G H D *)
let Tf:=fresh in assert (Tf:exists a d g h m, (neq A G /\ neq H D /\ Col A G a /\ Col A G g /\ neq a g /\ Col H D h /\ Col H D d /\ neq h d /\ ~ Meet A G H D /\ BetS a m d /\ BetS h m g)) by (conclude_def Par );destruct Tf as [a[d[g[h[m]]]]];spliter.
(* Goal: @CongA Ax0 A G H G H D *)
assert (neq D H) by (conclude lemma_inequalitysymmetric).
(* Goal: @CongA Ax0 A G H G H D *)
assert (~ eq H G).
(* Goal: @CongA Ax0 A G H G H D *)
(* Goal: not (@eq Ax0 H G) *)
{
(* Goal: not (@eq Ax0 H G) *)
intro.
(* Goal: False *)
assert (eq H H) by (conclude cn_equalityreflexive).
(* Goal: False *)
assert (Col H D H) by (conclude_def Col ).
(* Goal: False *)
assert (eq G G) by (conclude cn_equalityreflexive).
(* Goal: False *)
assert (Col A G G) by (conclude_def Col ).
(* Goal: False *)
assert (Col A G H) by (conclude cn_equalitysub).
(* Goal: False *)
assert (Meet A G H D) by (conclude_def Meet ).
(* Goal: False *)
contradict.
(* BG Goal: @CongA Ax0 A G H G H D *)
}
(* Goal: @CongA Ax0 A G H G H D *)
let Tf:=fresh in assert (Tf:exists B, (BetS A G B /\ Cong G B A G)) by (conclude lemma_extension);destruct Tf as [B];spliter.
(* Goal: @CongA Ax0 A G H G H D *)
let Tf:=fresh in assert (Tf:exists C, (BetS D H C /\ Cong H C D H)) by (conclude lemma_extension);destruct Tf as [C];spliter.
(* Goal: @CongA Ax0 A G H G H D *)
let Tf:=fresh in assert (Tf:exists E, (BetS H G E /\ Cong G E H G)) by (conclude lemma_extension);destruct Tf as [E];spliter.
(* Goal: @CongA Ax0 A G H G H D *)
assert (neq A B) by (forward_using lemma_betweennotequal).
(* Goal: @CongA Ax0 A G H G H D *)
assert (neq B A) by (conclude lemma_inequalitysymmetric).
(* Goal: @CongA Ax0 A G H G H D *)
assert (neq D C) by (forward_using lemma_betweennotequal).
(* Goal: @CongA Ax0 A G H G H D *)
assert (neq C D) by (conclude lemma_inequalitysymmetric).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col A G B) by (conclude_def Col ).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col G A B) by (forward_using lemma_collinearorder).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col G A a) by (forward_using lemma_collinearorder).
(* Goal: @CongA Ax0 A G H G H D *)
assert (neq G A) by (conclude lemma_inequalitysymmetric).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col A B a) by (conclude lemma_collinear4).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col G A g) by (forward_using lemma_collinearorder).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col A B g) by (conclude lemma_collinear4).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col D H C) by (conclude_def Col ).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col H D C) by (forward_using lemma_collinearorder).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col D C h) by (conclude lemma_collinear4).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col C D h) by (forward_using lemma_collinearorder).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col D d C) by (conclude lemma_collinear4).
(* Goal: @CongA Ax0 A G H G H D *)
assert (Col C D d) by (forward_using lemma_collinearorder).
(* Goal: @CongA Ax0 A G H G H D *)
assert (~ Meet A B C D).
(* Goal: @CongA Ax0 A G H G H 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 M, (neq A B /\ neq C D /\ Col A B M /\ Col C D M)) by (conclude_def Meet );destruct Tf as [M];spliter.
(* Goal: False *)
assert (Col B A G) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col B A M) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col A G M) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col C D H) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col D H M) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col H D M) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Meet A G H D) by (conclude_def Meet ).
(* Goal: False *)
contradict.
(* BG Goal: @CongA Ax0 A G H G H D *)
}
(* Goal: @CongA Ax0 A G H G H D *)
assert (Par A B C D) by (conclude_def Par ).
(* Goal: @CongA Ax0 A G H G H D *)
assert (BetS C H D) by (conclude axiom_betweennesssymmetry).
(* Goal: @CongA Ax0 A G H G H D *)
assert (BetS E G H) by (conclude axiom_betweennesssymmetry).
(* Goal: @CongA Ax0 A G H G H D *)
assert ((CongA A G H G H D /\ CongA E G B G H D /\ RT B G H G H D)) by (conclude proposition_29).
(* Goal: @CongA Ax0 A G H G H D *)
close.
Qed.
End Euclid.
|
Require Import TS.
Require Import sur_les_relations.
Inductive reg_app : terms -> terms -> Prop :=
reg1_app :
forall (a b : terms) (s : sub_explicits),
reg_app (env (app a b) s) (app (env a s) (env b s)).
Hint Resolve reg1_app.
Inductive reg_lambda : terms -> terms -> Prop :=
reg1_lambda :
forall (a : terms) (s : sub_explicits),
reg_lambda (env (lambda a) s) (lambda (env a (lift s))).
Hint Resolve reg1_lambda.
Inductive reg_clos : terms -> terms -> Prop :=
reg1_clos :
forall (a : terms) (s t : sub_explicits),
reg_clos (env (env a s) t) (env a (comp s t)).
Hint Resolve reg1_clos.
Inductive reg_varshift1 : terms -> terms -> Prop :=
reg1_varshift1 :
forall n : nat, reg_varshift1 (env (var n) shift) (var (S n)).
Hint Resolve reg1_varshift1.
Inductive reg_varshift2 : terms -> terms -> Prop :=
reg1_varshift2 :
forall (n : nat) (s : sub_explicits),
reg_varshift2 (env (var n) (comp shift s)) (env (var (S n)) s).
Hint Resolve reg1_varshift2.
Inductive reg_fvarcons : terms -> terms -> Prop :=
reg1_fvarcons :
forall (a : terms) (s : sub_explicits),
reg_fvarcons (env (var 0) (cons a s)) a.
Hint Resolve reg1_fvarcons.
Inductive reg_fvarlift1 : terms -> terms -> Prop :=
reg1_fvarlift1 :
forall s : sub_explicits, reg_fvarlift1 (env (var 0) (lift s)) (var 0).
Hint Resolve reg1_fvarlift1.
Inductive reg_fvarlift2 : terms -> terms -> Prop :=
reg1_fvarlift2 :
forall s t : sub_explicits,
reg_fvarlift2 (env (var 0) (comp (lift s) t)) (env (var 0) t).
Hint Resolve reg1_fvarlift2.
Inductive reg_rvarcons : terms -> terms -> Prop :=
reg1_rvarcons :
forall (n : nat) (a : terms) (s : sub_explicits),
reg_rvarcons (env (var (S n)) (cons a s)) (env (var n) s).
Hint Resolve reg1_rvarcons.
Inductive reg_rvarlift1 : terms -> terms -> Prop :=
reg1_rvarlift1 :
forall (n : nat) (s : sub_explicits),
reg_rvarlift1 (env (var (S n)) (lift s)) (env (var n) (comp s shift)).
Hint Resolve reg1_rvarlift1.
Inductive reg_rvarlift2 : terms -> terms -> Prop :=
reg1_rvarlift2 :
forall (n : nat) (s t : sub_explicits),
reg_rvarlift2 (env (var (S n)) (comp (lift s) t))
(env (var n) (comp s (comp shift t))).
Hint Resolve reg1_rvarlift2.
Inductive reg_assenv : sub_explicits -> sub_explicits -> Prop :=
reg1_assenv :
forall s t u : sub_explicits,
reg_assenv (comp (comp s t) u) (comp s (comp t u)).
Hint Resolve reg1_assenv.
Inductive reg_mapenv : sub_explicits -> sub_explicits -> Prop :=
reg1_mapenv :
forall (a : terms) (s t : sub_explicits),
reg_mapenv (comp (cons a s) t) (cons (env a t) (comp s t)).
Hint Resolve reg1_mapenv.
Inductive reg_shiftcons : sub_explicits -> sub_explicits -> Prop :=
reg1_shiftcons :
forall (a : terms) (s : sub_explicits),
reg_shiftcons (comp shift (cons a s)) s.
Hint Resolve reg1_shiftcons.
Inductive reg_shiftlift1 : sub_explicits -> sub_explicits -> Prop :=
reg1_shiftlift1 :
forall s : sub_explicits,
reg_shiftlift1 (comp shift (lift s)) (comp s shift).
Hint Resolve reg1_shiftlift1.
Inductive reg_shiftlift2 : sub_explicits -> sub_explicits -> Prop :=
reg1_shiftlift2 :
forall s t : sub_explicits,
reg_shiftlift2 (comp shift (comp (lift s) t)) (comp s (comp shift t)).
Hint Resolve reg1_shiftlift2.
Inductive reg_lift1 : sub_explicits -> sub_explicits -> Prop :=
reg1_lift1 :
forall s t : sub_explicits,
reg_lift1 (comp (lift s) (lift t)) (lift (comp s t)).
Hint Resolve reg1_lift1.
Inductive reg_lift2 : sub_explicits -> sub_explicits -> Prop :=
reg1_lift2 :
forall s t u : sub_explicits,
reg_lift2 (comp (lift s) (comp (lift t) u)) (comp (lift (comp s t)) u).
Hint Resolve reg1_lift2.
Inductive reg_liftenv : sub_explicits -> sub_explicits -> Prop :=
reg1_liftenv :
forall (a : terms) (s t : sub_explicits),
reg_liftenv (comp (lift s) (cons a t)) (cons a (comp s t)).
Hint Resolve reg1_liftenv.
Inductive reg_idl : sub_explicits -> sub_explicits -> Prop :=
reg1_idl : forall s : sub_explicits, reg_idl (comp id s) s.
Hint Resolve reg1_idl.
Inductive reg_idr : sub_explicits -> sub_explicits -> Prop :=
reg1_idr : forall s : sub_explicits, reg_idr (comp s id) s.
Hint Resolve reg1_idr.
Inductive reg_liftid : sub_explicits -> sub_explicits -> Prop :=
reg1_liftid : reg_liftid (lift id) id.
Hint Resolve reg1_liftid.
Inductive reg_id : terms -> terms -> Prop :=
reg1_id : forall a : terms, reg_id (env a id) a.
Hint Resolve reg1_id.
Inductive e_systemSL : forall b : wsort, TS b -> TS b -> Prop :=
| regle_app : forall a b : terms, reg_app a b -> e_systemSL wt a b
| regle_lambda : forall a b : terms, reg_lambda a b -> e_systemSL wt a b
| regle_clos : forall a b : terms, reg_clos a b -> e_systemSL wt a b
| regle_varshift1 :
forall a b : terms, reg_varshift1 a b -> e_systemSL wt a b
| regle_varshift2 :
forall a b : terms, reg_varshift2 a b -> e_systemSL wt a b
| regle_fvarcons :
forall a b : terms, reg_fvarcons a b -> e_systemSL wt a b
| regle_fvarlift1 :
forall a b : terms, reg_fvarlift1 a b -> e_systemSL wt a b
| regle_fvarlift2 :
forall a b : terms, reg_fvarlift2 a b -> e_systemSL wt a b
| regle_rvarcons :
forall a b : terms, reg_rvarcons a b -> e_systemSL wt a b
| regle_rvarlift1 :
forall a b : terms, reg_rvarlift1 a b -> e_systemSL wt a b
| regle_rvarlift2 :
forall a b : terms, reg_rvarlift2 a b -> e_systemSL wt a b
| regle_assenv :
forall s t : sub_explicits, reg_assenv s t -> e_systemSL ws s t
| regle_mapenv :
forall s t : sub_explicits, reg_mapenv s t -> e_systemSL ws s t
| regle_shiftcons :
forall s t : sub_explicits, reg_shiftcons s t -> e_systemSL ws s t
| regle_shiftlift1 :
forall s t : sub_explicits, reg_shiftlift1 s t -> e_systemSL ws s t
| regle_shiftlift2 :
forall s t : sub_explicits, reg_shiftlift2 s t -> e_systemSL ws s t
| regle_lift1 :
forall s t : sub_explicits, reg_lift1 s t -> e_systemSL ws s t
| regle_lift2 :
forall s t : sub_explicits, reg_lift2 s t -> e_systemSL ws s t
| regle_liftenv :
forall s t : sub_explicits, reg_liftenv s t -> e_systemSL ws s t
| regle_idl : forall s t : sub_explicits, reg_idl s t -> e_systemSL ws s t
| regle_idr : forall s t : sub_explicits, reg_idr s t -> e_systemSL ws s t
| regle_liftid :
forall s t : sub_explicits, reg_liftid s t -> e_systemSL ws s t
| regle_id : forall a b : terms, reg_id a b -> e_systemSL wt a b.
Notation systemSL := (e_systemSL _) (only parsing).
Hint Resolve regle_app regle_lambda regle_clos regle_varshift1
regle_varshift2 regle_fvarcons regle_fvarlift1 regle_fvarlift2
regle_rvarcons regle_rvarlift1 regle_rvarlift2 regle_assenv regle_mapenv
regle_shiftcons regle_shiftlift1 regle_shiftlift2 regle_lift1 regle_lift2
regle_liftenv regle_idl regle_idr regle_liftid regle_id.
Inductive e_relSL : forall b : wsort, TS b -> TS b -> Prop :=
| SL_one_regle :
forall (b : wsort) (M N : TS b), e_systemSL _ M N -> e_relSL b M N
| SL_context_app_l :
forall a a' b : terms,
e_relSL wt a a' -> e_relSL wt (app a b) (app a' b)
| SL_context_app_r :
forall a b b' : terms,
e_relSL wt b b' -> e_relSL wt (app a b) (app a b')
| SL_context_lambda :
forall a a' : terms,
e_relSL wt a a' -> e_relSL wt (lambda a) (lambda a')
| SL_context_env_t :
forall (a a' : terms) (s : sub_explicits),
e_relSL wt a a' -> e_relSL wt (env a s) (env a' s)
| SL_context_env_s :
forall (a : terms) (s s' : sub_explicits),
e_relSL ws s s' -> e_relSL wt (env a s) (env a s')
| SL_context_cons_t :
forall (a a' : terms) (s : sub_explicits),
e_relSL wt a a' -> e_relSL ws (cons a s) (cons a' s)
| SL_context_cons_s :
forall (a : terms) (s s' : sub_explicits),
e_relSL ws s s' -> e_relSL ws (cons a s) (cons a s')
| SL_context_comp_l :
forall s s' t : sub_explicits,
e_relSL ws s s' -> e_relSL ws (comp s t) (comp s' t)
| SL_context_comp_r :
forall s t t' : sub_explicits,
e_relSL ws t t' -> e_relSL ws (comp s t) (comp s t')
| SL_context_lift :
forall s s' : sub_explicits,
e_relSL ws s s' -> e_relSL ws (lift s) (lift s').
Notation relSL := (e_relSL _) (only parsing).
Hint Resolve SL_one_regle SL_context_app_l SL_context_app_r SL_context_lambda
SL_context_env_t SL_context_env_s SL_context_cons_t SL_context_cons_s
SL_context_comp_l SL_context_comp_r SL_context_lift.
Definition e_relSLstar (b : wsort) := explicit_star _ (e_relSL b).
Notation relSLstar := (e_relSLstar _) (only parsing).
Hint Unfold e_relSLstar.
Goal
forall a a' b : terms,
e_relSLstar _ a a' -> e_relSLstar _ (app a b) (app a' b).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (app y b); auto.
Save SLstar_context_app_l.
Hint Resolve SLstar_context_app_l.
Goal
forall a b b' : terms,
e_relSLstar _ b b' -> e_relSLstar _ (app a b) (app a b').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (app a y); auto.
Save SLstar_context_app_r.
Hint Resolve SLstar_context_app_r.
Goal
forall a a' : terms,
e_relSLstar _ a a' -> e_relSLstar _ (lambda a) (lambda a').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (lambda y); auto.
Save SLstar_context_lambda.
Hint Resolve SLstar_context_lambda.
Goal
forall (a a' : terms) (s : sub_explicits),
e_relSLstar _ a a' -> e_relSLstar _ (env a s) (env a' s).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (env y s); auto.
Save SLstar_context_env_t.
Hint Resolve SLstar_context_env_t.
Goal
forall (a : terms) (s s' : sub_explicits),
e_relSLstar _ s s' -> e_relSLstar _ (env a s) (env a s').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (env a y); auto.
Save SLstar_context_env_s.
Hint Resolve SLstar_context_env_s.
Goal
forall (a a' : terms) (s : sub_explicits),
e_relSLstar _ a a' -> e_relSLstar _ (cons a s) (cons a' s).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (cons y s); auto.
Save SLstar_context_cons_t.
Hint Resolve SLstar_context_cons_t.
Goal
forall (a : terms) (s s' : sub_explicits),
e_relSLstar _ s s' -> e_relSLstar _ (cons a s) (cons a s').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (cons a y); auto.
Save SLstar_context_cons_s.
Hint Resolve SLstar_context_cons_s.
Goal
forall s s' t : sub_explicits,
e_relSLstar _ s s' -> e_relSLstar _ (comp s t) (comp s' t).
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (comp y t); auto.
Save SLstar_context_comp_l.
Hint Resolve SLstar_context_comp_l.
Goal
forall s t t' : sub_explicits,
e_relSLstar _ t t' -> e_relSLstar _ (comp s t) (comp s t').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (comp s y); auto.
Save SLstar_context_comp_r.
Hint Resolve SLstar_context_comp_r.
Goal
forall s s' : sub_explicits,
e_relSLstar _ s s' -> e_relSLstar _ (lift s) (lift s').
red in |- *; simple induction 1; intros.
auto.
apply star_trans1 with (lift y); auto.
Save SLstar_context_lift.
Hint Resolve SLstar_context_lift.
|
Set Implicit Arguments.
Require Export List.
Require Export inductive_wqo.
Section definitions.
Variable A : Set.
Variable leA : A -> A -> Prop.
Hypothesis leA_dec : forall a a', {leA a a'} + {~ leA a a'}.
Inductive Embeds : list A -> list A -> Prop :=
| emb0 : Embeds nil nil
| emb1 : forall v w a, Embeds v w -> Embeds v (a::w)
| emb2 : forall v w a b, Embeds v w -> leA a b -> Embeds (a::v) (b::w).
Inductive sorted : list A -> Prop :=
|srt0 : sorted nil
|srt1 : forall a, sorted (a::nil)
|srt2 : forall a a' l, leA a' a -> sorted (a'::l) -> sorted (a::(a'::l)).
End definitions.
Section list_embeding.
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 := Embeds leA.
Definition sublist : list (list A) -> list (list A) -> Prop := Embeds (eq (A:= list A)).
Lemma bad_cons : forall a l, bad embeds (a::l) -> bad embeds l.
Proof.
(* Goal: forall (a : list A) (l : list (list A)) (_ : @bad (list A) embeds (@cons (list A) a l)), @bad (list A) embeds l *)
intros a l H H'.
(* Goal: False *)
apply H; constructor 2; trivial.
Qed.
Fact nil_embeds : forall w, embeds nil w.
Proof.
(* Goal: forall w : list A, embeds (@nil A) w *)
induction w; constructor; trivial.
Qed.
Lemma good_remove_letter : forall a w ws,
good embeds (w::ws) -> good embeds ((a::w)::ws).
Lemma bad_remove_letter : forall a w ws,
bad embeds ((a::w)::ws) -> bad embeds (w::ws).
Proof.
(* Goal: forall (a : A) (w : list A) (ws : list (list A)) (_ : @bad (list A) embeds (@cons (list A) (@cons A a w) ws)), @bad (list A) embeds (@cons (list A) w ws) *)
intros a w ws Hb Hg; apply Hb; apply good_remove_letter; trivial.
Qed.
Fact sublist_refl : forall l, sublist l l.
Proof.
(* Goal: forall l : list (list A), sublist l l *)
induction l; [constructor 1 | constructor 3; trivial; apply IHl]; trivial.
Qed.
Fact good_sublist : forall l l', sublist l l' -> good embeds l -> good embeds l'.
Proof.
(* Goal: forall (l l' : list (list A)) (_ : sublist l l') (_ : @good (list A) embeds l), @good (list A) embeds l' *)
intros l l' H; induction H; trivial.
(* Goal: forall _ : @good (list A) embeds (@cons (list A) a v), @good (list A) embeds (@cons (list A) b w) *)
(* Goal: forall _ : @good (list A) embeds v, @good (list A) embeds (@cons (list A) a w) *)
intro H'; constructor 2; apply IHEmbeds; trivial.
(* Goal: forall _ : @good (list A) embeds (@cons (list A) a v), @good (list A) embeds (@cons (list A) b w) *)
subst.
(* Goal: forall _ : @good (list A) embeds (@cons (list A) b v), @good (list A) embeds (@cons (list A) b w) *)
intro H'; inversion H'; subst.
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
constructor 1.
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
(* Goal: @greater (list A) embeds b w *)
clear IHEmbeds H'; induction H; subst; trivial.
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
(* Goal: @greater (list A) embeds b (@cons (list A) b0 w) *)
(* Goal: @greater (list A) embeds b (@cons (list A) a w) *)
constructor 2; apply IHEmbeds; trivial.
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
(* Goal: @greater (list A) embeds b (@cons (list A) b0 w) *)
inversion H1; subst.
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
(* Goal: @greater (list A) embeds b (@cons (list A) b0 w) *)
(* Goal: @greater (list A) embeds b (@cons (list A) b0 w) *)
constructor 1; trivial.
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
(* Goal: @greater (list A) embeds b (@cons (list A) b0 w) *)
constructor 2; apply IHEmbeds; trivial.
(* Goal: @good (list A) embeds (@cons (list A) b w) *)
constructor 2; apply IHEmbeds; trivial.
Qed.
Fact bad_sublist : forall l l', sublist l' l -> bad embeds l -> bad embeds l'.
Proof.
(* Goal: forall (l l' : list (list A)) (_ : sublist l' l) (_ : @bad (list A) embeds l), @bad (list A) embeds l' *)
intros l l' H Hb HF; apply Hb; apply (good_sublist H); trivial.
Qed.
Fact greater_add_letter : forall a w ws, greater embeds w ws ->
greater embeds (a :: w) ws.
Proof.
(* Goal: forall (a : A) (w : list A) (ws : list (list A)) (_ : @greater (list A) embeds w ws), @greater (list A) embeds (@cons A a w) ws *)
intros a w ws H; induction H.
(* Goal: @greater (list A) embeds (@cons A a a0) (@cons (list A) a' w) *)
(* Goal: @greater (list A) embeds (@cons A a a0) (@cons (list A) a' w) *)
constructor 1; constructor 2; trivial.
(* Goal: @greater (list A) embeds (@cons A a a0) (@cons (list A) a' w) *)
constructor 2; trivial.
Qed.
Fact greater_remove_letter : forall a w ws,
greater embeds w ws -> greater embeds (a :: w) ws.
Proof.
(* Goal: forall (a : A) (w : list A) (ws : list (list A)) (_ : @greater (list A) embeds w ws), @greater (list A) embeds (@cons A a w) ws *)
intros a w ws H; induction H; simpl in |- *; trivial.
(* Goal: @greater (list A) embeds (@cons A a a0) (@cons (list A) a' w) *)
(* Goal: @greater (list A) embeds (@cons A a a0) (@cons (list A) a' w) *)
constructor; constructor; trivial.
(* Goal: @greater (list A) embeds (@cons A a a0) (@cons (list A) a' w) *)
constructor 2; trivial.
Qed.
Fact sorted_remove_head : forall a l, sorted leA (a::l) -> sorted leA l.
Proof.
(* Goal: forall (a : A) (l : list A) (_ : @sorted A leA (@cons A a l)), @sorted A leA l *)
intros a l H; inversion H; subst; trivial.
(* Goal: @sorted A leA (@nil A) *)
constructor.
Qed.
Lemma sorted_remove_inner : forall a a' l, sorted leA (a::a'::l) -> sorted leA (a::l).
Fixpoint merge_label (ws : list (list A)) (l : list A) {struct l} : list (list A) :=
match ws,l with
| w::ws', a::l' => (a::w)::(merge_label ws' l')
| ws', nil => ws'
| nil, _ => nil
end.
Lemma good_merge : forall vs, good embeds vs ->
forall l, sorted leA l -> good embeds (merge_label vs l).
Proof.
(* Goal: forall (vs : list (list A)) (_ : @good (list A) embeds vs) (l : list A) (_ : @sorted A leA l), @good (list A) embeds (merge_label vs l) *)
intros vs H; induction H; intros l Hl.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
destruct l as [|a' l]; simpl.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @good (list A) embeds (@cons (list A) (@cons A a' a) (merge_label w l)) *)
(* Goal: @good (list A) embeds (@cons (list A) a w) *)
constructor 1; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @good (list A) embeds (@cons (list A) (@cons A a' a) (merge_label w l)) *)
constructor 1; generalize a' l Hl; clear Hl l a'.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: forall (a' : A) (l : list A) (_ : @sorted A leA (@cons A a' l)), @greater (list A) embeds (@cons A a' a) (merge_label w l) *)
induction H; intros a'' l Hl.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
destruct l as [|a''' l]; simpl.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) (@cons A a''' a') (merge_label w l)) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) a' w) *)
constructor 1.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) (@cons A a''' a') (merge_label w l)) *)
(* Goal: embeds a' (@cons A a'' a) *)
constructor 2; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) (@cons A a''' a') (merge_label w l)) *)
constructor 1.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
(* Goal: embeds (@cons A a''' a') (@cons A a'' a) *)
constructor 3; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
(* Goal: leA a''' a'' *)
inversion Hl; subst; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label (@cons (list A) a' w) l) *)
destruct l as [|a''' l]; simpl.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) (@cons A a''' a') (merge_label w l)) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) a' w) *)
constructor 2.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) (@cons A a''' a') (merge_label w l)) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) w *)
apply greater_add_letter; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (@cons (list A) (@cons A a''' a') (merge_label w l)) *)
constructor 2; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @greater (list A) embeds (@cons A a'' a) (merge_label w l) *)
apply (IHgreater a'' l).
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
(* Goal: @sorted A leA (@cons A a'' l) *)
apply sorted_remove_inner with a'''; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) l) *)
destruct l as [|a' l].
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) (@cons A a' l)) *)
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) (@nil A)) *)
simpl.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) (@cons A a' l)) *)
(* Goal: @good (list A) embeds (@cons (list A) a w) *)
constructor 2; trivial.
(* Goal: @good (list A) embeds (merge_label (@cons (list A) a w) (@cons A a' l)) *)
simpl.
(* Goal: @good (list A) embeds (@cons (list A) (@cons A a' a) (merge_label w l)) *)
constructor 2; apply IHgood; trivial.
(* Goal: @sorted A leA l *)
apply sorted_remove_head with a'; trivial.
Qed.
End list_embeding.
|
Require Import Arith.
Require Import ZArith.
Require Import EqNat.
Fixpoint allbefore (P : nat -> Prop) (n : nat) {struct n} : Prop :=
match n with
| O => True
| S x => allbefore P x /\ P x
end.
Fixpoint exbefore (P : nat -> Prop) (n : nat) {struct n} : Prop :=
match n with
| O => False
| S x => exbefore P x \/ P x
end.
Theorem allbefore_ok :
forall (P : nat -> Prop) (n : nat),
(forall q : nat, q < n -> P q) <-> allbefore P n.
Proof.
(* Goal: forall (P : forall _ : nat, Prop) (n : nat), iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n) *)
intro.
(* Goal: forall n : nat, iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n) *)
simple induction n.
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *)
(* Goal: iff (forall (q : nat) (_ : lt q O), P q) (allbefore P O) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *)
(* Goal: iff (forall (q : nat) (_ : lt q O), P q) True *)
split.
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *)
(* Goal: forall (_ : True) (q : nat) (_ : lt q O), P q *)
(* Goal: forall _ : forall (q : nat) (_ : lt q O), P q, True *)
tauto.
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *)
(* Goal: forall (_ : True) (q : nat) (_ : lt q O), P q *)
intros.
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *)
(* Goal: P q *)
elim (lt_n_O q).
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *)
(* Goal: lt q O *)
assumption.
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (allbefore P (S n)) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : iff (forall (q : nat) (_ : lt q n), P q) (allbefore P n)), iff (forall (q : nat) (_ : lt q (S n)), P q) (and (allbefore P n) (P n)) *)
intros m IHm.
(* Goal: iff (forall (q : nat) (_ : lt q (S m)), P q) (and (allbefore P m) (P m)) *)
elim IHm.
(* Goal: forall (_ : forall _ : forall (q : nat) (_ : lt q m), P q, allbefore P m) (_ : forall (_ : allbefore P m) (q : nat) (_ : lt q m), P q), iff (forall (q : nat) (_ : lt q (S m)), P q) (and (allbefore P m) (P m)) *)
intros.
(* Goal: iff (forall (q : nat) (_ : lt q (S m)), P q) (and (allbefore P m) (P m)) *)
split.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: forall _ : forall (q : nat) (_ : lt q (S m)), P q, and (allbefore P m) (P m) *)
intros.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: and (allbefore P m) (P m) *)
split.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
(* Goal: allbefore P m *)
apply H.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
(* Goal: forall (q : nat) (_ : lt q m), P q *)
intros.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
(* Goal: P q *)
apply (H1 q).
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
(* Goal: lt q (S m) *)
unfold lt in |- *.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
(* Goal: le (S q) (S m) *)
unfold lt in H2.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
(* Goal: le (S q) (S m) *)
apply le_S.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
(* Goal: le (S q) m *)
assumption.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: P m *)
apply (H1 m).
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: lt m (S m) *)
unfold lt in |- *.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
(* Goal: le (S m) (S m) *)
apply le_n.
(* Goal: forall (_ : and (allbefore P m) (P m)) (q : nat) (_ : lt q (S m)), P q *)
intro.
(* Goal: forall (q : nat) (_ : lt q (S m)), P q *)
elim H1.
(* Goal: forall (_ : allbefore P m) (_ : P m) (q : nat) (_ : lt q (S m)), P q *)
intro.
(* Goal: forall (_ : P m) (q : nat) (_ : lt q (S m)), P q *)
intro.
(* Goal: forall (q : nat) (_ : lt q (S m)), P q *)
intros.
(* Goal: P q *)
elim (le_lt_or_eq q m).
(* Goal: le q m *)
(* Goal: forall _ : @eq nat q m, P q *)
(* Goal: forall _ : lt q m, P q *)
intros.
(* Goal: le q m *)
(* Goal: forall _ : @eq nat q m, P q *)
(* Goal: P q *)
apply H0.
(* Goal: le q m *)
(* Goal: forall _ : @eq nat q m, P q *)
(* Goal: lt q m *)
(* Goal: allbefore P m *)
assumption.
(* Goal: le q m *)
(* Goal: forall _ : @eq nat q m, P q *)
(* Goal: lt q m *)
assumption.
(* Goal: le q m *)
(* Goal: forall _ : @eq nat q m, P q *)
intros.
(* Goal: le q m *)
(* Goal: P q *)
rewrite H5.
(* Goal: le q m *)
(* Goal: P m *)
assumption.
(* Goal: le q m *)
unfold lt in H4.
(* Goal: le q m *)
apply (le_S_n q m).
(* Goal: le (S q) (S m) *)
assumption.
Qed.
Theorem exbefore_ok :
forall (P : nat -> Prop) (n : nat),
(exists q : nat, q < n /\ P q) <-> exbefore P n.
Proof.
(* Goal: forall (P : forall _ : nat, Prop) (n : nat), iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n) *)
intro P.
(* Goal: forall n : nat, iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n) *)
simple induction n.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: iff (@ex nat (fun q : nat => and (lt q O) (P q))) (exbefore P O) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: iff (@ex nat (fun q : nat => and (lt q O) (P q))) False *)
split.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
(* Goal: forall _ : @ex nat (fun q : nat => and (lt q O) (P q)), False *)
intros.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
(* Goal: False *)
elim H.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
(* Goal: forall (x : nat) (_ : and (lt x O) (P x)), False *)
intros.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
(* Goal: False *)
elim H0.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
(* Goal: forall (_ : lt x O) (_ : P x), False *)
intros.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
(* Goal: False *)
elim (lt_n_O x).
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
(* Goal: lt x O *)
assumption.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: forall _ : False, @ex nat (fun q : nat => and (lt q O) (P q)) *)
intros.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
(* Goal: @ex nat (fun q : nat => and (lt q O) (P q)) *)
elim H.
(* Goal: forall (n : nat) (_ : iff (@ex nat (fun q : nat => and (lt q n) (P q))) (exbefore P n)), iff (@ex nat (fun q : nat => and (lt q (S n)) (P q))) (exbefore P (S n)) *)
intros m IHm.
(* Goal: iff (@ex nat (fun q : nat => and (lt q (S m)) (P q))) (exbefore P (S m)) *)
simpl in |- *.
(* Goal: iff (@ex nat (fun q : nat => and (lt q (S m)) (P q))) (or (exbefore P m) (P m)) *)
elim IHm.
(* Goal: forall (_ : forall _ : @ex nat (fun q : nat => and (lt q m) (P q)), exbefore P m) (_ : forall _ : exbefore P m, @ex nat (fun q : nat => and (lt q m) (P q))), iff (@ex nat (fun q : nat => and (lt q (S m)) (P q))) (or (exbefore P m) (P m)) *)
intros.
(* Goal: iff (@ex nat (fun q : nat => and (lt q (S m)) (P q))) (or (exbefore P m) (P m)) *)
split.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall _ : @ex nat (fun q : nat => and (lt q (S m)) (P q)), or (exbefore P m) (P m) *)
intro.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: or (exbefore P m) (P m) *)
elim H1.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall (x : nat) (_ : and (lt x (S m)) (P x)), or (exbefore P m) (P m) *)
intro.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall _ : and (lt x (S m)) (P x), or (exbefore P m) (P m) *)
intros.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: or (exbefore P m) (P m) *)
elim H2.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall (_ : lt x (S m)) (_ : P x), or (exbefore P m) (P m) *)
intros.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: or (exbefore P m) (P m) *)
elim (le_lt_or_eq x m).
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
(* Goal: forall _ : lt x m, or (exbefore P m) (P m) *)
intros.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
(* Goal: or (exbefore P m) (P m) *)
left.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
(* Goal: exbefore P m *)
apply H.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
(* Goal: @ex nat (fun q : nat => and (lt q m) (P q)) *)
split with x.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
(* Goal: and (lt x m) (P x) *)
split.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
(* Goal: P x *)
(* Goal: lt x m *)
assumption.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
(* Goal: P x *)
assumption.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: forall _ : @eq nat x m, or (exbefore P m) (P m) *)
intros.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: or (exbefore P m) (P m) *)
right.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: P m *)
rewrite H5 in H4.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
(* Goal: P m *)
assumption.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le x m *)
apply (le_S_n x m).
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: le (S x) (S m) *)
assumption.
(* Goal: forall _ : or (exbefore P m) (P m), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
intros.
(* Goal: @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
elim H1.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall _ : exbefore P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
intros.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
case H0.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall (x : nat) (_ : and (lt x m) (P x)), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: exbefore P m *)
assumption.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall (x : nat) (_ : and (lt x m) (P x)), @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
intros.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
split with x.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: and (lt x (S m)) (P x) *)
elim H3.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: forall (_ : lt x m) (_ : P x), and (lt x (S m)) (P x) *)
intros.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: and (lt x (S m)) (P x) *)
split.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: P x *)
(* Goal: lt x (S m) *)
unfold lt in |- *.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: P x *)
(* Goal: le (S x) (S m) *)
unfold lt in H4.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: P x *)
(* Goal: le (S x) (S m) *)
apply le_S.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: P x *)
(* Goal: le (S x) m *)
assumption.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
(* Goal: P x *)
assumption.
(* Goal: forall _ : P m, @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
intros.
(* Goal: @ex nat (fun q : nat => and (lt q (S m)) (P q)) *)
split with m.
(* Goal: and (lt m (S m)) (P m) *)
split.
(* Goal: P m *)
(* Goal: lt m (S m) *)
unfold lt in |- *.
(* Goal: P m *)
(* Goal: le (S m) (S m) *)
apply le_n.
(* Goal: P m *)
assumption.
Qed.
Lemma eqdec : forall n m : nat, n = m \/ n <> m.
Proof.
(* Goal: forall n m : nat, or (@eq nat n m) (not (@eq nat n m)) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall m : nat, or (@eq nat n m) (not (@eq nat n m))) (m : nat), or (@eq nat (S n) m) (not (@eq nat (S n) m)) *)
(* Goal: forall m : nat, or (@eq nat O m) (not (@eq nat O m)) *)
intro.
(* Goal: forall (n : nat) (_ : forall m : nat, or (@eq nat n m) (not (@eq nat n m))) (m : nat), or (@eq nat (S n) m) (not (@eq nat (S n) m)) *)
(* Goal: or (@eq nat O m) (not (@eq nat O m)) *)
case m.
(* Goal: forall (n : nat) (_ : forall m : nat, or (@eq nat n m) (not (@eq nat n m))) (m : nat), or (@eq nat (S n) m) (not (@eq nat (S n) m)) *)
(* Goal: forall n : nat, or (@eq nat O (S n)) (not (@eq nat O (S n))) *)
(* Goal: or (@eq nat O O) (not (@eq nat O O)) *)
left.
(* Goal: forall (n : nat) (_ : forall m : nat, or (@eq nat n m) (not (@eq nat n m))) (m : nat), or (@eq nat (S n) m) (not (@eq nat (S n) m)) *)
(* Goal: forall n : nat, or (@eq nat O (S n)) (not (@eq nat O (S n))) *)
(* Goal: @eq nat O O *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, or (@eq nat n m) (not (@eq nat n m))) (m : nat), or (@eq nat (S n) m) (not (@eq nat (S n) m)) *)
(* Goal: forall n : nat, or (@eq nat O (S n)) (not (@eq nat O (S n))) *)
right.
(* Goal: forall (n : nat) (_ : forall m : nat, or (@eq nat n m) (not (@eq nat n m))) (m : nat), or (@eq nat (S n) m) (not (@eq nat (S n) m)) *)
(* Goal: not (@eq nat O (S n0)) *)
discriminate.
(* Goal: forall (n : nat) (_ : forall m : nat, or (@eq nat n m) (not (@eq nat n m))) (m : nat), or (@eq nat (S n) m) (not (@eq nat (S n) m)) *)
intros.
(* Goal: or (@eq nat (S n0) m) (not (@eq nat (S n0) m)) *)
case m.
(* Goal: forall n : nat, or (@eq nat (S n0) (S n)) (not (@eq nat (S n0) (S n))) *)
(* Goal: or (@eq nat (S n0) O) (not (@eq nat (S n0) O)) *)
right.
(* Goal: forall n : nat, or (@eq nat (S n0) (S n)) (not (@eq nat (S n0) (S n))) *)
(* Goal: not (@eq nat (S n0) O) *)
discriminate.
(* Goal: forall n : nat, or (@eq nat (S n0) (S n)) (not (@eq nat (S n0) (S n))) *)
intro m0.
(* Goal: or (@eq nat (S n0) (S m0)) (not (@eq nat (S n0) (S m0))) *)
elim (H m0).
(* Goal: forall _ : not (@eq nat n0 m0), or (@eq nat (S n0) (S m0)) (not (@eq nat (S n0) (S m0))) *)
(* Goal: forall _ : @eq nat n0 m0, or (@eq nat (S n0) (S m0)) (not (@eq nat (S n0) (S m0))) *)
left.
(* Goal: forall _ : not (@eq nat n0 m0), or (@eq nat (S n0) (S m0)) (not (@eq nat (S n0) (S m0))) *)
(* Goal: @eq nat (S n0) (S m0) *)
rewrite H0.
(* Goal: forall _ : not (@eq nat n0 m0), or (@eq nat (S n0) (S m0)) (not (@eq nat (S n0) (S m0))) *)
(* Goal: @eq nat (S m0) (S m0) *)
reflexivity.
(* Goal: forall _ : not (@eq nat n0 m0), or (@eq nat (S n0) (S m0)) (not (@eq nat (S n0) (S m0))) *)
right.
(* Goal: not (@eq nat (S n0) (S m0)) *)
intro.
(* Goal: False *)
apply H0.
(* Goal: @eq nat n0 m0 *)
inversion H1.
(* Goal: @eq nat m0 m0 *)
reflexivity.
Qed.
Lemma ledec : forall n m : nat, n <= m \/ ~ n <= m.
Proof.
(* Goal: forall n m : nat, or (le n m) (not (le n m)) *)
intros.
(* Goal: or (le n m) (not (le n m)) *)
elim (le_or_lt n m).
(* Goal: forall _ : lt m n, or (le n m) (not (le n m)) *)
(* Goal: forall _ : le n m, or (le n m) (not (le n m)) *)
left.
(* Goal: forall _ : lt m n, or (le n m) (not (le n m)) *)
(* Goal: le n m *)
assumption.
(* Goal: forall _ : lt m n, or (le n m) (not (le n m)) *)
right.
(* Goal: not (le n m) *)
apply lt_not_le.
(* Goal: lt m n *)
assumption.
Qed.
Lemma ltdec : forall n m : nat, n < m \/ ~ n < m.
Proof.
(* Goal: forall n m : nat, or (lt n m) (not (lt n m)) *)
unfold lt in |- *.
(* Goal: forall n m : nat, or (le (S n) m) (not (le (S n) m)) *)
intros.
(* Goal: or (le (S n) m) (not (le (S n) m)) *)
apply ledec.
Qed.
Lemma gedec : forall n m : nat, n >= m \/ ~ n >= m.
Proof.
(* Goal: forall n m : nat, or (ge n m) (not (ge n m)) *)
unfold ge in |- *.
(* Goal: forall n m : nat, or (le m n) (not (le m n)) *)
intros.
(* Goal: or (le m n) (not (le m n)) *)
apply ledec.
Qed.
Lemma gtdec : forall n m : nat, n > m \/ ~ n > m.
Proof.
(* Goal: forall n m : nat, or (gt n m) (not (gt n m)) *)
unfold gt in |- *.
(* Goal: forall n m : nat, or (lt m n) (not (lt m n)) *)
intros.
(* Goal: or (lt m n) (not (lt m n)) *)
apply ltdec.
Qed.
Lemma zeqdec : forall x y : Z, x = y \/ x <> y.
Proof.
(* Goal: forall x y : Z, or (@eq Z x y) (not (@eq Z x y)) *)
intros.
(* Goal: or (@eq Z x y) (not (@eq Z x y)) *)
elim (dec_eq x y).
(* Goal: forall _ : not (@eq Z x y), or (@eq Z x y) (not (@eq Z x y)) *)
(* Goal: forall _ : @eq Z x y, or (@eq Z x y) (not (@eq Z x y)) *)
left.
(* Goal: forall _ : not (@eq Z x y), or (@eq Z x y) (not (@eq Z x y)) *)
(* Goal: @eq Z x y *)
assumption.
(* Goal: forall _ : not (@eq Z x y), or (@eq Z x y) (not (@eq Z x y)) *)
right.
(* Goal: not (@eq Z x y) *)
assumption.
Qed.
Lemma notdec : forall P : Prop, P \/ ~ P -> ~ P \/ ~ ~ P.
Proof.
(* Goal: forall (P : Prop) (_ : or P (not P)), or (not P) (not (not P)) *)
intros.
(* Goal: or (not P) (not (not P)) *)
elim H.
(* Goal: forall _ : not P, or (not P) (not (not P)) *)
(* Goal: forall _ : P, or (not P) (not (not P)) *)
right.
(* Goal: forall _ : not P, or (not P) (not (not P)) *)
(* Goal: not (not P) *)
intro.
(* Goal: forall _ : not P, or (not P) (not (not P)) *)
(* Goal: False *)
apply H1.
(* Goal: forall _ : not P, or (not P) (not (not P)) *)
(* Goal: P *)
assumption.
(* Goal: forall _ : not P, or (not P) (not (not P)) *)
left.
(* Goal: not P *)
assumption.
Qed.
Lemma anddec :
forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> P /\ Q \/ ~ (P /\ Q).
Proof.
(* Goal: forall (P Q : Prop) (_ : or P (not P)) (_ : or Q (not Q)), or (and P Q) (not (and P Q)) *)
intros.
(* Goal: or (and P Q) (not (and P Q)) *)
elim H.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: forall _ : P, or (and P Q) (not (and P Q)) *)
elim H0.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (and P Q) (not (and P Q)) *)
(* Goal: forall (_ : Q) (_ : P), or (and P Q) (not (and P Q)) *)
left.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (and P Q) (not (and P Q)) *)
(* Goal: and P Q *)
split.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (and P Q) (not (and P Q)) *)
(* Goal: Q *)
(* Goal: P *)
assumption.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (and P Q) (not (and P Q)) *)
(* Goal: Q *)
assumption.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (and P Q) (not (and P Q)) *)
right.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: not (and P Q) *)
intro.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: False *)
apply H1.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: Q *)
elim H3.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: forall (_ : P) (_ : Q), Q *)
intros.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
(* Goal: Q *)
assumption.
(* Goal: forall _ : not P, or (and P Q) (not (and P Q)) *)
right.
(* Goal: not (and P Q) *)
intro.
(* Goal: False *)
apply H1.
(* Goal: P *)
elim H2.
(* Goal: forall (_ : P) (_ : Q), P *)
intros.
(* Goal: P *)
assumption.
Qed.
Lemma ordec :
forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> (P \/ Q) \/ ~ (P \/ Q).
Proof.
(* Goal: forall (P Q : Prop) (_ : or P (not P)) (_ : or Q (not Q)), or (or P Q) (not (or P Q)) *)
intros.
(* Goal: or (or P Q) (not (or P Q)) *)
elim H.
(* Goal: forall _ : not P, or (or P Q) (not (or P Q)) *)
(* Goal: forall _ : P, or (or P Q) (not (or P Q)) *)
left.
(* Goal: forall _ : not P, or (or P Q) (not (or P Q)) *)
(* Goal: or P Q *)
left.
(* Goal: forall _ : not P, or (or P Q) (not (or P Q)) *)
(* Goal: P *)
assumption.
(* Goal: forall _ : not P, or (or P Q) (not (or P Q)) *)
elim H0.
(* Goal: forall (_ : not Q) (_ : not P), or (or P Q) (not (or P Q)) *)
(* Goal: forall (_ : Q) (_ : not P), or (or P Q) (not (or P Q)) *)
left.
(* Goal: forall (_ : not Q) (_ : not P), or (or P Q) (not (or P Q)) *)
(* Goal: or P Q *)
right.
(* Goal: forall (_ : not Q) (_ : not P), or (or P Q) (not (or P Q)) *)
(* Goal: Q *)
assumption.
(* Goal: forall (_ : not Q) (_ : not P), or (or P Q) (not (or P Q)) *)
right.
(* Goal: not (or P Q) *)
intro.
(* Goal: False *)
elim H3.
(* Goal: forall _ : Q, False *)
(* Goal: forall _ : P, False *)
assumption.
(* Goal: forall _ : Q, False *)
assumption.
Qed.
Lemma impdec :
forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> (P -> Q) \/ ~ (P -> Q).
Proof.
(* Goal: forall (P Q : Prop) (_ : or P (not P)) (_ : or Q (not Q)), or (forall _ : P, Q) (not (forall _ : P, Q)) *)
intros.
(* Goal: or (forall _ : P, Q) (not (forall _ : P, Q)) *)
elim H.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: forall _ : P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
elim H0.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: forall (_ : Q) (_ : P), or (forall _ : P, Q) (not (forall _ : P, Q)) *)
left.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: forall _ : P, Q *)
intros.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: Q *)
assumption.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: forall (_ : not Q) (_ : P), or (forall _ : P, Q) (not (forall _ : P, Q)) *)
right.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: not (forall _ : P, Q) *)
intro.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: False *)
apply H1.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: Q *)
apply H3.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
(* Goal: P *)
assumption.
(* Goal: forall _ : not P, or (forall _ : P, Q) (not (forall _ : P, Q)) *)
left.
(* Goal: forall _ : P, Q *)
intros.
(* Goal: Q *)
elim H1.
(* Goal: P *)
assumption.
Qed.
Lemma iffdec :
forall P Q : Prop, P \/ ~ P -> Q \/ ~ Q -> (P <-> Q) \/ ~ (P <-> Q).
Proof.
(* Goal: forall (P Q : Prop) (_ : or P (not P)) (_ : or Q (not Q)), or (iff P Q) (not (iff P Q)) *)
unfold iff in |- *.
(* Goal: forall (P Q : Prop) (_ : or P (not P)) (_ : or Q (not Q)), or (and (forall _ : P, Q) (forall _ : Q, P)) (not (and (forall _ : P, Q) (forall _ : Q, P))) *)
intros.
(* Goal: or (and (forall _ : P, Q) (forall _ : Q, P)) (not (and (forall _ : P, Q) (forall _ : Q, P))) *)
apply anddec.
(* Goal: or (forall _ : Q, P) (not (forall _ : Q, P)) *)
(* Goal: or (forall _ : P, Q) (not (forall _ : P, Q)) *)
apply impdec.
(* Goal: or (forall _ : Q, P) (not (forall _ : Q, P)) *)
(* Goal: or Q (not Q) *)
(* Goal: or P (not P) *)
assumption.
(* Goal: or (forall _ : Q, P) (not (forall _ : Q, P)) *)
(* Goal: or Q (not Q) *)
assumption.
(* Goal: or (forall _ : Q, P) (not (forall _ : Q, P)) *)
apply impdec.
(* Goal: or P (not P) *)
(* Goal: or Q (not Q) *)
assumption.
(* Goal: or P (not P) *)
assumption.
Qed.
Theorem alldec :
forall (P : nat -> Prop) (N : nat),
(forall n : nat, P n \/ ~ P n) ->
(forall x : nat, x < N -> P x) \/ ~ (forall x : nat, x < N -> P x).
Proof.
(* Goal: forall (P : forall _ : nat, Prop) (N : nat) (_ : forall n : nat, or (P n) (not (P n))), or (forall (x : nat) (_ : lt x N), P x) (not (forall (x : nat) (_ : lt x N), P x)) *)
intro P.
(* Goal: forall (N : nat) (_ : forall n : nat, or (P n) (not (P n))), or (forall (x : nat) (_ : lt x N), P x) (not (forall (x : nat) (_ : lt x N), P x)) *)
simple induction N.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (forall (x : nat) (_ : lt x n), P x) (not (forall (x : nat) (_ : lt x n), P x))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (forall (x : nat) (_ : lt x (S n)), P x) (not (forall (x : nat) (_ : lt x (S n)), P x)) *)
(* Goal: forall _ : forall n : nat, or (P n) (not (P n)), or (forall (x : nat) (_ : lt x O), P x) (not (forall (x : nat) (_ : lt x O), P x)) *)
left.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (forall (x : nat) (_ : lt x n), P x) (not (forall (x : nat) (_ : lt x n), P x))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (forall (x : nat) (_ : lt x (S n)), P x) (not (forall (x : nat) (_ : lt x (S n)), P x)) *)
(* Goal: forall (x : nat) (_ : lt x O), P x *)
intros.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (forall (x : nat) (_ : lt x n), P x) (not (forall (x : nat) (_ : lt x n), P x))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (forall (x : nat) (_ : lt x (S n)), P x) (not (forall (x : nat) (_ : lt x (S n)), P x)) *)
(* Goal: P x *)
elim (lt_n_O x).
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (forall (x : nat) (_ : lt x n), P x) (not (forall (x : nat) (_ : lt x n), P x))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (forall (x : nat) (_ : lt x (S n)), P x) (not (forall (x : nat) (_ : lt x (S n)), P x)) *)
(* Goal: lt x O *)
assumption.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (forall (x : nat) (_ : lt x n), P x) (not (forall (x : nat) (_ : lt x n), P x))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (forall (x : nat) (_ : lt x (S n)), P x) (not (forall (x : nat) (_ : lt x (S n)), P x)) *)
intros M IH decP.
(* Goal: or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
elim IH.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall _ : forall (x : nat) (_ : lt x M), P x, or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
elim (decP M).
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : P M) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
left.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (x : nat) (_ : lt x (S M)), P x *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: P x *)
unfold lt in H1.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: P x *)
elim (le_lt_or_eq x M).
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, P x *)
(* Goal: forall _ : lt x M, P x *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, P x *)
(* Goal: P x *)
apply H0.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, P x *)
(* Goal: lt x M *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, P x *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le x M *)
(* Goal: P x *)
rewrite H2.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le x M *)
(* Goal: P M *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le x M *)
apply le_S_n.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: le (S x) (S M) *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: forall (_ : not (P M)) (_ : forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
right.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x (S M)), P x) *)
intro.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: False *)
apply H.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: P M *)
apply H1.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
(* Goal: lt M (S M) *)
apply lt_n_Sn.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), P x), or (forall (x : nat) (_ : lt x (S M)), P x) (not (forall (x : nat) (_ : lt x (S M)), P x)) *)
right.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: not (forall (x : nat) (_ : lt x (S M)), P x) *)
intro.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: False *)
apply H.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall (x : nat) (_ : lt x M), P x *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: P x *)
apply H0.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: lt x (S M) *)
apply lt_S.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: lt x M *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
assumption.
Qed.
Theorem exdec :
forall (P : nat -> Prop) (N : nat),
(forall n : nat, P n \/ ~ P n) ->
(exists x : nat, x < N /\ P x) \/ ~ (exists x : nat, x < N /\ P x).
Proof.
(* Goal: forall (P : forall _ : nat, Prop) (N : nat) (_ : forall n : nat, or (P n) (not (P n))), or (@ex nat (fun x : nat => and (lt x N) (P x))) (not (@ex nat (fun x : nat => and (lt x N) (P x)))) *)
intro P.
(* Goal: forall (N : nat) (_ : forall n : nat, or (P n) (not (P n))), or (@ex nat (fun x : nat => and (lt x N) (P x))) (not (@ex nat (fun x : nat => and (lt x N) (P x)))) *)
simple induction N.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: forall _ : forall n : nat, or (P n) (not (P n)), or (@ex nat (fun x : nat => and (lt x O) (P x))) (not (@ex nat (fun x : nat => and (lt x O) (P x)))) *)
intro decP.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: or (@ex nat (fun x : nat => and (lt x O) (P x))) (not (@ex nat (fun x : nat => and (lt x O) (P x)))) *)
right.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: not (@ex nat (fun x : nat => and (lt x O) (P x))) *)
intro.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: False *)
elim H.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: forall (x : nat) (_ : and (lt x O) (P x)), False *)
intros.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: False *)
elim H0.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: forall (_ : lt x O) (_ : P x), False *)
intros.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: False *)
elim (lt_n_O x).
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
(* Goal: lt x O *)
assumption.
(* Goal: forall (n : nat) (_ : forall _ : forall n0 : nat, or (P n0) (not (P n0)), or (@ex nat (fun x : nat => and (lt x n) (P x))) (not (@ex nat (fun x : nat => and (lt x n) (P x))))) (_ : forall n0 : nat, or (P n0) (not (P n0))), or (@ex nat (fun x : nat => and (lt x (S n)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S n)) (P x)))) *)
intros M IH decP.
(* Goal: or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
elim IH.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: forall _ : @ex nat (fun x : nat => and (lt x M) (P x)), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
left.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
elim H.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: forall (x : nat) (_ : and (lt x M) (P x)), @ex nat (fun x0 : nat => and (lt x0 (S M)) (P x0)) *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
split with x.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: and (lt x (S M)) (P x) *)
elim H0.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: forall (_ : lt x M) (_ : P x), and (lt x (S M)) (P x) *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: and (lt x (S M)) (P x) *)
split.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: P x *)
(* Goal: lt x (S M) *)
apply lt_S.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: P x *)
(* Goal: lt x M *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: P x *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (@ex nat (fun x : nat => and (lt x M) (P x))), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
elim (decP M).
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: forall _ : P M, or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
left.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
split with M.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: and (lt M (S M)) (P M) *)
split.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: P M *)
(* Goal: lt M (S M) *)
apply lt_n_Sn.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
(* Goal: P M *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall _ : not (P M), or (@ex nat (fun x : nat => and (lt x (S M)) (P x))) (not (@ex nat (fun x : nat => and (lt x (S M)) (P x)))) *)
right.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: not (@ex nat (fun x : nat => and (lt x (S M)) (P x))) *)
intro.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: False *)
elim H1.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall (x : nat) (_ : and (lt x (S M)) (P x)), False *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: False *)
elim H2.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: forall (_ : lt x (S M)) (_ : P x), False *)
intros.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: False *)
unfold lt in H3.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: False *)
elim (le_lt_or_eq x M).
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, False *)
(* Goal: forall _ : lt x M, False *)
intro.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, False *)
(* Goal: False *)
apply H.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, False *)
(* Goal: @ex nat (fun x : nat => and (lt x M) (P x)) *)
split with x.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, False *)
(* Goal: and (lt x M) (P x) *)
split.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, False *)
(* Goal: P x *)
(* Goal: lt x M *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, False *)
(* Goal: P x *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, False *)
intro.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: False *)
apply H0.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: P M *)
rewrite <- H5.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
(* Goal: P x *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le x M *)
apply le_S_n.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
(* Goal: le (S x) (S M) *)
assumption.
(* Goal: forall n : nat, or (P n) (not (P n)) *)
assumption.
Qed.
Theorem decDeMorgan :
forall (N : nat) (P : nat -> Prop),
(forall n : nat, P n \/ ~ P n) ->
((exists x : nat, x < N /\ P x) <-> ~ (forall x : nat, x < N -> ~ P x)).
Proof.
(* Goal: forall (N : nat) (P : forall _ : nat, Prop) (_ : forall n : nat, or (P n) (not (P n))), iff (@ex nat (fun x : nat => and (lt x N) (P x))) (not (forall (x : nat) (_ : lt x N), not (P x))) *)
split.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
(* Goal: forall _ : @ex nat (fun x : nat => and (lt x N) (P x)), not (forall (x : nat) (_ : lt x N), not (P x)) *)
intro.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x N), not (P x)) *)
elim H0.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
(* Goal: forall (x : nat) (_ : and (lt x N) (P x)), not (forall (x0 : nat) (_ : lt x0 N), not (P x0)) *)
intros.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x N), not (P x)) *)
intro.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
(* Goal: False *)
elim H1.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
(* Goal: forall (_ : lt x N) (_ : P x), False *)
intros.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
(* Goal: False *)
apply (H2 x H3 H4).
(* Goal: forall _ : not (forall (x : nat) (_ : lt x N), not (P x)), @ex nat (fun x : nat => and (lt x N) (P x)) *)
elim N.
(* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x O), not (P x)), @ex nat (fun x : nat => and (lt x O) (P x)) *)
intros.
(* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *)
(* Goal: @ex nat (fun x : nat => and (lt x O) (P x)) *)
elim H0.
(* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *)
(* Goal: forall (x : nat) (_ : lt x O), not (P x) *)
intros.
(* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *)
(* Goal: not (P x) *)
elim (lt_n_O x).
(* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *)
(* Goal: lt x O *)
assumption.
(* Goal: forall (n : nat) (_ : forall _ : not (forall (x : nat) (_ : lt x n), not (P x)), @ex nat (fun x : nat => and (lt x n) (P x))) (_ : not (forall (x : nat) (_ : lt x (S n)), not (P x))), @ex nat (fun x : nat => and (lt x (S n)) (P x)) *)
intros M IH.
(* Goal: forall _ : not (forall (x : nat) (_ : lt x (S M)), not (P x)), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
intros.
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
elim (H M).
(* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
(* Goal: forall _ : P M, @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
intros.
(* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
split with M.
(* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
(* Goal: and (lt M (S M)) (P M) *)
split.
(* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
(* Goal: P M *)
(* Goal: lt M (S M) *)
apply lt_n_Sn.
(* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
(* Goal: P M *)
assumption.
(* Goal: forall _ : not (P M), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
intros.
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
cut (~ (forall x : nat, x < M -> ~ P x)).
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: forall _ : not (forall (x : nat) (_ : lt x M), not (P x)), @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
intros.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
elim IH.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: forall (x : nat) (_ : and (lt x M) (P x)), @ex nat (fun x0 : nat => and (lt x0 (S M)) (P x0)) *)
intros.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: @ex nat (fun x : nat => and (lt x (S M)) (P x)) *)
split with x.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: and (lt x (S M)) (P x) *)
elim H3.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: forall (_ : lt x M) (_ : P x), and (lt x (S M)) (P x) *)
intros.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: and (lt x (S M)) (P x) *)
split.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: P x *)
(* Goal: lt x (S M) *)
apply lt_S.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: P x *)
(* Goal: lt x M *)
assumption.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: P x *)
assumption.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
assumption.
(* Goal: not (forall (x : nat) (_ : lt x M), not (P x)) *)
intro.
(* Goal: False *)
apply H0.
(* Goal: forall (x : nat) (_ : lt x (S M)), not (P x) *)
intros.
(* Goal: not (P x) *)
elim (le_lt_or_eq x M).
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, not (P x) *)
(* Goal: forall _ : lt x M, not (P x) *)
intros.
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, not (P x) *)
(* Goal: not (P x) *)
apply H2.
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, not (P x) *)
(* Goal: lt x M *)
assumption.
(* Goal: le x M *)
(* Goal: forall _ : @eq nat x M, not (P x) *)
intros.
(* Goal: le x M *)
(* Goal: not (P x) *)
rewrite H4.
(* Goal: le x M *)
(* Goal: not (P M) *)
assumption.
(* Goal: le x M *)
unfold lt in H3.
(* Goal: le x M *)
apply le_S_n.
(* Goal: le (S x) (S M) *)
assumption.
Qed.
Definition istrue (b : bool) := if b then True else False.
Lemma beq_nat_ok : forall n m : nat, n = m <-> istrue (beq_nat n m).
Proof.
(* Goal: forall n m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m)) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: forall m : nat, iff (@eq nat O m) (istrue (Nat.eqb O m)) *)
intro m.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: iff (@eq nat O m) (istrue (Nat.eqb O m)) *)
case m.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (istrue (Nat.eqb O (S n))) *)
(* Goal: iff (@eq nat O O) (istrue (Nat.eqb O O)) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (istrue (Nat.eqb O (S n))) *)
(* Goal: iff (@eq nat O O) True *)
tauto.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (istrue (Nat.eqb O (S n))) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) False *)
split.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: forall _ : False, @eq nat O (S n0) *)
(* Goal: forall _ : @eq nat O (S n0), False *)
discriminate.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
(* Goal: forall _ : False, @eq nat O (S n0) *)
tauto.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (istrue (Nat.eqb n m))) (m : nat), iff (@eq nat (S n) m) (istrue (Nat.eqb (S n) m)) *)
intros.
(* Goal: iff (@eq nat (S n0) m) (istrue (Nat.eqb (S n0) m)) *)
case m.
(* Goal: forall n : nat, iff (@eq nat (S n0) (S n)) (istrue (Nat.eqb (S n0) (S n))) *)
(* Goal: iff (@eq nat (S n0) O) (istrue (Nat.eqb (S n0) O)) *)
simpl in |- *.
(* Goal: forall n : nat, iff (@eq nat (S n0) (S n)) (istrue (Nat.eqb (S n0) (S n))) *)
(* Goal: iff (@eq nat (S n0) O) False *)
split.
(* Goal: forall n : nat, iff (@eq nat (S n0) (S n)) (istrue (Nat.eqb (S n0) (S n))) *)
(* Goal: forall _ : False, @eq nat (S n0) O *)
(* Goal: forall _ : @eq nat (S n0) O, False *)
discriminate.
(* Goal: forall n : nat, iff (@eq nat (S n0) (S n)) (istrue (Nat.eqb (S n0) (S n))) *)
(* Goal: forall _ : False, @eq nat (S n0) O *)
tauto.
(* Goal: forall n : nat, iff (@eq nat (S n0) (S n)) (istrue (Nat.eqb (S n0) (S n))) *)
intros.
(* Goal: iff (@eq nat (S n0) (S n1)) (istrue (Nat.eqb (S n0) (S n1))) *)
elim (H n1).
(* Goal: forall (_ : forall _ : @eq nat n0 n1, istrue (Nat.eqb n0 n1)) (_ : forall _ : istrue (Nat.eqb n0 n1), @eq nat n0 n1), iff (@eq nat (S n0) (S n1)) (istrue (Nat.eqb (S n0) (S n1))) *)
split.
(* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *)
(* Goal: forall _ : @eq nat (S n0) (S n1), istrue (Nat.eqb (S n0) (S n1)) *)
intros.
(* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *)
(* Goal: istrue (Nat.eqb (S n0) (S n1)) *)
simpl in |- *.
(* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *)
(* Goal: istrue (Nat.eqb n0 n1) *)
apply H0.
(* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *)
(* Goal: @eq nat n0 n1 *)
injection H2.
(* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *)
(* Goal: forall _ : @eq nat n0 n1, @eq nat n0 n1 *)
tauto.
(* Goal: forall _ : istrue (Nat.eqb (S n0) (S n1)), @eq nat (S n0) (S n1) *)
simpl in |- *.
(* Goal: forall _ : istrue (Nat.eqb n0 n1), @eq nat (S n0) (S n1) *)
intros.
(* Goal: @eq nat (S n0) (S n1) *)
rewrite (H1 H2).
(* Goal: @eq nat (S n1) (S n1) *)
reflexivity.
Qed.
Lemma beq_nat_eq : forall n m : nat, n = m <-> beq_nat n m = true.
Proof.
(* Goal: forall n m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall m : nat, iff (@eq nat O m) (@eq bool (Nat.eqb O m) true) *)
intro.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: iff (@eq nat O m) (@eq bool (Nat.eqb O m) true) *)
case m.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (@eq bool (Nat.eqb O (S n)) true) *)
(* Goal: iff (@eq nat O O) (@eq bool (Nat.eqb O O) true) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (@eq bool (Nat.eqb O (S n)) true) *)
(* Goal: iff (@eq nat O O) (@eq bool true true) *)
split.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (@eq bool (Nat.eqb O (S n)) true) *)
(* Goal: forall _ : @eq bool true true, @eq nat O O *)
(* Goal: forall _ : @eq nat O O, @eq bool true true *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (@eq bool (Nat.eqb O (S n)) true) *)
(* Goal: forall _ : @eq bool true true, @eq nat O O *)
reflexivity.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (@eq bool (Nat.eqb O (S n)) true) *)
simpl in |- *.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall n : nat, iff (@eq nat O (S n)) (@eq bool false true) *)
split.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall _ : @eq bool false true, @eq nat O (S n0) *)
(* Goal: forall _ : @eq nat O (S n0), @eq bool false true *)
intro.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall _ : @eq bool false true, @eq nat O (S n0) *)
(* Goal: @eq bool false true *)
discriminate.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: forall _ : @eq bool false true, @eq nat O (S n0) *)
intro.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
(* Goal: @eq nat O (S n0) *)
discriminate.
(* Goal: forall (n : nat) (_ : forall m : nat, iff (@eq nat n m) (@eq bool (Nat.eqb n m) true)) (m : nat), iff (@eq nat (S n) m) (@eq bool (Nat.eqb (S n) m) true) *)
intros n1 IH.
(* Goal: forall m : nat, iff (@eq nat (S n1) m) (@eq bool (Nat.eqb (S n1) m) true) *)
intro m.
(* Goal: iff (@eq nat (S n1) m) (@eq bool (Nat.eqb (S n1) m) true) *)
case m.
(* Goal: forall n : nat, iff (@eq nat (S n1) (S n)) (@eq bool (Nat.eqb (S n1) (S n)) true) *)
(* Goal: iff (@eq nat (S n1) O) (@eq bool (Nat.eqb (S n1) O) true) *)
simpl in |- *.
(* Goal: forall n : nat, iff (@eq nat (S n1) (S n)) (@eq bool (Nat.eqb (S n1) (S n)) true) *)
(* Goal: iff (@eq nat (S n1) O) (@eq bool false true) *)
split.
(* Goal: forall n : nat, iff (@eq nat (S n1) (S n)) (@eq bool (Nat.eqb (S n1) (S n)) true) *)
(* Goal: forall _ : @eq bool false true, @eq nat (S n1) O *)
(* Goal: forall _ : @eq nat (S n1) O, @eq bool false true *)
intro.
(* Goal: forall n : nat, iff (@eq nat (S n1) (S n)) (@eq bool (Nat.eqb (S n1) (S n)) true) *)
(* Goal: forall _ : @eq bool false true, @eq nat (S n1) O *)
(* Goal: @eq bool false true *)
discriminate.
(* Goal: forall n : nat, iff (@eq nat (S n1) (S n)) (@eq bool (Nat.eqb (S n1) (S n)) true) *)
(* Goal: forall _ : @eq bool false true, @eq nat (S n1) O *)
intro.
(* Goal: forall n : nat, iff (@eq nat (S n1) (S n)) (@eq bool (Nat.eqb (S n1) (S n)) true) *)
(* Goal: @eq nat (S n1) O *)
discriminate.
(* Goal: forall n : nat, iff (@eq nat (S n1) (S n)) (@eq bool (Nat.eqb (S n1) (S n)) true) *)
intro m1.
(* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *)
intros.
(* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb (S n1) (S m1)) true) *)
simpl in |- *.
(* Goal: iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb n1 m1) true) *)
elim (IH m1).
(* Goal: forall (_ : forall _ : @eq nat n1 m1, @eq bool (Nat.eqb n1 m1) true) (_ : forall _ : @eq bool (Nat.eqb n1 m1) true, @eq nat n1 m1), iff (@eq nat (S n1) (S m1)) (@eq bool (Nat.eqb n1 m1) true) *)
split.
(* Goal: forall _ : @eq bool (Nat.eqb n1 m1) true, @eq nat (S n1) (S m1) *)
(* Goal: forall _ : @eq nat (S n1) (S m1), @eq bool (Nat.eqb n1 m1) true *)
intro.
(* Goal: forall _ : @eq bool (Nat.eqb n1 m1) true, @eq nat (S n1) (S m1) *)
(* Goal: @eq bool (Nat.eqb n1 m1) true *)
injection H1.
(* Goal: forall _ : @eq bool (Nat.eqb n1 m1) true, @eq nat (S n1) (S m1) *)
(* Goal: forall _ : @eq nat n1 m1, @eq bool (Nat.eqb n1 m1) true *)
assumption.
(* Goal: forall _ : @eq bool (Nat.eqb n1 m1) true, @eq nat (S n1) (S m1) *)
intros.
(* Goal: @eq nat (S n1) (S m1) *)
rewrite H0.
(* Goal: @eq bool (Nat.eqb n1 m1) true *)
(* Goal: @eq nat (S m1) (S m1) *)
reflexivity.
(* Goal: @eq bool (Nat.eqb n1 m1) true *)
assumption.
Qed.
Lemma beq_nat_neq : forall n m : nat, n <> m <-> beq_nat n m = false.
Lemma zeq_bool_eq : forall x y : Z, x = y <-> Zeq_bool x y = true.
Proof.
(* Goal: forall x y : Z, iff (@eq Z x y) (@eq bool (Zeq_bool x y) true) *)
intros.
(* Goal: iff (@eq Z x y) (@eq bool (Zeq_bool x y) true) *)
elim (Zcompare_Eq_iff_eq x y).
(* Goal: forall (_ : forall _ : @eq comparison (Z.compare x y) Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison (Z.compare x y) Eq), iff (@eq Z x y) (@eq bool (Zeq_bool x y) true) *)
intros.
(* Goal: iff (@eq Z x y) (@eq bool (Zeq_bool x y) true) *)
unfold Zeq_bool in |- *.
(* Goal: iff (@eq Z x y) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true) *)
split.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true, @eq Z x y *)
(* Goal: forall _ : @eq Z x y, @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true *)
intro.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true, @eq Z x y *)
(* Goal: @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true *)
rewrite H0.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true, @eq Z x y *)
(* Goal: @eq Z x y *)
(* Goal: @eq bool true true *)
reflexivity.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true, @eq Z x y *)
(* Goal: @eq Z x y *)
assumption.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true, @eq Z x y *)
intro.
(* Goal: @eq Z x y *)
apply H.
(* Goal: @eq comparison (Z.compare x y) Eq *)
generalize H1.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end true, @eq comparison (Z.compare x y) Eq *)
elim (x ?= y)%Z.
(* Goal: forall _ : @eq bool false true, @eq comparison Gt Eq *)
(* Goal: forall _ : @eq bool false true, @eq comparison Lt Eq *)
(* Goal: forall _ : @eq bool true true, @eq comparison Eq Eq *)
intro.
(* Goal: forall _ : @eq bool false true, @eq comparison Gt Eq *)
(* Goal: forall _ : @eq bool false true, @eq comparison Lt Eq *)
(* Goal: @eq comparison Eq Eq *)
reflexivity.
(* Goal: forall _ : @eq bool false true, @eq comparison Gt Eq *)
(* Goal: forall _ : @eq bool false true, @eq comparison Lt Eq *)
intro.
(* Goal: forall _ : @eq bool false true, @eq comparison Gt Eq *)
(* Goal: @eq comparison Lt Eq *)
discriminate H2.
(* Goal: forall _ : @eq bool false true, @eq comparison Gt Eq *)
intro.
(* Goal: @eq comparison Gt Eq *)
discriminate H2.
Qed.
Lemma zeq_bool_neq : forall x y : Z, x <> y <-> Zeq_bool x y = false.
Proof.
(* Goal: forall x y : Z, iff (not (@eq Z x y)) (@eq bool (Zeq_bool x y) false) *)
intros.
(* Goal: iff (not (@eq Z x y)) (@eq bool (Zeq_bool x y) false) *)
elim (Zcompare_Eq_iff_eq x y).
(* Goal: forall (_ : forall _ : @eq comparison (Z.compare x y) Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison (Z.compare x y) Eq), iff (not (@eq Z x y)) (@eq bool (Zeq_bool x y) false) *)
intros.
(* Goal: iff (not (@eq Z x y)) (@eq bool (Zeq_bool x y) false) *)
unfold Zeq_bool in |- *.
(* Goal: iff (not (@eq Z x y)) (@eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false) *)
split.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall _ : not (@eq Z x y), @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false *)
generalize H0.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison (Z.compare x y) Eq) (_ : not (@eq Z x y)), @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false *)
generalize H.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison (Z.compare x y) Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison (Z.compare x y) Eq) (_ : not (@eq Z x y)), @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false *)
elim (x ?= y)%Z.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: forall (_ : forall _ : @eq comparison Lt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: forall (_ : forall _ : @eq comparison Eq Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Eq Eq) (_ : not (@eq Z x y)), @eq bool true false *)
intros.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: forall (_ : forall _ : @eq comparison Lt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: @eq bool true false *)
elim H3.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: forall (_ : forall _ : @eq comparison Lt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: @eq Z x y *)
apply H1.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: forall (_ : forall _ : @eq comparison Lt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: @eq comparison Eq Eq *)
reflexivity.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: forall (_ : forall _ : @eq comparison Lt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
intros.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
(* Goal: @eq bool false false *)
reflexivity.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq comparison Gt Eq, @eq Z x y) (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : not (@eq Z x y)), @eq bool false false *)
intros.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
(* Goal: @eq bool false false *)
reflexivity.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
intros.
(* Goal: not (@eq Z x y) *)
generalize H1.
(* Goal: forall _ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false, not (@eq Z x y) *)
generalize H0.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison (Z.compare x y) Eq) (_ : @eq bool match Z.compare x y with | Eq => true | Lt => false | Gt => false end false), not (@eq Z x y) *)
elim (x ?= y)%Z.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Eq Eq) (_ : @eq bool true false), not (@eq Z x y) *)
intros.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: not (@eq Z x y) *)
discriminate H3.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Lt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
intros.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: not (@eq Z x y) *)
intro.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: False *)
cut (Datatypes.Lt = Datatypes.Eq).
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: @eq comparison Lt Eq *)
(* Goal: forall _ : @eq comparison Lt Eq, False *)
discriminate.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: @eq comparison Lt Eq *)
apply H2.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
(* Goal: @eq Z x y *)
assumption.
(* Goal: forall (_ : forall _ : @eq Z x y, @eq comparison Gt Eq) (_ : @eq bool false false), not (@eq Z x y) *)
intros.
(* Goal: not (@eq Z x y) *)
intro.
(* Goal: False *)
cut (Datatypes.Gt = Datatypes.Eq).
(* Goal: @eq comparison Gt Eq *)
(* Goal: forall _ : @eq comparison Gt Eq, False *)
discriminate.
(* Goal: @eq comparison Gt Eq *)
apply H2.
(* Goal: @eq Z x y *)
assumption.
Qed.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrfun ssrbool eqtype choice ssrnat seq fintype generic_quotient.
From mathcomp
Require Import bigop ssralg poly polydiv matrix mxpoly countalg ring_quotient.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GRing.Theory.
Local Open Scope ring_scope.
Import Pdiv.Ring.
Import PreClosedField.
Module ClosedFieldQE.
Section ClosedFieldQE.
Variables (F : fieldType) (F_closed : GRing.ClosedField.axiom F).
Notation fF := (@GRing.formula F).
Notation tF := (@GRing.term F).
Notation qf f := (GRing.qf_form f && GRing.rformula f).
Definition polyF := seq tF.
Lemma qf_simpl (f : fF) :
(qf f -> GRing.qf_form f) * (qf f -> GRing.rformula f).
Proof.
(* Goal: prod (forall _ : is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) f) (@GRing.rformula (GRing.Field.unitRingType F) f)), is_true (@GRing.qf_form (GRing.Field.unitRingType F) f)) (forall _ : is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) f) (@GRing.rformula (GRing.Field.unitRingType F) f)), is_true (@GRing.rformula (GRing.Field.unitRingType F) f)) *)
by split=> /andP[].
Qed.
Notation cps T := ((T -> fF) -> fF).
Definition ret T1 : T1 -> cps T1 := fun x k => k x.
Arguments ret {T1} x k /.
Definition bind T1 T2 (x : cps T1) (f : T1 -> cps T2) : cps T2 :=
fun k => x (fun x => f x k).
Arguments bind {T1 T2} x f k /.
Notation "''let' x <- y ; z" :=
(bind y (fun x => z)) (at level 99, x at level 0, y at level 0,
format "'[hv' ''let' x <- y ; '/' z ']'").
Definition cpsif T (c : fF) (t : T) (e : T) : cps T :=
fun k => GRing.If c (k t) (k e).
Arguments cpsif {T} c t e k /.
Notation "''if' c1 'then' c2 'else' c3" := (cpsif c1%T c2%T c3%T)
(at level 200, right associativity, format
"'[hv ' ''if' c1 '/' '[' 'then' c2 ']' '/' '[' 'else' c3 ']' ']'").
Notation eval := GRing.eval.
Notation rterm := GRing.rterm.
Notation qf_eval := GRing.qf_eval.
Fixpoint eval_poly (e : seq F) pf :=
if pf is c :: q then eval_poly e q * 'X + (eval e c)%:P else 0.
Definition rpoly (p : polyF) := all (@rterm F) p.
Definition sizeT : polyF -> cps nat := (fix loop p :=
if p isn't c :: q then ret 0%N
else 'let n <- loop q;
if n is m.+1 then ret m.+2 else
'if (c == 0) then 0%N else 1%N).
Definition qf_red_cps T (x : cps T) (y : _ -> T) :=
forall e k, qf_eval e (x k) = qf_eval e (k (y e)).
Notation "x ->_ e y" := (qf_red_cps x (fun e => y))
(e ident, at level 90, format "x ->_ e y").
Definition qf_cps T D (x : cps T) :=
forall k, (forall y, D y -> qf (k y)) -> qf (x k).
Lemma qf_cps_ret T D (x : T) : D x -> qf_cps D (ret x).
Proof.
(* Goal: forall _ : D x, @qf_cps T D (@ret T x) *)
move=> ??; exact.
Qed.
Hint Resolve qf_cps_ret : core.
Lemma qf_cps_bind T1 D1 T2 D2 (x : cps T1) (f : T1 -> cps T2) :
qf_cps D1 x -> (forall x, D1 x -> qf_cps D2 (f x)) -> qf_cps D2 (bind x f).
Proof.
(* Goal: forall (_ : @qf_cps T1 D1 x) (_ : forall (x : T1) (_ : D1 x), @qf_cps T2 D2 (f x)), @qf_cps T2 D2 (@bind T1 T2 x f) *)
by move=> xP fP k kP /=; apply: xP => y ?; apply: fP.
Qed.
Lemma qf_cps_if T D (c : fF) (t : T) (e : T) : qf c -> D t -> D e ->
qf_cps D ('if c then t else e).
Proof.
(* Goal: forall (_ : is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) c) (@GRing.rformula (GRing.Field.unitRingType F) c))) (_ : D t) (_ : D e), @qf_cps T D (@cpsif T c t e) *)
move=> qfc Dt De k kP /=; have [qft qfe] := (kP _ Dt, kP _ De).
(* Goal: is_true (andb (andb (andb (@GRing.qf_form (GRing.Field.unitRingType F) c) (@GRing.qf_form (GRing.Field.unitRingType F) (k t))) (andb (@GRing.qf_form (GRing.Field.unitRingType F) c) (@GRing.qf_form (GRing.Field.unitRingType F) (k e)))) (andb (andb (@GRing.rformula (GRing.Field.unitRingType F) c) (@GRing.rformula (GRing.Field.unitRingType F) (k t))) (andb (@GRing.rformula (GRing.Field.unitRingType F) c) (@GRing.rformula (GRing.Field.unitRingType F) (k e))))) *)
by do !rewrite qf_simpl //.
Qed.
Lemma sizeTP (pf : polyF) : sizeT pf ->_e size (eval_poly e pf).
Proof.
(* Goal: @qf_red_cps nat (sizeT pf) (fun e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F)) => @size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e pf))) *)
elim: pf=> [|c qf qfP /=]; first by rewrite /= size_poly0.
(* Goal: @qf_red_cps nat (@bind nat nat (sizeT qf) (fun n : nat => match n with | O => @cpsif nat (@GRing.Equal (GRing.Field.sort F) c (GRing.NatConst (GRing.Field.sort F) O)) O (S O) | S m => @ret nat (S (S m)) end)) (fun e : list (GRing.Field.sort F) => @size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e qf) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e c))))) *)
move=> e k; rewrite size_MXaddC qfP -(size_poly_eq0 (eval_poly _ _)).
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (match @size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e qf)) with | O => @cpsif nat (@GRing.Equal (GRing.Field.sort F) c (GRing.NatConst (GRing.Field.sort F) O)) O (S O) | S m => @ret nat (S (S m)) end k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (if andb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e qf))) O) (@eq_op (GRing.Ring.eqType (GRing.Field.ringType F)) (@GRing.eval (GRing.Field.unitRingType F) e c) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType F)))) then O else S (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) (eval_poly e qf)))))) *)
by case: (size (eval_poly e qf))=> //=; case: eqP; rewrite // orbF.
Qed.
Lemma sizeT_qf (p : polyF) : rpoly p -> qf_cps xpredT (sizeT p).
Definition isnull (p : polyF) : cps bool :=
'let n <- sizeT p; ret (n == 0%N).
Lemma isnullP (p : polyF) : isnull p ->_e (eval_poly e p == 0).
Proof.
(* Goal: @qf_red_cps bool (isnull p) (fun e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F)) => @eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e p) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))))) *)
by move=> e k; rewrite sizeTP size_poly_eq0.
Qed.
Lemma isnull_qf (p : polyF) : rpoly p -> qf_cps xpredT (isnull p).
Definition lt_sizeT (p q : polyF) : cps bool :=
'let n <- sizeT p; 'let m <- sizeT q; ret (n < m).
Definition lift (p : {poly F}) := map GRing.Const p.
Lemma eval_lift (e : seq F) (p : {poly F}) : eval_poly e (lift p) = p.
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (lift p)) p *)
elim/poly_ind: p => [|p c]; first by rewrite /lift polyseq0.
(* Goal: forall _ : @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (lift p)) p, @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (lift (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) p (polyX (GRing.Field.ringType F))) (@polyC (GRing.Field.ringType F) c)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) p (polyX (GRing.Field.ringType F))) (@polyC (GRing.Field.ringType F) c)) *)
rewrite -cons_poly_def /lift polyseq_cons /nilp.
(* Goal: forall _ : @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (@map (GRing.Ring.sort (GRing.Field.ringType F)) (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))) (@GRing.Const (GRing.Ring.sort (GRing.Field.ringType F))) (@polyseq (GRing.Field.ringType F) p))) p, @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (@map (GRing.Ring.sort (GRing.Field.ringType F)) (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))) (@GRing.Const (GRing.Ring.sort (GRing.Field.ringType F))) (if negb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) p)) O) then @cons (GRing.Ring.sort (GRing.Field.ringType F)) c (@polyseq (GRing.Field.ringType F) p) else @polyseq (GRing.Field.ringType F) (@polyC (GRing.Field.ringType F) c)))) (@cons_poly (GRing.Field.ringType F) c p) *)
case pn0: (_ == _) => /=; last by move->; rewrite -cons_poly_def.
(* Goal: forall _ : @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (eval_poly e (@map (GRing.Field.sort F) (GRing.term (GRing.Field.sort F)) (@GRing.Const (GRing.Field.sort F)) (@polyseq (GRing.Field.ringType F) p))) p, @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (eval_poly e (@map (GRing.Field.sort F) (GRing.term (GRing.Field.sort F)) (@GRing.Const (GRing.Field.sort F)) (@polyseq (GRing.Field.ringType F) (@polyC (GRing.Field.ringType F) c)))) (@cons_poly (GRing.Field.ringType F) c p) *)
move=> _; rewrite polyseqC.
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (eval_poly e (@map (GRing.Field.sort F) (GRing.term (GRing.Field.sort F)) (@GRing.Const (GRing.Field.sort F)) (@nseq (GRing.Ring.sort (GRing.Field.ringType F)) (nat_of_bool (negb (@eq_op (GRing.Ring.eqType (GRing.Field.ringType F)) c (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType F)))))) c))) (@cons_poly (GRing.Field.ringType F) c p) *)
case c0: (_==_)=> /=.
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) c)) (@cons_poly (GRing.Field.ringType F) c p) *)
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@cons_poly (GRing.Field.ringType F) c p) *)
move: pn0; rewrite (eqP c0) size_poly_eq0; move/eqP->.
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) c)) (@cons_poly (GRing.Field.ringType F) c p) *)
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@cons_poly (GRing.Field.ringType F) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType F))) (GRing.zero (poly_zmodType (GRing.Field.ringType F)))) *)
by apply: val_inj=> /=; rewrite polyseq_cons // polyseq0.
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) c)) (@cons_poly (GRing.Field.ringType F) c p) *)
by rewrite mul0r add0r; apply: val_inj=> /=; rewrite polyseq_cons // /nilp pn0.
Qed.
Fixpoint lead_coefT p : cps tF :=
if p is c :: q then
'let l <- lead_coefT q; 'if (l == 0) then c else l
else ret 0%T.
Lemma lead_coefTP (k : tF -> fF) :
(forall x e, qf_eval e (k x) = qf_eval e (k (eval e x)%:T%T)) ->
forall (p : polyF) (e : seq F),
qf_eval e (lead_coefT p k) = qf_eval e (k (lead_coef (eval_poly e p))%:T%T).
Proof.
(* Goal: forall (_ : forall (x : GRing.term (GRing.Field.sort F)) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k x)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e x))))) (p : polyF) (e : list (GRing.Field.sort F)), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (lead_coefT p k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@GRing.Const (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p))))) *)
move=> kP p e; elim: p => [|a p IHp]/= in k kP e *.
by rewrite lead_coef0 kP.
rewrite IHp; last by move=> *; rewrite //= -kP.
rewrite GRing.eval_If /= lead_coef_eq0.
case p'0: (_ == _); first by rewrite (eqP p'0) mul0r add0r lead_coefC -kP.
rewrite lead_coefDl ?lead_coefMX // polyseqC size_mul ?p'0 //; last first.
by rewrite -size_poly_eq0 size_polyX.
rewrite size_polyX addnC /=; case: (_ == _)=> //=.
by rewrite ltnS lt0n size_poly_eq0 p'0.
Qed.
Qed.
Lemma lead_coefT_qf (p : polyF) : rpoly p -> qf_cps (@rterm _) (lead_coefT p).
Proof.
(* Goal: forall _ : is_true (rpoly p), @qf_cps (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (fun t : GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)) => is_true (@GRing.rterm (GRing.Field.unitRingType F) t)) (lead_coefT p) *)
elim: p => [_|c q ihp //= /andP[rc rq]]; first by apply: qf_cps_ret.
(* Goal: @qf_cps (GRing.term (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => is_true (@GRing.rterm (GRing.Field.unitRingType F) t)) (@bind (GRing.term (GRing.Field.sort F)) (GRing.term (GRing.Field.sort F)) (lead_coefT q) (fun l : GRing.term (GRing.Field.sort F) => @cpsif (GRing.term (GRing.Field.sort F)) (@GRing.Equal (GRing.Field.sort F) l (GRing.NatConst (GRing.Field.sort F) O)) c l)) *)
apply: qf_cps_bind => [|y ty]; first exact: ihp.
(* Goal: @qf_cps (GRing.term (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => is_true (@GRing.rterm (GRing.Field.unitRingType F) t)) (@cpsif (GRing.term (GRing.Field.sort F)) (@GRing.Equal (GRing.Field.sort F) y (GRing.NatConst (GRing.Field.sort F) O)) c y) *)
by apply: qf_cps_if; rewrite //= ty.
Qed.
Fixpoint amulXnT (a : tF) (n : nat) : polyF :=
if n is n'.+1 then 0%T :: (amulXnT a n') else [:: a].
Lemma eval_amulXnT (a : tF) (n : nat) (e : seq F) :
eval_poly e (amulXnT a n) = (eval e a)%:P * 'X^n.
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (amulXnT a n)) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) n)) *)
elim: n=> [|n] /=; first by rewrite expr0 mulr1 mul0r add0r.
(* Goal: forall _ : @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (eval_poly e (amulXnT a n)) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) n)), @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e (amulXnT a n)) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (S n))) *)
by move->; rewrite addr0 -mulrA -exprSr.
Qed.
Lemma ramulXnT: forall a n, rterm a -> rpoly (amulXnT a n).
Proof.
(* Goal: forall (a : GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) a)), is_true (rpoly (amulXnT a n)) *)
by move=> a n; elim: n a=> [a /= -> //|n ihn a ra]; apply: ihn.
Qed.
Fixpoint sumpT (p q : polyF) :=
match p, q with a :: p, b :: q => (a + b)%T :: sumpT p q
| [::], q => q | p, [::] => p end.
Lemma eval_sumpT (p q : polyF) (e : seq F) :
eval_poly e (sumpT p q) = (eval_poly e p) + (eval_poly e q).
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (sumpT p q)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (eval_poly e q)) *)
elim: p q => [|a p Hp] q /=; first by rewrite add0r.
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (eval_poly e match q with | nil => @cons (GRing.term (GRing.Field.sort F)) a p | cons b q => @cons (GRing.term (GRing.Field.sort F)) (@GRing.Add (GRing.Field.sort F) a b) (sumpT p q) end) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e p) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a))) (eval_poly e q)) *)
case: q => [|b q] /=; first by rewrite addr0.
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e (sumpT p q)) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.add (GRing.UnitRing.zmodType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a) (@GRing.eval (GRing.Field.unitRingType F) e b)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e p) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e q) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e b)))) *)
rewrite Hp mulrDl -!addrA; congr (_ + _); rewrite polyC_add addrC -addrA.
(* Goal: @eq (GRing.Zmodule.sort (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e b)) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e q) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e a)) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e q) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e b)))) *)
by congr (_ + _); rewrite addrC.
Qed.
Lemma rsumpT (p q : polyF) : rpoly p -> rpoly q -> rpoly (sumpT p q).
Proof.
(* Goal: forall (_ : is_true (rpoly p)) (_ : is_true (rpoly q)), is_true (rpoly (sumpT p q)) *)
elim: p q=> [|a p ihp] q rp rq //; move: rp; case/andP=> ra rp.
(* Goal: is_true (rpoly (sumpT (@cons (GRing.term (GRing.Field.sort F)) a p) q)) *)
case: q rq => [|b q]; rewrite /= ?ra ?rp //=.
(* Goal: forall _ : is_true (andb (@GRing.rterm (GRing.Field.unitRingType F) b) (rpoly q)), is_true (andb (@GRing.rterm (GRing.Field.unitRingType F) b) (rpoly (sumpT p q))) *)
by case/andP=> -> rq //=; apply: ihp.
Qed.
Fixpoint mulpT (p q : polyF) :=
if p isn't a :: p then [::]
else sumpT [seq (a * x)%T | x <- q] (0%T :: mulpT p q).
Lemma eval_mulpT (p q : polyF) (e : seq F) :
eval_poly e (mulpT p q) = (eval_poly e p) * (eval_poly e q).
Lemma rpoly_map_mul (t : tF) (p : polyF) (rt : rterm t) :
rpoly [seq (t * x)%T | x <- p] = rpoly p.
Proof.
(* Goal: @eq bool (rpoly (@map (GRing.term (GRing.Field.sort F)) (GRing.term (GRing.Field.sort F)) (fun x : GRing.term (GRing.Field.sort F) => @GRing.Mul (GRing.Field.sort F) t x) p)) (rpoly p) *)
by rewrite /rpoly all_map /= (@eq_all _ _ (@rterm _)) // => x; rewrite /= rt.
Qed.
Lemma rmulpT (p q : polyF) : rpoly p -> rpoly q -> rpoly (mulpT p q).
Definition opppT : polyF -> polyF := map (GRing.Mul (- 1%T)%T).
Lemma eval_opppT (p : polyF) (e : seq F) :
eval_poly e (opppT p) = - eval_poly e p.
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (opppT p)) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p)) *)
by elim: p; rewrite /= ?oppr0 // => ? ? ->; rewrite !mulNr opprD polyC_opp mul1r.
Qed.
Definition natmulpT n : polyF -> polyF := map (GRing.Mul n%:R%T).
Lemma eval_natmulpT (p : polyF) (n : nat) (e : seq F) :
eval_poly e (natmulpT n p) = (eval_poly e p) *+ n.
Fixpoint redivp_rec_loopT (q : polyF) sq cq (c : nat) (qq r : polyF)
(n : nat) {struct n} : cps (nat * polyF * polyF) :=
'let sr <- sizeT r;
if sr < sq then ret (c, qq, r) else
'let lr <- lead_coefT r;
let m := amulXnT lr (sr - sq) in
let qq1 := sumpT (mulpT qq [::cq]) m in
let r1 := sumpT (mulpT r ([::cq])) (opppT (mulpT m q)) in
if n is n1.+1 then redivp_rec_loopT q sq cq c.+1 qq1 r1 n1
else ret (c.+1, qq1, r1).
Fixpoint redivp_rec_loop (q : {poly F}) sq cq
(k : nat) (qq r : {poly F}) (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 redivp_rec_loop q sq cq k.+1 qq1 r1 n1 else
(k.+1, qq1, r1).
Lemma redivp_rec_loopTP (k : nat * polyF * polyF -> fF) :
(forall c qq r e, qf_eval e (k (c,qq,r))
= qf_eval e (k (c, lift (eval_poly e qq), lift (eval_poly e r))))
-> forall q sq cq c qq r n e
(d := redivp_rec_loop (eval_poly e q) sq (eval e cq)
c (eval_poly e qq) (eval_poly e r) n),
qf_eval e (redivp_rec_loopT q sq cq c qq r n k)
= qf_eval e (k (d.1.1, lift d.1.2, lift d.2)).
Proof.
(* Goal: forall (_ : forall (c : nat) (qq r : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) c (lift (eval_poly e qq))) (lift (eval_poly e r)))))) (q : list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))) (sq : nat) (cq : GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (c : nat) (qq r : list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))) (n : nat) (e : list (GRing.Field.sort F)), let d := redivp_rec_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) n in @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (redivp_rec_loopT q sq cq c qq r n k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@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))) d)) (lift (@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))) d)))) (lift (@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))) d))))) *)
move=> Pk q sq cq c qq r n e /=.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (redivp_rec_loopT q sq cq c qq r n k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) n))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) n))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) n)))))) *)
elim: n c qq r k Pk e => [|n Pn] c qq r k Pk e; rewrite sizeTP.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r)))) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr0 : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr0 (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n)) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r)))) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq1) r1))) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O)))))) *)
case ltrq : (_ < _); first by rewrite /= ltrq /= -Pk.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r)))) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr0 : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr0 (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n)) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (@bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq1) r1)) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O)))))) *)
rewrite lead_coefTP => [|a p]; rewrite Pk.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r)))) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr0 : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr0 (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n)) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) p (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (S c) (lift (eval_poly p (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT a (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))))) (lift (eval_poly p (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT a (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))))))) (@GRing.qf_eval (GRing.Field.unitRingType F) p ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) p a)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq1) r1)) k)) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (S c) (lift (eval_poly e (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT (@GRing.Const (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))))) (lift (eval_poly e (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT (@GRing.Const (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) O)))))) *)
rewrite ?(eval_mulpT,eval_amulXnT,eval_sumpT,eval_opppT) //=.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r)))) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr0 : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr0 (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n)) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) p (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (S c) (lift (eval_poly p (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT a (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))))) (lift (eval_poly p (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT a (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))))))) (@GRing.qf_eval (GRing.Field.unitRingType F) p ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) p a)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq1) r1)) k)) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (S c) (lift (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))))) (lift (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e r) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e q)))))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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) (eval_poly e r)))) sq 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))) c (eval_poly e qq)) (eval_poly e r) 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 c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e qq) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e r) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))) (eval_poly e q))))))) (lift (@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) (eval_poly e r)))) sq 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))) c (eval_poly e qq)) (eval_poly e r) 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 c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e qq) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e r) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))) (eval_poly e q))))))))) (lift (@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) (eval_poly e r)))) sq 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))) c (eval_poly e qq)) (eval_poly e r) 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 c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e qq) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e r) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))) (eval_poly e q)))))))))) *)
by rewrite ltrq //= mul_polyC ?(mul0r,add0r).
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r)))) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr0 : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr0 (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n)) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) p (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (S c) (lift (eval_poly p (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT a (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))))) (lift (eval_poly p (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT a (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))))))) (@GRing.qf_eval (GRing.Field.unitRingType F) p ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) p a)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq1) r1)) k)) *)
by symmetry; rewrite Pk ?(eval_mulpT,eval_amulXnT,eval_sumpT, eval_opppT).
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r)))) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr0 : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr0 (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n)) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
case ltrq : (_<_); first by rewrite /= ltrq Pk.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (@bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m := amulXnT lr (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr0 : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr0 (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
rewrite lead_coefTP.
(* Goal: forall (x : GRing.term (GRing.Field.sort F)) (e0 : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e0 ((let m := amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e0 ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e0 x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((let m := amulXnT (@GRing.Const (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n)))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) c (eval_poly e qq) (eval_poly e r) (S n))))))) *)
rewrite Pn ?(eval_mulpT,eval_amulXnT,eval_sumpT,eval_opppT) //=.
(* Goal: forall (x : GRing.term (GRing.Field.sort F)) (e0 : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e0 ((let m := amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e0 ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e0 x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e r) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e q)))) n))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e r) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e q)))) n))))) (lift (@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_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e qq) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e r) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e cq)))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e q)))) n)))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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) (eval_poly e r)))) sq 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))) c (eval_poly e qq)) (eval_poly e r) else redivp_rec_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e qq) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e r) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))) (eval_poly e q)))) n))) (lift (@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) (eval_poly e r)))) sq 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))) c (eval_poly e qq)) (eval_poly e r) else redivp_rec_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e qq) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e r) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))) (eval_poly e q)))) n))))) (lift (@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) (eval_poly e r)))) sq 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))) c (eval_poly e qq)) (eval_poly e r) else redivp_rec_loop (eval_poly e q) sq (@GRing.eval (GRing.Field.unitRingType F) e cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e qq) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.Field.ringType F))) (@GRing.mul (poly_ringType (GRing.Field.ringType F)) (eval_poly e r) (@polyC (GRing.Field.ringType F) (@GRing.eval (GRing.Field.unitRingType F) e cq))) (@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) (eval_poly e r)) (@GRing.exp (poly_ringType (GRing.Field.ringType F)) (polyX (GRing.Field.ringType F)) (subn (@size (GRing.Field.sort F) (@polyseq (GRing.Field.ringType F) (eval_poly e r))) sq))) (eval_poly e q)))) n)))))) *)
by rewrite ltrq //= mul_polyC ?(mul0r,add0r).
(* Goal: forall (x : GRing.term (GRing.Field.sort F)) (e0 : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e0 ((let m := amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e0 ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e0 x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in (fix redivp_rec_loopT (q : polyF) (sq : nat) (cq : GRing.term (GRing.Field.sort F)) (c : nat) (qq r : polyF) (n : nat) {struct n} : forall _ : forall _ : prod (prod nat polyF) polyF, GRing.formula (GRing.Field.sort F), GRing.formula (GRing.Field.sort F) := @bind nat (prod (prod nat polyF) polyF) (sizeT r) (fun sr : nat => if leq (S sr) sq then @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r) else @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT r) (fun lr : GRing.term (GRing.Field.sort F) => let m0 := amulXnT lr (subn sr sq) in let qq2 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m0 in let r2 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m0 q)) in match n with | O => @ret (prod (prod nat polyF) polyF) (@pair (prod nat polyF) polyF (@pair nat polyF (S c) qq2) r2) | S n1 => redivp_rec_loopT q sq cq (S c) qq2 r2 n1 end))) q sq cq (S c) qq1 r1 n) k)) *)
rewrite -/redivp_rec_loopT => x e'.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e' ((let m := amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in redivp_rec_loopT q sq cq (S c) qq1 r1 n) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e' ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in redivp_rec_loopT q sq cq (S c) qq1 r1 n) k)) *)
rewrite Pn; last by move=> *; rewrite Pk.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e' (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n))))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n)))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e' ((let m := amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq) in let qq1 := sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) m in let r1 := sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT m q)) in redivp_rec_loopT q sq cq (S c) qq1 r1 n) k)) *)
symmetry; rewrite Pn; last by move=> *; rewrite Pk.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e' (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n))))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n)))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e' (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n))))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (eval_poly e' (sumpT (mulpT qq (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (eval_poly e' (sumpT (mulpT r (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F))))) (opppT (mulpT (amulXnT x (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)) q)))) n)))))) *)
rewrite Pk ?(eval_lift,eval_mulpT,eval_amulXnT,eval_sumpT,eval_opppT).
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e' (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' qq) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' r) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e' q)))) n))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' qq) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' r) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e' q)))) n))))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' qq) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' r) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' (@GRing.Const (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)))) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e' q)))) n)))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e' (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' qq) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' r) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e' q)))) n))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' qq) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' r) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e' q)))) n))))) (lift (@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_loop (eval_poly e' q) sq (@GRing.eval (GRing.Field.unitRingType F) e' cq) (S c) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' qq) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq)))) (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e' r) (eval_poly e' (@cons (GRing.term (GRing.Field.sort F)) cq (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.opp (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.eval (GRing.Field.unitRingType F) e' x)) (@GRing.exp (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (subn (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e r))) sq))) (eval_poly e' q)))) n)))))) *)
by rewrite mul_polyC ?(mul0r,add0r).
Qed.
Lemma redivp_rec_loopT_qf (q : polyF) (sq : nat) (cq : tF)
(c : nat) (qq r : polyF) (n : nat) :
rpoly q -> rterm cq -> rpoly qq -> rpoly r ->
qf_cps (fun x => [&& rpoly x.1.2 & rpoly x.2])
Proof.
(* Goal: forall (_ : is_true (rpoly q)) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) cq)) (_ : is_true (rpoly qq)) (_ : is_true (rpoly r)), @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (redivp_rec_loopT q sq cq c qq r n) *)
do ![move=>x/(pair x){x}] => rw; elim: n => [|n IHn]//= in q sq cq c qq r rw *; apply: qf_cps_bind; do ?[by apply: sizeT_qf; rewrite !rw] => sr _; case: ifPn => // _; do ?[by apply: qf_cps_ret; rewrite //= ?rw]; apply: qf_cps_bind; do ?[by apply: lead_coefT_qf; rewrite !rw] => lr /= rlr; [apply: qf_cps_ret|apply: IHn]; by do !rewrite ?(rsumpT,rmulpT,ramulXnT,rpoly_map_mul,rlr,rw) //=.
Qed.
Definition redivpT (p : polyF) (q : polyF) : cps (nat * polyF * polyF) :=
'let b <- isnull q;
if b then ret (0%N, [::0%T], p) else
'let sq <- sizeT q; 'let sp <- sizeT p;
'let lq <- lead_coefT q;
redivp_rec_loopT q sq lq 0 [::0%T] p sp.
Lemma redivp_rec_loopP (q : {poly F}) (c : nat) (qq r : {poly F}) (n : nat) :
redivp_rec q c qq r n = redivp_rec_loop q (size q) (lead_coef q) c qq r n.
Proof.
(* Goal: @eq (prod (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))))) (redivp_rec (GRing.Field.ringType F) q c qq r n) (redivp_rec_loop q (@size (GRing.Ring.sort (GRing.Field.ringType F)) (@polyseq (GRing.Field.ringType F) q)) (@lead_coef (GRing.Field.ringType F) q) c qq r n) *)
by elim: n c qq r => [| n Pn] c qq r //=; rewrite Pn.
Qed.
Lemma redivpTP (k : nat * polyF * polyF -> fF) :
(forall c qq r e,
qf_eval e (k (c,qq,r)) =
qf_eval e (k (c, lift (eval_poly e qq), lift (eval_poly e r)))) ->
forall p q e (d := redivp (eval_poly e p) (eval_poly e q)),
qf_eval e (redivpT p q k) = qf_eval e (k (d.1.1, lift d.1.2, lift d.2)).
Proof.
(* Goal: forall (_ : forall (c : nat) (qq r : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat polyF) polyF (@pair nat polyF c qq) r))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) c (lift (eval_poly e qq))) (lift (eval_poly e r)))))) (p q : list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))) (e : list (GRing.Field.sort F)), let d := redivp (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p) (eval_poly e q) in @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (redivpT p q k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F))))) (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@pair nat (list (GRing.term (GRing.Ring.sort (GRing.Field.ringType F)))) (@fst nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) d)) (lift (@snd nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) d)))) (lift (@snd (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) d))))) *)
move=> Pk p q e /=; rewrite isnullP unlock /=.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if @eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e q) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) then @ret (prod (prod nat (list (GRing.term (GRing.Field.sort F)))) polyF) (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) polyF (@pair nat (list (GRing.term (GRing.Field.sort F))) O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F))))) p) else @bind nat (prod (prod nat polyF) polyF) (sizeT q) (fun sq : nat => @bind nat (prod (prod nat polyF) polyF) (sizeT p) (fun sp : nat => @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT q) (fun lq : GRing.term (GRing.Field.sort F) => redivp_rec_loopT q sq lq O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p sp)))) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@fst nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (if @eq_op (poly_eqType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e q) (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) then @pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e p) else redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))) (lift (@snd nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (if @eq_op (poly_eqType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e q) (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) then @pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e p) else redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))))) (lift (@snd (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (if @eq_op (poly_eqType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (eval_poly e q) (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) then @pair (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@pair nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e p) else redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p))))))))) *)
case q0 : (eval_poly e q == 0) => /=; first by rewrite Pk /= mul0r add0r polyC0.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (sizeT q (fun x : nat => sizeT p (fun x0 : nat => lead_coefT q (fun x1 : GRing.term (GRing.Field.sort F) => redivp_rec_loopT q x x1 O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p x0 k))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@fst nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))) (lift (@snd nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))))) (lift (@snd (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p))))))))) *)
rewrite !sizeTP lead_coefTP /=; last by move=> *; rewrite !redivp_rec_loopTP.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (redivp_rec_loopT q (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q))) (@GRing.Const (GRing.Field.sort F) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q))) O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p))) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@fst nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))) (lift (@snd nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))))) (lift (@snd (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p))))))))) *)
rewrite redivp_rec_loopTP /=; last by move=> *; rewrite Pk.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@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_loop (eval_poly e q) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q))) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q)) O (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))) (lift (@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_loop (eval_poly e q) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q))) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q)) O (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))))) (lift (@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_loop (eval_poly e q) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q))) (@lead_coef (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q)) O (@GRing.add (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.zero (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (polyX (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p))))))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) (list (GRing.term (GRing.Field.sort F))) (@pair nat (list (GRing.term (GRing.Field.sort F))) (@fst nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))) (lift (@snd nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@fst (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))))))) (lift (@snd (prod nat (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (redivp_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) O (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (eval_poly e p) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p))))))))) *)
by rewrite mul0r add0r polyC0 redivp_rec_loopP.
Qed.
Lemma redivpT_qf (p : polyF) (q : polyF) : rpoly p -> rpoly q ->
qf_cps (fun x => [&& rpoly x.1.2 & rpoly x.2]) (redivpT p q).
Proof.
(* Goal: forall (_ : is_true (rpoly p)) (_ : is_true (rpoly q)), @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (redivpT p q) *)
move=> rp rq; apply: qf_cps_bind => [|[] _]; first exact: isnull_qf.
(* Goal: @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (@bind nat (prod (prod nat polyF) polyF) (sizeT q) (fun sq : nat => @bind nat (prod (prod nat polyF) polyF) (sizeT p) (fun sp : nat => @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT q) (fun lq : GRing.term (GRing.Field.sort F) => redivp_rec_loopT q sq lq O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p sp)))) *)
(* Goal: @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (@ret (prod (prod nat (list (GRing.term (GRing.Field.sort F)))) polyF) (@pair (prod nat (list (GRing.term (GRing.Field.sort F)))) polyF (@pair nat (list (GRing.term (GRing.Field.sort F))) O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F))))) p)) *)
by apply: qf_cps_ret.
(* Goal: @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (@bind nat (prod (prod nat polyF) polyF) (sizeT q) (fun sq : nat => @bind nat (prod (prod nat polyF) polyF) (sizeT p) (fun sp : nat => @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT q) (fun lq : GRing.term (GRing.Field.sort F) => redivp_rec_loopT q sq lq O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p sp)))) *)
apply: qf_cps_bind => [|sp _]; first exact: sizeT_qf.
(* Goal: @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (@bind nat (prod (prod nat polyF) polyF) (sizeT p) (fun sp0 : nat => @bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT q) (fun lq : GRing.term (GRing.Field.sort F) => redivp_rec_loopT q sp lq O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p sp0))) *)
apply: qf_cps_bind => [|sq _]; first exact: sizeT_qf.
(* Goal: @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (@bind (GRing.term (GRing.Field.sort F)) (prod (prod nat polyF) polyF) (lead_coefT q) (fun lq : GRing.term (GRing.Field.sort F) => redivp_rec_loopT q sp lq O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p sq)) *)
apply: qf_cps_bind => [|lq rlq]; first exact: lead_coefT_qf.
(* Goal: @qf_cps (prod (prod nat polyF) polyF) (fun x : prod (prod nat polyF) polyF => is_true (andb (rpoly (@snd nat polyF (@fst (prod nat polyF) polyF x))) (rpoly (@snd (prod nat polyF) polyF x)))) (redivp_rec_loopT q sp lq O (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))) p sq) *)
by apply: redivp_rec_loopT_qf => //=.
Qed.
Definition rmodpT (p : polyF) (q : polyF) : cps polyF :=
'let d <- redivpT p q; ret d.2.
Definition rdivpT (p : polyF) (q : polyF) : cps polyF :=
'let d <- redivpT p q; ret d.1.2.
Definition rscalpT (p : polyF) (q : polyF) : cps nat :=
'let d <- redivpT p q; ret d.1.1.
Definition rdvdpT (p : polyF) (q : polyF) : cps bool :=
'let d <- rmodpT p q; isnull d.
Fixpoint rgcdp_loop n (pp qq : {poly F}) {struct n} :=
let rr := rmodp pp qq in if rr == 0 then qq
else if n is n1.+1 then rgcdp_loop n1 qq rr else rr.
Fixpoint rgcdp_loopT n (pp : polyF) (qq : polyF) : cps polyF :=
'let rr <- rmodpT pp qq; 'let nrr <- isnull rr; if nrr then ret qq
else if n is n1.+1 then rgcdp_loopT n1 qq rr else ret rr.
Lemma rgcdp_loopP (k : polyF -> fF) :
(forall p e, qf_eval e (k p) = qf_eval e (k (lift (eval_poly e p)))) ->
forall n p q e,
qf_eval e (rgcdp_loopT n p q k) =
qf_eval e (k (lift (rgcdp_loop n (eval_poly e p) (eval_poly e q)))).
Proof.
(* Goal: forall (_ : forall (p : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k p)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (eval_poly e p))))) (n : nat) (p q : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (rgcdp_loopT n p q k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (rgcdp_loop n (eval_poly e p) (eval_poly e q))))) *)
move=> Pk n p q e; elim: n => /= [| m IHm] in p q e *; rewrite redivpTP /==> *; rewrite ?isnullP ?eval_lift -/(rmodp _ _); by case: (_ == _); do ?by rewrite -?Pk ?IHm ?eval_lift.
Qed.
Lemma rgcdp_loopT_qf (n : nat) (p : polyF) (q : polyF) :
rpoly p -> rpoly q -> qf_cps rpoly (rgcdp_loopT n p q).
Proof.
(* Goal: forall (_ : is_true (rpoly p)) (_ : is_true (rpoly q)), @qf_cps polyF (fun p : polyF => is_true (rpoly p)) (rgcdp_loopT n p q) *)
elim: n => [|n IHn] in p q * => rp rq /=; (apply: qf_cps_bind=> [|rr rrr]; [ apply: qf_cps_bind => [|[[a u] v]]; do ?exact: redivpT_qf; by move=> /andP[/= ??]; apply: (@qf_cps_ret _ rpoly)| apply: qf_cps_bind => [|[] _]; by [apply: isnull_qf|apply: qf_cps_ret|apply: IHn]]).
Qed.
Definition rgcdpT (p : polyF) (q : polyF) : cps polyF :=
let aux p1 q1 : cps polyF :=
'let b <- isnull p1; if b then ret q1
else 'let n <- sizeT p1; rgcdp_loopT n p1 q1 in
'let b <- lt_sizeT p q; if b then aux q p else aux p q.
Lemma rgcdpTP (k : polyF -> fF) :
(forall p e, qf_eval e (k p) = qf_eval e (k (lift (eval_poly e p)))) ->
forall p q e, qf_eval e (rgcdpT p q k) =
qf_eval e (k (lift (rgcdp (eval_poly e p) (eval_poly e q)))).
Proof.
(* Goal: forall (_ : forall (p : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k p)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (eval_poly e p))))) (p q : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (rgcdpT p q k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (rgcdp (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p) (eval_poly e q))))) *)
move=> Pk p q e; rewrite /rgcdpT /rgcdp !sizeTP /=.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e ((if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q))) then @bind bool polyF (isnull q) (fun b : bool => if b then @ret polyF p else @bind nat polyF (sizeT q) (fun n : nat => rgcdp_loopT n q p)) else @bind bool polyF (isnull p) (fun b : bool => if b then @ret polyF q else @bind nat polyF (sizeT p) (fun n : nat => rgcdp_loopT n p q))) k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (let 'pair p1 q1 := if leq (S (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p)))) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q))) then @pair (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (eval_poly e q) (eval_poly e p) else @pair (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (eval_poly e p) (eval_poly e q) in if @eq_op (poly_eqType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) p1 (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) then q1 else (fix loop (n : nat) (pp qq : @poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) {struct n} : @poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)) := if @eq_op (poly_eqType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (rmodp (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) pp qq) (GRing.zero (poly_zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) then qq else match n with | O => rmodp (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) pp qq | S n1 => loop n1 qq (rmodp (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) pp qq) end) (@size (GRing.Field.sort F) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) p1)) p1 q1)))) *)
case: (_ < _); rewrite !isnullP /=; case: (_ == _); rewrite -?Pk ?sizeTP; by rewrite ?rgcdp_loopP.
Qed.
Lemma rgcdpT_qf (p : polyF) (q : polyF) :
rpoly p -> rpoly q -> qf_cps rpoly (rgcdpT p q).
Proof.
(* Goal: forall (_ : is_true (rpoly p)) (_ : is_true (rpoly q)), @qf_cps polyF (fun p : polyF => is_true (rpoly p)) (rgcdpT p q) *)
move=> rp rq k kP; rewrite /rgcdpT /=; do ![rewrite sizeT_qf => // ? _].
(* Goal: is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) (@ret bool (leq (S _y_) _y1_) (fun x : bool => (if x then @bind bool polyF (isnull q) (fun b : bool => if b then @ret polyF p else @bind nat polyF (sizeT q) (fun n : nat => rgcdp_loopT n q p)) else @bind bool polyF (isnull p) (fun b : bool => if b then @ret polyF q else @bind nat polyF (sizeT p) (fun n : nat => rgcdp_loopT n p q))) k))) (@GRing.rformula (GRing.Field.unitRingType F) (@ret bool (leq (S _y_) _y1_) (fun x : bool => (if x then @bind bool polyF (isnull q) (fun b : bool => if b then @ret polyF p else @bind nat polyF (sizeT q) (fun n : nat => rgcdp_loopT n q p)) else @bind bool polyF (isnull p) (fun b : bool => if b then @ret polyF q else @bind nat polyF (sizeT p) (fun n : nat => rgcdp_loopT n p q))) k)))) *)
case: (_ < _); rewrite ?isnull_qf // => -[]; rewrite ?kP // => _; by rewrite sizeT_qf => // ? _; rewrite rgcdp_loopT_qf.
Qed.
Fixpoint rgcdpTs (ps : seq polyF) : cps polyF :=
if ps is p :: pr then 'let pr <- rgcdpTs pr; rgcdpT p pr else ret [::0%T].
Lemma rgcdpTsP (k : polyF -> fF) :
(forall p e, qf_eval e (k p) = qf_eval e (k (lift (eval_poly e p)))) ->
forall ps e,
qf_eval e (rgcdpTs ps k) =
qf_eval e (k (lift (\big[@rgcdp _/0%:P]_(i <- ps)(eval_poly e i)))).
Proof.
(* Goal: forall (_ : forall (p : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k p)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (eval_poly e p))))) (ps : list polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (rgcdpTs ps k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (@BigOp.bigop (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) polyF (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) ps (fun i : polyF => @BigBody (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) polyF i (rgcdp (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) true (eval_poly e i)))))) *)
move=> Pk ps e; elim: ps k Pk => [|p ps Pps] /= k Pk.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (rgcdpTs ps (fun x : polyF => rgcdpT p x k))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (@BigOp.bigop (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) polyF (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@cons polyF p ps) (fun i : polyF => @BigBody (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) polyF i (rgcdp (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) true (eval_poly e i)))))) *)
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) O) (@nil (GRing.term (GRing.Field.sort F)))))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (@BigOp.bigop (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) polyF (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@nil polyF) (fun i : polyF => @BigBody (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) polyF i (rgcdp (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) true (eval_poly e i)))))) *)
by rewrite /= big_nil Pk /= mul0r add0r.
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (rgcdpTs ps (fun x : polyF => rgcdpT p x k))) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (@BigOp.bigop (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) polyF (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@cons polyF p ps) (fun i : polyF => @BigBody (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) polyF i (rgcdp (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) true (eval_poly e i)))))) *)
by rewrite big_cons Pps => *; rewrite !rgcdpTP // !eval_lift -?Pk.
Qed.
Lemma rgcdpTs_qf (ps : seq polyF) :
all rpoly ps -> qf_cps rpoly (rgcdpTs ps).
Proof.
(* Goal: forall _ : is_true (@all polyF rpoly ps), @qf_cps polyF (fun p : polyF => is_true (rpoly p)) (rgcdpTs ps) *)
elim: ps => [_|c p ihp /andP[rc rp]] //=; first exact: qf_cps_ret.
(* Goal: @qf_cps polyF (fun p : polyF => is_true (rpoly p)) (@bind polyF polyF (rgcdpTs p) (fun pr : polyF => rgcdpT c pr)) *)
by apply: qf_cps_bind => [|r rr]; [apply: ihp|apply: rgcdpT_qf].
Qed.
Fixpoint rgdcop_recT n (q : polyF) (p : polyF) :=
if n is m.+1 then
'let g <- rgcdpT p q; 'let sg <- sizeT g;
if sg == 1%N then ret p
else 'let r <- rdivpT p g;
rgdcop_recT m q r
else 'let b <- isnull q; ret [::b%:R%T].
Lemma rgdcop_recTP (k : polyF -> fF) :
(forall p e, qf_eval e (k p) = qf_eval e (k (lift (eval_poly e p))))
-> forall p q n e, qf_eval e (rgdcop_recT n p q k)
= qf_eval e (k (lift (rgdcop_rec (eval_poly e p) (eval_poly e q) n))).
Proof.
(* Goal: forall (_ : forall (p : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k p)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (eval_poly e p))))) (p q : polyF) (n : nat) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (rgdcop_recT n p q k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (rgdcop_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p) (eval_poly e q) n)))) *)
move=> Pk p q n e; elim: n => [|n Pn] /= in k Pk p q e *.
rewrite isnullP /=.
by case: (_ == _); rewrite Pk /= mul0r add0r ?(polyC0, polyC1).
rewrite /rcoprimep rgcdpTP ?sizeTP ?eval_lift => * /=.
case: (_ == _); by do ?[rewrite /= ?(=^~Pk, redivpTP, rgcdpTP, sizeTP, Pn, eval_lift) //==> *].
do ?[rewrite /= ?(=^~Pk, redivpTP, rgcdpTP, sizeTP, Pn, eval_lift) //==> *].
(* Goal: @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) _e_ (rgdcop_recT _n_ _p_ _q_ k)) (@GRing.qf_eval (GRing.Field.unitRingType F) _e_ (k (lift (rgdcop_rec (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly _e_ _p_) (eval_poly _e_ _q_) _n_)))) *)
case: (_ == _); by do ?[rewrite /= ?(=^~Pk, redivpTP, rgcdpTP, sizeTP, Pn, eval_lift) //==> *].
Qed.
Qed.
Lemma rgdcop_recT_qf (n : nat) (p : polyF) (q : polyF) :
rpoly p -> rpoly q -> qf_cps rpoly (rgdcop_recT n p q).
Proof.
(* Goal: forall (_ : is_true (rpoly p)) (_ : is_true (rpoly q)), @qf_cps polyF (fun p : polyF => is_true (rpoly p)) (rgdcop_recT n p q) *)
elim: n => [|n ihn] in p q * => k kP rp rq /=.
(* Goal: is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) (rgcdpT q p (fun x : polyF => sizeT x (fun x0 : nat => (if @eq_op nat_eqType x0 (S O) then @ret polyF q else @bind polyF (list (GRing.term (GRing.Field.sort F))) (rdivpT q x) (fun r : polyF => rgdcop_recT n p r)) rp)))) (@GRing.rformula (GRing.Field.unitRingType F) (rgcdpT q p (fun x : polyF => sizeT x (fun x0 : nat => (if @eq_op nat_eqType x0 (S O) then @ret polyF q else @bind polyF (list (GRing.term (GRing.Field.sort F))) (rdivpT q x) (fun r : polyF => rgdcop_recT n p r)) rp))))) *)
(* Goal: is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) (isnull p (fun x : bool => rp (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) (nat_of_bool x)) (@nil (GRing.term (GRing.Field.sort F))))))) (@GRing.rformula (GRing.Field.unitRingType F) (isnull p (fun x : bool => rp (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) (nat_of_bool x)) (@nil (GRing.term (GRing.Field.sort F)))))))) *)
by rewrite isnull_qf => //*; rewrite rq.
(* Goal: is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) (rgcdpT q p (fun x : polyF => sizeT x (fun x0 : nat => (if @eq_op nat_eqType x0 (S O) then @ret polyF q else @bind polyF (list (GRing.term (GRing.Field.sort F))) (rdivpT q x) (fun r : polyF => rgdcop_recT n p r)) rp)))) (@GRing.rformula (GRing.Field.unitRingType F) (rgcdpT q p (fun x : polyF => sizeT x (fun x0 : nat => (if @eq_op nat_eqType x0 (S O) then @ret polyF q else @bind polyF (list (GRing.term (GRing.Field.sort F))) (rdivpT q x) (fun r : polyF => rgdcop_recT n p r)) rp))))) *)
rewrite rgcdpT_qf=> //*; rewrite sizeT_qf=> //*.
case: (_ == _); rewrite ?kP ?rq //= redivpT_qf=> //= ? /andP[??].
by rewrite ihn.
Qed.
Qed.
Definition rgdcopT q p := 'let sp <- sizeT p; rgdcop_recT sp q p.
Lemma rgdcopTP (k : polyF -> fF) :
(forall p e, qf_eval e (k p) = qf_eval e (k (lift (eval_poly e p)))) ->
forall p q e, qf_eval e (rgdcopT p q k) =
qf_eval e (k (lift (rgdcop (eval_poly e p) (eval_poly e q)))).
Proof.
(* Goal: forall (_ : forall (p : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (k p)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (eval_poly e p))))) (p q : polyF) (e : list (GRing.UnitRing.sort (GRing.Field.unitRingType F))), @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (rgdcopT p q k)) (@GRing.qf_eval (GRing.Field.unitRingType F) e (k (lift (rgdcop (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e p) (eval_poly e q))))) *)
by move=> *; rewrite sizeTP rgdcop_recTP 1?Pk.
Qed.
Lemma rgdcopT_qf (p : polyF) (q : polyF) :
rpoly p -> rpoly q -> qf_cps rpoly (rgdcopT p q).
Proof.
(* Goal: forall (_ : is_true (rpoly p)) (_ : is_true (rpoly q)), @qf_cps polyF (fun p : polyF => is_true (rpoly p)) (rgdcopT p q) *)
by move=> rp rq k kP; rewrite sizeT_qf => //*; rewrite rgdcop_recT_qf.
Qed.
Definition ex_elim_seq (ps : seq polyF) (q : polyF) : fF :=
('let g <- rgcdpTs ps; 'let d <- rgdcopT q g;
'let n <- sizeT d; ret (n != 1%N)) GRing.Bool.
Lemma ex_elim_seqP (ps : seq polyF) (q : polyF) (e : seq F) :
let gp := (\big[@rgcdp _/0%:P]_(p <- ps)(eval_poly e p)) in
qf_eval e (ex_elim_seq ps q) = (size (rgdcop (eval_poly e q) gp) != 1%N).
Proof.
(* Goal: let gp := @BigOp.bigop (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) polyF (@polyC (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) ps (fun p : polyF => @BigBody (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) polyF p (rgcdp (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) true (eval_poly e p)) in @eq bool (@GRing.qf_eval (GRing.Field.unitRingType F) e (ex_elim_seq ps q)) (negb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (@polyseq (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (rgdcop (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e q) gp))) (S O))) *)
by do ![rewrite (rgcdpTsP,rgdcopTP,sizeTP,eval_lift) //= | move=> * //=].
Qed.
Lemma ex_elim_seq_qf (ps : seq polyF) (q : polyF) :
all rpoly ps -> rpoly q -> qf (ex_elim_seq ps q).
Proof.
(* Goal: forall (_ : is_true (@all polyF rpoly ps)) (_ : is_true (rpoly q)), is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) (ex_elim_seq ps q)) (@GRing.rformula (GRing.Field.unitRingType F) (ex_elim_seq ps q))) *)
move=> rps rq; apply: rgcdpTs_qf=> // g rg; apply: rgdcopT_qf=> // d rd.
(* Goal: is_true (andb (@GRing.qf_form (GRing.Field.unitRingType F) (@bind nat bool (sizeT d) (fun n : nat => @ret bool (negb (@eq_op nat_eqType n (S O)))) (@GRing.Bool (GRing.Field.sort F)))) (@GRing.rformula (GRing.Field.unitRingType F) (@bind nat bool (sizeT d) (fun n : nat => @ret bool (negb (@eq_op nat_eqType n (S O)))) (@GRing.Bool (GRing.Field.sort F))))) *)
exact : sizeT_qf.
Qed.
Fixpoint abstrX (i : nat) (t : tF) :=
match t with
| 'X_n => if n == i then [::0; 1] else [::t]
| - x => opppT (abstrX i x)
| x + y => sumpT (abstrX i x) (abstrX i y)
| x * y => mulpT (abstrX i x) (abstrX i y)
| x *+ n => natmulpT n (abstrX i x)
| x ^+ n => let ax := (abstrX i x) in iter n (mulpT ax) [::1]
| _ => [::t]
end%T.
Lemma abstrXP (i : nat) (t : tF) (e : seq F) (x : F) :
rterm t -> (eval_poly e (abstrX i t)).[x] = eval (set_nth 0 e i x) t.
Proof.
(* Goal: forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i t)) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) t) *)
elim: t => [n | r | n | t tP s sP | t tP | t tP n | t tP s sP | t tP | t tP n] h.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.NatConst (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.NatConst (GRing.Field.sort F) n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Const (GRing.Field.sort F) r))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Const (GRing.Field.sort F) r)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.Var (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.Var (GRing.Field.sort F) n)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.NatConst (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.NatConst (GRing.Field.sort F) n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Const (GRing.Field.sort F) r))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Const (GRing.Field.sort F) r)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.Var (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.Var (GRing.Field.sort F) n)) *)
move=> /=; case ni: (_ == _); rewrite //= ?(mul0r,add0r,addr0,polyC1,mul1r,hornerX,hornerC); by rewrite // nth_set_nth /= ni.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.NatConst (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.NatConst (GRing.Field.sort F) n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Const (GRing.Field.sort F) r))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Const (GRing.Field.sort F) r)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.NatConst (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.NatConst (GRing.Field.sort F) n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Const (GRing.Field.sort F) r))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Const (GRing.Field.sort F) r)) *)
by rewrite /= mul0r add0r hornerC.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.NatConst (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.NatConst (GRing.Field.sort F) n)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (GRing.NatConst (GRing.Field.sort F) n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (GRing.NatConst (GRing.Field.sort F) n)) *)
by rewrite /= mul0r add0r hornerC.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Add (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Add (GRing.Field.sort F) t s)) *)
by case/andP: h => *; rewrite /= eval_sumpT hornerD tP ?sP.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Opp (GRing.Field.sort F) t)) *)
by rewrite /= eval_opppT hornerN tP.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.NatMul (GRing.Field.sort F) t n)) *)
by rewrite /= eval_natmulpT hornerMn tP.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Mul (GRing.Field.sort F) t s))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Mul (GRing.Field.sort F) t s)) *)
by case/andP: h => *; rewrite /= eval_mulpT hornerM tP ?sP.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Inv (GRing.Field.sort F) t))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Inv (GRing.Field.sort F) t)) *)
by [].
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
-
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t n)) *)
elim: n h => [|n ihn] rt; first by rewrite /= expr0 mul0r add0r hornerC.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@horner (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i (@GRing.Exp (GRing.Field.sort F) t (S n)))) x) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@GRing.Exp (GRing.Field.sort F) t (S n))) *)
by rewrite /= eval_mulpT exprSr hornerM ihn // mulrC tP.
Qed.
Lemma rabstrX (i : nat) (t : tF) : rterm t -> rpoly (abstrX i t).
Proof.
(* Goal: forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t)) *)
elim: t; do ?[ by move=> * //=; do ?case: (_ == _)].
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.NatMul (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Opp (GRing.Field.sort F) t))), is_true (rpoly (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Add (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Add (GRing.Field.sort F) t t0))) *)
-
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.NatMul (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Opp (GRing.Field.sort F) t))), is_true (rpoly (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Add (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Add (GRing.Field.sort F) t t0))) *)
move=> t irt s irs /=; case/andP=> rt rs.
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.NatMul (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Opp (GRing.Field.sort F) t))), is_true (rpoly (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) *)
(* Goal: is_true (rpoly (sumpT (abstrX i t) (abstrX i s))) *)
by apply: rsumpT; rewrite ?irt ?irs //.
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.NatMul (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Opp (GRing.Field.sort F) t))), is_true (rpoly (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) *)
-
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.NatMul (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Opp (GRing.Field.sort F) t))), is_true (rpoly (abstrX i (@GRing.Opp (GRing.Field.sort F) t))) *)
by move=> t irt /= rt; rewrite rpoly_map_mul ?irt //.
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.NatMul (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) *)
-
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.NatMul (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.NatMul (GRing.Field.sort F) t n))) *)
by move=> t irt /= n rt; rewrite rpoly_map_mul ?irt //.
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
-
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (t0 : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t0), is_true (rpoly (abstrX i t0))) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Mul (GRing.Field.sort F) t t0))), is_true (rpoly (abstrX i (@GRing.Mul (GRing.Field.sort F) t t0))) *)
move=> t irt s irs /=; case/andP=> rt rs.
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
(* Goal: is_true (rpoly (mulpT (abstrX i t) (abstrX i s))) *)
by apply: rmulpT; rewrite ?irt ?irs //.
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
-
(* Goal: forall (t : GRing.term (GRing.Field.sort F)) (_ : forall _ : is_true (@GRing.rterm (GRing.Field.unitRingType F) t), is_true (rpoly (abstrX i t))) (n : nat) (_ : is_true (@GRing.rterm (GRing.Field.unitRingType F) (@GRing.Exp (GRing.Field.sort F) t n))), is_true (rpoly (abstrX i (@GRing.Exp (GRing.Field.sort F) t n))) *)
move=> t irt /= n rt; move: (irt rt)=> {rt} rt; elim: n => [|n ihn] //=.
(* Goal: is_true (rpoly (mulpT (abstrX i t) (@iter polyF n (mulpT (abstrX i t)) (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) (S O)) (@nil (GRing.term (GRing.Field.sort F))))))) *)
exact: rmulpT.
Qed.
Implicit Types tx ty : tF.
Lemma abstrX_mulM (i : nat) : {morph abstrX i : x y / x * y >-> mulpT x y}%T.
Proof.
(* Goal: @morphism_2 (GRing.term (GRing.Field.sort F)) (list (GRing.term (GRing.Field.sort F))) (abstrX i) (fun x y : GRing.term (GRing.Field.sort F) => @GRing.Mul (GRing.Field.sort F) x y) (fun x y : list (GRing.term (GRing.Field.sort F)) => mulpT x y) *)
by [].
Qed.
Lemma abstrX1 (i : nat) : abstrX i 1%T = [::1%T].
Proof.
(* Goal: @eq (list (GRing.term (GRing.Field.sort F))) (abstrX i (GRing.NatConst (GRing.Field.sort F) (S O))) (@cons (GRing.term (GRing.Field.sort F)) (GRing.NatConst (GRing.Field.sort F) (S O)) (@nil (GRing.term (GRing.Field.sort F)))) *)
done.
Qed.
Lemma eval_poly_mulM e : {morph eval_poly e : x y / mulpT x y >-> x * y}.
Proof.
(* Goal: @morphism_2 (list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))) (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e) (fun x y : list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) => mulpT x y) (fun x y : GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) => @GRing.mul (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) x y) *)
by move=> x y; rewrite eval_mulpT.
Qed.
Lemma eval_poly1 e : eval_poly e [::1%T] = 1.
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (eval_poly e (@cons (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (GRing.NatConst (GRing.UnitRing.sort (GRing.Field.unitRingType F)) (S O)) (@nil (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))))) (GRing.one (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) *)
by rewrite /= mul0r add0r.
Qed.
Notation abstrX_bigmul := (big_morph _ (abstrX_mulM _) (abstrX1 _)).
Notation eval_bigmul := (big_morph _ (eval_poly_mulM _) (eval_poly1 _)).
Notation bigmap_id := (big_map _ (fun _ => true) id).
Lemma rseq_poly_map (x : nat) (ts : seq tF) :
all (@rterm _) ts -> all rpoly (map (abstrX x) ts).
Proof.
(* Goal: forall _ : is_true (@all (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (@GRing.rterm (GRing.Field.unitRingType F)) ts), is_true (@all polyF rpoly (@map (GRing.term (GRing.Field.sort F)) (list (GRing.term (GRing.Field.sort F))) (abstrX x) ts)) *)
by elim: ts => //= t ts iht; case/andP=> rt rts; rewrite rabstrX // iht.
Qed.
Definition ex_elim (x : nat) (pqs : seq tF * seq tF) :=
ex_elim_seq (map (abstrX x) pqs.1)
(abstrX x (\big[GRing.Mul/1%T]_(q <- pqs.2) q)).
Lemma ex_elim_qf (x : nat) (pqs : seq tF * seq tF) :
GRing.dnf_rterm pqs -> qf (ex_elim x pqs).
Lemma holds_conj : forall e i x ps, all (@rterm _) ps ->
(GRing.holds (set_nth 0 e i x)
Proof.
(* Goal: forall (e : list (GRing.Zmodule.sort (GRing.UnitRing.zmodType (GRing.Field.unitRingType F)))) (i : nat) (x : GRing.Zmodule.sort (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) (ps : list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))) (_ : is_true (@all (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (@GRing.rterm (GRing.Field.unitRingType F)) ps)), iff (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) (GRing.zero (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O))) (@GRing.Bool (GRing.Field.sort F) true) ps)) (is_true (@all (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (fun x0 : @poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) => @root (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) x0 x) (@map (GRing.term (GRing.Field.sort F)) (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@funcomp (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps))) *)
move=> e i x; elim=> [|p ps ihps] //=.
(* Goal: forall _ : is_true (andb (@GRing.rterm (GRing.Field.unitRingType F) p) (@all (GRing.term (GRing.Field.sort F)) (@GRing.rterm (GRing.Field.unitRingType F)) ps)), iff (and (@eq (GRing.Field.sort F) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) e i x) p) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O)) (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O))) (@GRing.Bool (GRing.Field.sort F) true) ps))) (is_true (andb (@root (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (eval_poly e (abstrX i p)) x) (@all (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (fun x0 : @poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)) => @root (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) x0 x) (@map (GRing.term (GRing.Field.sort F)) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@funcomp (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (list (GRing.term (GRing.Field.sort F))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps)))) *)
case/andP=> rp rps; rewrite rootE abstrXP //.
(* Goal: iff (and (@eq (GRing.Field.sort F) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) e i x) p) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O)) (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O))) (@GRing.Bool (GRing.Field.sort F) true) ps))) (is_true (andb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) p) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@all (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (fun x0 : @poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)) => @root (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) x0 x) (@map (GRing.term (GRing.Field.sort F)) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@funcomp (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (list (GRing.term (GRing.Field.sort F))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps)))) *)
constructor; first by case=> -> hps; rewrite eqxx /=; apply/ihps.
(* Goal: forall _ : is_true (andb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F)))) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) p) (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@all (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (fun x0 : @poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F)) => @root (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) x0 x) (@map (GRing.term (GRing.Field.sort F)) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@funcomp (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (list (GRing.term (GRing.Field.sort F))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps))), and (@eq (GRing.Field.sort F) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) e i x) p) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O)) (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.UnitRing.zmodType (GRing.Field.unitRingType F))) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O))) (@GRing.Bool (GRing.Field.sort F) true) ps)) *)
by case/andP; move/eqP=> -> psr; split=> //; apply/ihps.
Qed.
Lemma holds_conjn (e : seq F) (i : nat) (x : F) (ps : seq tF) :
all (@rterm _) ps ->
(GRing.holds (set_nth 0 e i x)
Proof.
(* Goal: forall _ : is_true (@all (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F))) (@GRing.rterm (GRing.Field.unitRingType F)) ps), iff (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Not (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O)))) (@GRing.Bool (GRing.Field.sort F) true) ps)) (is_true (@all (@poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F)))) (fun p : @poly_of (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))) => negb (@root (GRing.Field.ringType F) p x)) (@map (GRing.term (GRing.Field.sort F)) (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (@funcomp (GRing.Zmodule.sort (GRing.Ring.zmodType (poly_ringType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))))) (list (GRing.term (GRing.UnitRing.sort (GRing.Field.unitRingType F)))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps))) *)
elim: ps => [|p ps ihps] //=.
(* Goal: forall _ : is_true (andb (@GRing.rterm (GRing.Field.unitRingType F) p) (@all (GRing.term (GRing.Field.sort F)) (@GRing.rterm (GRing.Field.unitRingType F)) ps)), iff (and (not (@eq (GRing.Field.sort F) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.Field.zmodType F)) e i x) p) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O))) (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.Field.zmodType F)) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Not (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O)))) (@GRing.Bool (GRing.Field.sort F) true) ps))) (is_true (andb (negb (@root (GRing.Field.ringType F) (eval_poly e (abstrX i p)) x)) (@all (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (fun p : @poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) => negb (@root (GRing.Field.ringType F) p x)) (@map (GRing.term (GRing.Field.sort F)) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@funcomp (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (list (GRing.term (GRing.Field.sort F))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps)))) *)
case/andP=> rp rps; rewrite rootE abstrXP //.
(* Goal: iff (and (not (@eq (GRing.Field.sort F) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.Field.zmodType F)) e i x) p) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O))) (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.Field.zmodType F)) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Not (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O)))) (@GRing.Bool (GRing.Field.sort F) true) ps))) (is_true (andb (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.Field.ringType F))) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) p) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType F))))) (@all (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (fun p : @poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) => negb (@root (GRing.Field.ringType F) p x)) (@map (GRing.term (GRing.Field.sort F)) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@funcomp (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (list (GRing.term (GRing.Field.sort F))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps)))) *)
constructor; first by case=> /eqP-> hps /=; apply/ihps.
(* Goal: forall _ : is_true (andb (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType (GRing.Field.ringType F))) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Zmodule.sort (GRing.Field.zmodType F)) (GRing.zero (GRing.Field.zmodType F)) e i x) p) (GRing.zero (GRing.Ring.zmodType (GRing.Field.ringType F))))) (@all (@poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F))) (fun p : @poly_of (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) => negb (@root (GRing.Field.ringType F) p x)) (@map (GRing.term (GRing.Field.sort F)) (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (@funcomp (@poly_of (GRing.UnitRing.ringType (GRing.Field.unitRingType F)) (Phant (GRing.Field.sort F))) (list (GRing.term (GRing.Field.sort F))) (GRing.term (GRing.Field.sort F)) tt (eval_poly e) (abstrX i)) ps))), and (not (@eq (GRing.Field.sort F) (@GRing.eval (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.Field.zmodType F)) e i x) p) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (GRing.Field.unitRingType F))) O))) (@GRing.holds (GRing.Field.unitRingType F) (@set_nth (GRing.Field.sort F) (GRing.zero (GRing.Field.zmodType F)) e i x) (@foldr (GRing.term (GRing.Field.sort F)) (GRing.formula (GRing.Field.sort F)) (fun t : GRing.term (GRing.Field.sort F) => @GRing.And (GRing.Field.sort F) (@GRing.Not (GRing.Field.sort F) (@GRing.Equal (GRing.Field.sort F) t (GRing.NatConst (GRing.Field.sort F) O)))) (@GRing.Bool (GRing.Field.sort F) true) ps)) *)
by case/andP=> pr psr; split; first apply/eqP=> //; apply/ihps.
Qed.
Lemma holds_ex_elim: GRing.valid_QE_proj ex_elim.
Lemma wf_ex_elim : GRing.wf_QE_proj ex_elim.
Proof.
(* Goal: @GRing.wf_QE_proj F ex_elim *)
by move=> i bc /= rbc; apply: ex_elim_qf.
Qed.
Definition Mixin := QEdecFieldMixin wf_ex_elim holds_ex_elim.
End ClosedFieldQE.
End ClosedFieldQE.
Notation closed_field_QEMixin := ClosedFieldQE.Mixin.
Import CodeSeq.
Lemma countable_field_extension (F : countFieldType) (p : {poly F}) :
size p > 1 ->
{E : countFieldType & {FtoE : {rmorphism F -> E} &
{w : E | root (map_poly FtoE p) w
& forall u : E, exists q, u = (map_poly FtoE q).[w]}}}.
Lemma countable_algebraic_closure (F : countFieldType) :
{K : countClosedFieldType & {FtoK : {rmorphism F -> K} | integralRange FtoK}}.
|
From Coq Require Import ssreflect ssrfun 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 pf_irr (P : Prop) (p1 p2 : P) : p1 = p2.
Proof.
(* Goal: @eq P p1 p2 *)
by apply/ext_prop_dep_proof_irrel_cic/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 sval_inj 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: pf_irr.
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 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.
Section Cast.
Variable (C : Type) (interp : C -> Type).
Definition cast A B (pf : A = B) (v : interp B) : interp A :=
ecast _ _ (esym pf) v.
Lemma eqc A (pf : A = A) (v : interp A) : cast pf v = v.
Proof.
(* Goal: @eq (interp A) (@cast A A pf v) v *)
by move: pf; apply: Streicher_K.
Qed.
Definition jmeq A B (v : interp A) (w : interp B) := forall pf, v = cast pf w.
Lemma jmrefl A (v : interp A) : jmeq v v.
Proof.
(* Goal: @jmeq A A v v *)
by move=>pf; rewrite eqc.
Qed.
Lemma jmsym A B (v : interp A) (w : interp B) : jmeq v w -> jmeq w v.
Proof.
(* Goal: forall _ : @jmeq A B v w, @jmeq B A w v *)
move=> H pf; rewrite (H (esym pf)).
(* Goal: @eq (interp B) w (@cast B A pf (@cast A B (@esym C B A pf) w)) *)
by move: (pf); rewrite pf in w H * => {pf} pf; rewrite !eqc.
Qed.
Lemma jmE A (v w : interp A) : jmeq v w <-> v = w.
Proof.
(* Goal: iff (@jmeq A A v w) (@eq (interp A) v w) *)
by split=>[/(_ erefl) //|->]; apply: jmrefl.
Qed.
Lemma castE A B (pf1 pf2 : A = B) (v1 v2 : interp B) :
v1 = v2 <-> cast pf1 v1 = cast pf2 v2.
Proof.
(* Goal: iff (@eq (interp B) v1 v2) (@eq (interp A) (@cast A B pf1 v1) (@cast A B pf2 v2)) *)
by move: (pf1) pf2; rewrite pf1 =>*; rewrite !eqc.
Qed.
End Cast.
Arguments cast {C} interp [A][B] pf v.
Arguments jmeq {C} interp [A][B] v w.
Hint Resolve jmrefl : core.
Notation icast pf v := (@cast _ id _ _ pf v).
Notation ijmeq v w := (@jmeq _ id _ _ v w).
Section Dynamic.
Variables (A : Type) (P : A -> Type).
Definition dynamic := sigT P.
Definition dyn := existT P.
Definition dyn_tp := @projT1 _ P.
Definition dyn_val := @projT2 _ P.
Definition dyn_eta := @sigT_eta _ P.
Definition dyn_injT := @eq_sigT_fst _ P.
Definition dyn_inj := @inj_pair2 _ P.
End Dynamic.
Prenex Implicits dyn_tp dyn_val dyn_injT dyn_inj.
Arguments dyn {C} interp {A} _ : rename.
Notation idyn v := (@dyn _ id _ v).
Lemma dynE (A B : Type) interp (pf : A = B) (v : interp A) (w : interp B) :
jmeq interp v w <-> dyn interp v = dyn interp w.
Proof.
(* Goal: iff (@jmeq Type interp A B v w) (@eq (@sigT Type interp) (@dyn Type interp A v) (@dyn Type interp B w)) *)
by rewrite -pf in w *; rewrite jmE; split => [->|/dyn_inj].
Qed.
|
Require Export Compare_Nat.
Require Export Factorization.
Require Export Compare_Num.
Section Comparator_Rel.
Variable BASE : BT.
Definition FR (n : nat) (o : order) (x y : inf n) : order :=
match o return order with
| L => L
| E => Compare_Nat.comparison (val_inf n x) (val_inf n y)
| G => G
end.
Definition R (n : nat) (o : order) (x y : inf n)
(o' : order) : Prop := o' = FR n o x y.
Notation Proper := (proper _) (only parsing).
Lemma is_proper : proper _ BASE R.
Proof.
(* Goal: proper order BASE R *)
unfold proper in |- *.
(* Goal: forall a : order, R (S O) a (Zero BASE) (Zero BASE) a *)
intros a; case a; unfold R in |- *; simpl in |- *; auto with arith.
Qed.
Notation Factorizable := (factorizable _) (only parsing).
Lemma is_factorizable : factorizable _ R.
Proof.
(* Goal: factorizable order R *)
unfold factorizable in |- *; unfold R in |- *; intros M N q q' r r' a a1 a' x x' H1 H2; case a.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order a1 (FR M E q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: forall (_ : @eq order a1 (FR M L q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) L x x') *)
simpl in |- *; intro R1; rewrite R1; simpl in |- *; auto with arith.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order a1 (FR M E q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
case a1.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: forall (_ : @eq order E (FR M E q q')) (_ : @eq order a' (FR N E r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: forall (_ : @eq order L (FR M E q q')) (_ : @eq order a' (FR N L r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
intros R1 R2.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: forall (_ : @eq order E (FR M E q q')) (_ : @eq order a' (FR N E r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order a' (FR (Init.Nat.mul M N) E x x') *)
replace a' with L; simpl in |- *; apply sym_equal; apply comparisonL.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: forall (_ : @eq order E (FR M E q q')) (_ : @eq order a' (FR N E r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: lt (val_inf (Init.Nat.mul M N) x) (val_inf (Init.Nat.mul M N) x') *)
unfold Diveucl in H1; unfold Diveucl in H2; elim H1; elim H2; clear H1 H2; intros H1 H2 H3 H4; rewrite H1; rewrite H3; elim (mult_comm (val_inf M q) N); elim (mult_comm (val_inf M q') N); auto with arith.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: forall (_ : @eq order E (FR M E q q')) (_ : @eq order a' (FR N E r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
case a'; intros R1 R2.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order G (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order E (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order L (FR (Init.Nat.mul M N) E x x') *)
simpl in |- *; apply sym_equal; apply comparisonL.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order G (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order E (FR (Init.Nat.mul M N) E x x') *)
(* Goal: lt (val_inf (Init.Nat.mul M N) x) (val_inf (Init.Nat.mul M N) x') *)
unfold Diveucl in H1; unfold Diveucl in H2; elim H1; elim H2; clear H1 H2; intros H1 H2 H3 H4; rewrite H1; rewrite H3.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order G (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order E (FR (Init.Nat.mul M N) E x x') *)
(* Goal: lt (Init.Nat.add (Init.Nat.mul N (val_inf M q)) (val_inf N r)) (Init.Nat.add (Init.Nat.mul N (val_inf M q')) (val_inf N r')) *)
replace (val_inf M q') with (val_inf M q); auto with arith.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order G (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order E (FR (Init.Nat.mul M N) E x x') *)
simpl in |- *; apply sym_equal; apply comparisonE.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order G (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq nat (val_inf (Init.Nat.mul M N) x) (val_inf (Init.Nat.mul M N) x') *)
unfold Diveucl in H1; unfold Diveucl in H2; elim H1; elim H2; clear H1 H2; intros H1 H2 H3 H4; rewrite H1; rewrite H3.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order G (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul N (val_inf M q)) (val_inf N r)) (Init.Nat.add (Init.Nat.mul N (val_inf M q')) (val_inf N r')) *)
replace (val_inf M q') with (val_inf M q); auto with arith.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: @eq order G (FR (Init.Nat.mul M N) E x x') *)
simpl in |- *; apply sym_equal; apply comparisonG.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: gt (val_inf (Init.Nat.mul M N) x) (val_inf (Init.Nat.mul M N) x') *)
unfold Diveucl in H1; unfold Diveucl in H2; elim H1; elim H2; clear H1 H2; intros H1 H2 H3 H4; rewrite H1; rewrite H3.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
(* Goal: gt (Init.Nat.add (Init.Nat.mul N (val_inf M q)) (val_inf N r)) (Init.Nat.add (Init.Nat.mul N (val_inf M q')) (val_inf N r')) *)
replace (val_inf M q') with (val_inf M q); auto with arith.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: forall (_ : @eq order G (FR M E q q')) (_ : @eq order a' (FR N G r r')), @eq order a' (FR (Init.Nat.mul M N) E x x') *)
intros R1 R2.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: @eq order a' (FR (Init.Nat.mul M N) E x x') *)
replace a' with G; simpl in |- *; apply sym_equal; apply comparisonG.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
(* Goal: gt (val_inf (Init.Nat.mul M N) x) (val_inf (Init.Nat.mul M N) x') *)
unfold Diveucl in H1; unfold Diveucl in H2; elim H1; elim H2; clear H1 H2; intros H1 H2 H3 H4; rewrite H1; rewrite H3; unfold gt in |- *; elim (mult_comm (val_inf M q) N); elim (mult_comm (val_inf M q') N); auto with arith.
(* Goal: forall (_ : @eq order a1 (FR M G q q')) (_ : @eq order a' (FR N a1 r r')), @eq order a' (FR (Init.Nat.mul M N) G x x') *)
simpl in |- *; intro R1; rewrite R1; simpl in |- *; auto with arith.
Qed.
End Comparator_Rel. |
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCorder.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinear4.
Require Export GeoCoq.Elements.OriginalProofs.lemma_TCreflexive.
Section Euclid.
Context `{Ax:area}.
Lemma lemma_EFreflexive :
forall a b c d p,
BetS a p c -> BetS b p d -> nCol a b c ->
EF a b c d a b c d.
Proof.
(* Goal: forall (a b c d p : @Point Ax0) (_ : @BetS Ax0 a p c) (_ : @BetS Ax0 b p d) (_ : @nCol Ax0 a b c), @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
intros.
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (nCol a c b) by (forward_using lemma_NCorder).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (~ Col a c d).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
(* Goal: not (@Col Ax0 a c d) *)
{
(* Goal: not (@Col Ax0 a c d) *)
intro.
(* Goal: False *)
assert (Col b p d) by (conclude_def Col ).
(* Goal: False *)
assert (Col a p c) by (conclude_def Col ).
(* Goal: False *)
assert (Col a c p) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq a c) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col c d p) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col d p c) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col d p b) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq p d) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (neq d p) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col p c b) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col a p c) by (conclude_def Col ).
(* Goal: False *)
assert (Col p c a) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq p c) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col c b a) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col a b c) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
}
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (Triangle a c d) by (conclude_def Triangle ).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (Triangle a c b) by (conclude_def Triangle ).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (Cong_3 a c d a c d) by (conclude lemma_TCreflexive).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (Cong_3 a c b a c b) by (conclude lemma_TCreflexive).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (ET a c d a c d) by (conclude axiom_congruentequal).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (ET a c b a c b) by (conclude axiom_congruentequal).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (Col a c p) by (conclude_def Col ).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (nCol a c b) by (forward_using lemma_NCorder).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (TS b a c d) by (conclude_def TS ).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
assert (EF a b c d a b c d) by (conclude axiom_paste3).
(* Goal: @EF Ax0 Ax1 Ax2 Ax a b c d a b c d *)
close.
Qed.
End Euclid.
|
Require Import Bool Arith List.
Require Import BellantoniCook.Lib BellantoniCook.MultiPoly BellantoniCook.Cobham BellantoniCook.CobhamLib BellantoniCook.CobhamUnary BellantoniCook.BC.
Definition Pred : Cobham :=
Rec Zero (Proj 2 0) (Proj 2 0) (Proj 1 0).
Lemma rec_bounded_Pred : rec_bounded' Pred.
Proof.
(* Goal: rec_bounded' Pred *)
simpl; repeat (split; auto); intros.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))) *)
rewrite <- hd_nth_0.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@hd (list bool) (@nil bool) l)) *)
induction (hd nil l); simpl; try (case a); omega.
Qed.
Lemma Pred_correct l :
sem pred nil l = Sem Pred l.
Proof.
(* Goal: @eq (list bool) (sem pred (@nil (list bool)) l) (Sem Pred l) *)
intros; simpl.
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) l)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l)) *)
case (hd nil l); simpl; trivial.
(* Goal: forall (b : bool) (l : list bool), @eq (list bool) l (if b then l else l) *)
intros; case b; trivial.
Qed.
Lemma cond'_correct l :
sem cond nil l = Sem Cond l.
Proof.
(* Goal: @eq (list bool) (sem cond (@nil (list bool)) l) (Sem Cond l) *)
intros; simpl.
(* Goal: @eq (list bool) match l with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l)) *)
destruct l; simpl; trivial; intros.
(* Goal: @eq (list bool) match l0 with | nil => @nil bool | cons b (nil as l0) => match l with | nil => b | cons b0 l => @nil bool end | cons b (cons c (nil as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => @nil bool end | cons b (cons c (cons d l2 as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l l0) *)
destruct l; simpl; trivial; intros.
(* Goal: @eq (list bool) match l0 with | nil => @nil bool | cons b0 (nil as l) => @nil bool | cons b0 (cons c (nil as l0) as l) => if b then c else @nil bool | cons b0 (cons c (cons d l1 as l0) as l) => if b then c else d end (if b then @nth (list bool) (S O) l0 (@nil bool) else @nth (list bool) (S (S O)) l0 (@nil bool)) *)
(* Goal: @eq (list bool) match l0 with | nil => @nil bool | cons b (nil as l) => b | cons b (cons c (nil as l0) as l) => b | cons b (cons c (cons d l1 as l0) as l) => b end (@nth (list bool) O l0 (@nil bool)) *)
destruct l0; simpl; trivial; intros.
(* Goal: @eq (list bool) match l0 with | nil => @nil bool | cons b0 (nil as l) => @nil bool | cons b0 (cons c (nil as l0) as l) => if b then c else @nil bool | cons b0 (cons c (cons d l1 as l0) as l) => if b then c else d end (if b then @nth (list bool) (S O) l0 (@nil bool) else @nth (list bool) (S (S O)) l0 (@nil bool)) *)
(* Goal: @eq (list bool) match l0 with | nil => l | cons c (nil as l0) => l | cons c (cons d l1 as l0) => l end l *)
destruct l0; simpl; trivial; intros.
(* Goal: @eq (list bool) match l0 with | nil => @nil bool | cons b0 (nil as l) => @nil bool | cons b0 (cons c (nil as l0) as l) => if b then c else @nil bool | cons b0 (cons c (cons d l1 as l0) as l) => if b then c else d end (if b then @nth (list bool) (S O) l0 (@nil bool) else @nth (list bool) (S (S O)) l0 (@nil bool)) *)
(* Goal: @eq (list bool) match l1 with | nil => l | cons d l0 => l end l *)
destruct l1; simpl; trivial; intros.
(* Goal: @eq (list bool) match l0 with | nil => @nil bool | cons b0 (nil as l) => @nil bool | cons b0 (cons c (nil as l0) as l) => if b then c else @nil bool | cons b0 (cons c (cons d l1 as l0) as l) => if b then c else d end (if b then @nth (list bool) (S O) l0 (@nil bool) else @nth (list bool) (S (S O)) l0 (@nil bool)) *)
destruct l0; simpl; trivial; intros.
(* Goal: @eq (list bool) match l1 with | nil => @nil bool | cons c (nil as l) => if b then c else @nil bool | cons c (cons d l0 as l) => if b then c else d end (if b then @nth (list bool) O l1 (@nil bool) else @nth (list bool) (S O) l1 (@nil bool)) *)
(* Goal: @eq (list bool) (@nil bool) (if b then @nil bool else @nil bool) *)
destruct b; simpl; trivial; intros.
(* Goal: @eq (list bool) match l1 with | nil => @nil bool | cons c (nil as l) => if b then c else @nil bool | cons c (cons d l0 as l) => if b then c else d end (if b then @nth (list bool) O l1 (@nil bool) else @nth (list bool) (S O) l1 (@nil bool)) *)
destruct l1; simpl; trivial; intros.
(* Goal: @eq (list bool) match l2 with | nil => if b then l1 else @nil bool | cons d l => if b then l1 else d end (if b then l1 else @nth (list bool) O l2 (@nil bool)) *)
(* Goal: @eq (list bool) (@nil bool) (if b then @nil bool else @nil bool) *)
destruct b; simpl; trivial; intros.
(* Goal: @eq (list bool) match l2 with | nil => if b then l1 else @nil bool | cons d l => if b then l1 else d end (if b then l1 else @nth (list bool) O l2 (@nil bool)) *)
destruct l2; simpl; trivial; intros.
Qed.
Definition move_arg (n i j:nat) (e:Cobham) : Cobham :=
Comp n e (move_forward i j
(map (Proj n) (seq 0 n)) (Proj n 0)).
Lemma move_arg_inf n i j e :
i+j < n -> arity e = ok_arity n ->
arity (move_arg n i j e) = ok_arity n.
Proof.
(* Goal: forall (_ : lt (Init.Nat.add i j) n) (_ : @eq Arity (arity e) (ok_arity n)), @eq Arity (arity (move_arg n i j e)) (ok_arity n) *)
simpl; intros.
(* Goal: @eq Arity match arity e with | error_Rec a a0 a1 a2 => error_Comp (error_Rec a a0 a1 a2) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O))) | error_Comp a l => error_Comp (error_Comp a l) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O))) | error_Proj n0 n1 => error_Comp (error_Proj n0 n1) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O))) | ok_arity nh => if andb (Nat.eqb nh (@length Cobham (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (@forallb Arity (fun e : Arity => arity_eq e (ok_arity n)) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) then ok_arity n else error_Comp (ok_arity nh) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O))) end (ok_arity n) *)
rewrite H0, length_move_forward, map_length, seq_length, <- beq_nat_refl; simpl.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (if @forallb Arity (fun e : Arity => arity_eq e (ok_arity n)) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O))) then ok_arity n else error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
case_eq (forallb (fun e0 : Arity => arity_eq e0 (ok_arity n)) (map arity (move_forward i j (map (Proj n) (seq 0 n)) (Proj n 0)))); trivial.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: forall _ : @eq bool (@forallb Arity (fun e0 : Arity => arity_eq e0 (ok_arity n)) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) false, @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
intros Hall.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
rewrite forallb_forall_conv in Hall.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
destruct Hall as [n' [H1 H2] ].
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
rewrite in_map_iff in H1.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
destruct H1 as [e' [H3 H4] ].
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
rewrite move_forward_map with (d1:=0) in H4 by trivial.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
rewrite in_map_iff in H4.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
destruct H4 as [n'' [H5 H6] ]; subst.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
rewrite in_move_forward_iff in H6.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
rewrite in_seq_iff in H6.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
replace (arity (Proj n n'')) with (ok_arity n) in H2.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity n) (arity (Proj n n'')) *)
(* Goal: @eq Arity (error_Comp (ok_arity n) (@map Cobham Arity arity (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (ok_arity n) *)
contradict H2.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity n) (arity (Proj n n'')) *)
(* Goal: not (@eq bool (arity_eq (ok_arity n) (ok_arity n)) false) *)
rewrite arity_eq_refl.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity n) (arity (Proj n n'')) *)
(* Goal: not (@eq bool true false) *)
congruence.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity n) (arity (Proj n n'')) *)
simpl.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity n) (if match n with | O => false | S m' => Nat.leb n'' m' end then ok_arity n else error_Proj n n'') *)
destruct n.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity (S n)) (if Nat.leb n'' n then ok_arity (S n) else error_Proj (S n) n'') *)
(* Goal: @eq Arity (ok_arity O) (error_Proj O n'') *)
contradict H2.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity (S n)) (if Nat.leb n'' n then ok_arity (S n) else error_Proj (S n) n'') *)
(* Goal: not (@eq bool (arity_eq (arity (Proj O n'')) (ok_arity O)) false) *)
omega.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
(* Goal: @eq Arity (ok_arity (S n)) (if Nat.leb n'' n then ok_arity (S n) else error_Proj (S n) n'') *)
rewrite leb_correct by omega; trivial.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i (@length nat (seq O n)) *)
rewrite seq_length.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
(* Goal: lt i n *)
omega.
(* Goal: lt (Init.Nat.add i j) (@length Cobham (@map nat Cobham (Proj n) (seq O n))) *)
rewrite map_length, seq_length; trivial.
Qed.
Lemma rec_bounded_move_arg : forall n i j e,
rec_bounded' e ->
rec_bounded' (move_arg n i j e).
Proof.
(* Goal: forall (n i j : nat) (e : Cobham) (_ : rec_bounded' e), rec_bounded' (move_arg n i j e) *)
intros n i j e H; simpl; split; trivial.
(* Goal: @andl Cobham rec_bounded' (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)) *)
rewrite <- forall_andl.
(* Goal: forall (x : Cobham) (_ : @In Cobham x (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O))), rec_bounded' x *)
intros e' H'.
(* Goal: rec_bounded' e' *)
rewrite move_forward_map with (d1:=0), in_map_iff in H' by trivial.
(* Goal: rec_bounded' e' *)
destruct H' as [m [H1 _] ]; subst; simpl; trivial.
Qed.
Lemma move_arg_correct n i j e l :
length l = n ->
Sem (move_arg n i j e) l =
Sem e (move_forward i j l (Sem (Proj n 0) l)).
Proof.
(* Goal: forall _ : @eq nat (@length (list bool) l) n, @eq (list bool) (Sem (move_arg n i j e) l) (Sem e (@move_forward (list bool) i j l (Sem (Proj n O) l))) *)
simpl; intros.
(* Goal: @eq (list bool) (Sem e (@map Cobham (list bool) (fun e : Cobham => Sem e l) (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O)))) (Sem e (@move_forward (list bool) i j l (@nth (list bool) O l (@nil bool)))) *)
f_equal.
(* Goal: @eq (list (list bool)) (@map Cobham (list bool) (fun e : Cobham => Sem e l) (@move_forward Cobham i j (@map nat Cobham (Proj n) (seq O n)) (Proj n O))) (@move_forward (list bool) i j l (@nth (list bool) O l (@nil bool))) *)
rewrite <- move_forward_map with (d2:= Sem (Proj n 0) l); trivial.
(* Goal: @eq (list (list bool)) (@move_forward (list bool) i j (@map Cobham (list bool) (fun e : Cobham => Sem e l) (@map nat Cobham (Proj n) (seq O n))) (Sem (Proj n O) l)) (@move_forward (list bool) i j l (@nth (list bool) O l (@nil bool))) *)
rewrite map_map; simpl.
(* Goal: @eq (list (list bool)) (@move_forward (list bool) i j (@map nat (list bool) (fun x : nat => @nth (list bool) x l (@nil bool)) (seq O n)) (@nth (list bool) O l (@nil bool))) (@move_forward (list bool) i j l (@nth (list bool) O l (@nil bool))) *)
f_equal; apply map_nth_seq; omega.
Qed.
Definition dummies (n m : nat)(e : Cobham) : Cobham :=
Comp (n+m) e (map (Proj (n+m)) (seq 0 n)).
Lemma arity_dummies e n n' :
arity e = ok_arity n' ->
arity (dummies n' n e) = ok_arity (n + n').
Proof.
(* Goal: forall _ : @eq Arity (arity e) (ok_arity n'), @eq Arity (arity (dummies n' n e)) (ok_arity (Init.Nat.add n n')) *)
destruct n' as [ | n']; intro H; simpl; rewrite H; simpl.
(* Goal: @eq Arity (if andb (Nat.eqb n' (@length Cobham (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n')))) (andb (Nat.eqb (Init.Nat.add n' n) (Init.Nat.add n' n)) (@forallb Arity (fun e : Arity => arity_eq e (ok_arity (S (Init.Nat.add n' n)))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) then ok_arity (S (Init.Nat.add n' n)) else error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
(* Goal: @eq Arity (ok_arity n) (ok_arity (Init.Nat.add n O)) *)
rewrite plus_0_r.
(* Goal: @eq Arity (if andb (Nat.eqb n' (@length Cobham (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n')))) (andb (Nat.eqb (Init.Nat.add n' n) (Init.Nat.add n' n)) (@forallb Arity (fun e : Arity => arity_eq e (ok_arity (S (Init.Nat.add n' n)))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) then ok_arity (S (Init.Nat.add n' n)) else error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
(* Goal: @eq Arity (ok_arity n) (ok_arity n) *)
trivial.
(* Goal: @eq Arity (if andb (Nat.eqb n' (@length Cobham (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n')))) (andb (Nat.eqb (Init.Nat.add n' n) (Init.Nat.add n' n)) (@forallb Arity (fun e : Arity => arity_eq e (ok_arity (S (Init.Nat.add n' n)))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) then ok_arity (S (Init.Nat.add n' n)) else error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
rewrite map_length, seq_length, <- beq_nat_refl, <- beq_nat_refl.
(* Goal: @eq Arity (if andb true (andb true (@forallb Arity (fun e : Arity => arity_eq e (ok_arity (S (Init.Nat.add n' n)))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) then ok_arity (S (Init.Nat.add n' n)) else error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
simpl.
(* Goal: @eq Arity (if @forallb Arity (fun e : Arity => arity_eq e (ok_arity (S (Init.Nat.add n' n)))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))) then ok_arity (S (Init.Nat.add n' n)) else error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
case_eq (forallb (fun e0 : Arity => arity_eq e0 (ok_arity (S (n' + n)))) (map arity (map (Proj (S (n' + n))) (seq 1 n')))); intro Hall.
(* Goal: @eq Arity (error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
(* Goal: @eq Arity (ok_arity (S (Init.Nat.add n' n))) (ok_arity (Init.Nat.add n (S n'))) *)
f_equal.
(* Goal: @eq Arity (error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
(* Goal: @eq nat (S (Init.Nat.add n' n)) (Init.Nat.add n (S n')) *)
ring.
(* Goal: @eq Arity (error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
rewrite <- not_true_iff_false in Hall.
(* Goal: @eq Arity (error_Comp (ok_arity (S n')) (@cons Arity (ok_arity (S (Init.Nat.add n' n))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n'))))) (ok_arity (Init.Nat.add n (S n'))) *)
contradict Hall.
(* Goal: @eq bool (@forallb Arity (fun e0 : Arity => arity_eq e0 (ok_arity (S (Init.Nat.add n' n)))) (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n')))) true *)
rewrite forallb_forall.
(* Goal: forall (x : Arity) (_ : @In Arity x (@map Cobham Arity arity (@map nat Cobham (Proj (S (Init.Nat.add n' n))) (seq (S O) n')))), @eq bool (arity_eq x (ok_arity (S (Init.Nat.add n' n)))) true *)
intros m H0.
(* Goal: @eq bool (arity_eq m (ok_arity (S (Init.Nat.add n' n)))) true *)
rewrite in_map_iff in H0.
(* Goal: @eq bool (arity_eq m (ok_arity (S (Init.Nat.add n' n)))) true *)
destruct H0 as [e0 [H1 H2] ].
(* Goal: @eq bool (arity_eq m (ok_arity (S (Init.Nat.add n' n)))) true *)
rewrite in_map_iff in H2.
(* Goal: @eq bool (arity_eq m (ok_arity (S (Init.Nat.add n' n)))) true *)
destruct H2 as [p [H3 H4] ].
(* Goal: @eq bool (arity_eq m (ok_arity (S (Init.Nat.add n' n)))) true *)
rewrite in_seq_iff in H4.
(* Goal: @eq bool (arity_eq m (ok_arity (S (Init.Nat.add n' n)))) true *)
subst e0 m.
(* Goal: @eq bool (arity_eq (arity (Proj (S (Init.Nat.add n' n)) p)) (ok_arity (S (Init.Nat.add n' n)))) true *)
simpl.
(* Goal: @eq bool (arity_eq (if Nat.leb p (Init.Nat.add n' n) then ok_arity (S (Init.Nat.add n' n)) else error_Proj (S (Init.Nat.add n' n)) p) (ok_arity (S (Init.Nat.add n' n)))) true *)
rewrite leb_correct by omega.
(* Goal: @eq bool (arity_eq (ok_arity (S (Init.Nat.add n' n))) (ok_arity (S (Init.Nat.add n' n)))) true *)
apply arity_eq_refl.
Qed.
Lemma rec_bounded_dummies : forall e n m,
rec_bounded' e ->
rec_bounded' (dummies n m e).
Proof.
(* Goal: forall (e : Cobham) (n m : nat) (_ : rec_bounded' e), rec_bounded' (dummies n m e) *)
intros e n m H; simpl; split; trivial.
(* Goal: @andl Cobham rec_bounded' (@map nat Cobham (Proj (Init.Nat.add n m)) (seq O n)) *)
rewrite <- forall_andl.
(* Goal: forall (x : Cobham) (_ : @In Cobham x (@map nat Cobham (Proj (Init.Nat.add n m)) (seq O n))), rec_bounded' x *)
intros e0 H0.
(* Goal: rec_bounded' e0 *)
rewrite in_map_iff in H0.
(* Goal: rec_bounded' e0 *)
destruct H0 as [p [H1 _] ].
(* Goal: rec_bounded' e0 *)
subst e0.
(* Goal: rec_bounded' (Proj (Init.Nat.add n m) p) *)
simpl; trivial.
Qed.
Lemma dummies_correct e n m l:
n <= length l ->
Sem (dummies n m e) l = Sem e (firstn n l).
Proof.
(* Goal: forall _ : le n (@length (list bool) l), @eq (list bool) (Sem (dummies n m e) l) (Sem e (@firstn (list bool) n l)) *)
unfold dummies; intros; simpl.
(* Goal: @eq (list bool) (Sem e (@map Cobham (list bool) (fun e : Cobham => Sem e l) (@map nat Cobham (Proj (Init.Nat.add n m)) (seq O n)))) (Sem e (@firstn (list bool) n l)) *)
rewrite map_map; simpl.
(* Goal: @eq (list bool) (Sem e (@map nat (list bool) (fun x : nat => @nth (list bool) x l (@nil bool)) (seq O n))) (Sem e (@firstn (list bool) n l)) *)
f_equal.
(* Goal: @eq (list (list bool)) (@map nat (list bool) (fun x : nat => @nth (list bool) x l (@nil bool)) (seq O n)) (@firstn (list bool) n l) *)
rewrite <- firstn_map_nth; trivial.
Qed.
Fixpoint BC_to_Cobham n s (e : BC) : Cobham :=
match e with
| zero => Zero
| proj n s i => Proj (n + s) i
| succ b => Succ b
| pred => Pred
| cond => Cond
| rec g h0 h1 =>
Rec (BC_to_Cobham (n - 1) s g)
(move_arg (S (n+s)) 1 (n-1) (BC_to_Cobham n (S s) h0) )
(move_arg (S (n+s)) 1 (n-1) (BC_to_Cobham n (S s) h1) )
(Poly (pplus (psum n s) (poly_BC n e)))
| comp n s h rl tl =>
Comp (n + s) (BC_to_Cobham (length rl) (length tl) h)
(map (fun e => (dummies n s (BC_to_Cobham n 0 e))) rl ++
map (BC_to_Cobham n s) tl)
end.
Opaque Poly.
Lemma arity_BC_to_Cobham : forall (e : BC) n s,
arities e = ok_arities n s ->
arity (BC_to_Cobham n s e) = ok_arity (n + s).
Lemma BC_to_Cobham_correct : forall (e : BC) n s,
arities e = ok_arities n s ->
(forall xl yl,
n = length xl ->
s = length yl ->
sem e xl yl = Sem (BC_to_Cobham n s e) (xl ++ yl)).
Proof.
(* Goal: forall (e : BC) (n s : nat) (_ : @eq Arities (arities e) (ok_arities n s)) (xl yl : list (list bool)) (_ : @eq nat n (@length (list bool) xl)) (_ : @eq nat s (@length (list bool) yl)), @eq (list bool) (sem e xl yl) (Sem (BC_to_Cobham n s e) (@app (list bool) xl yl)) *)
refine (BC_ind_inf _ _ _ _ _ _ _ _); simpl; intros; auto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (if match n with | O => false | S m' => Nat.leb i m' end then @nth (list bool) i xl (@nil bool) else @nth (list bool) (Init.Nat.sub i n) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
destruct n.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (if Nat.leb i n then @nth (list bool) i xl (@nil bool) else @nth (list bool) (Init.Nat.sub i (S n)) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
(* Goal: @eq (list bool) (@nth (list bool) (Init.Nat.sub i O) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
rewrite (length_nil _ xl); simpl; auto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (if Nat.leb i n then @nth (list bool) i xl (@nil bool) else @nth (list bool) (Init.Nat.sub i (S n)) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
(* Goal: @eq (list bool) (@nth (list bool) (Init.Nat.sub i O) yl (@nil bool)) (@nth (list bool) i yl (@nil bool)) *)
f_equal; omega.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (if Nat.leb i n then @nth (list bool) i xl (@nil bool) else @nth (list bool) (Init.Nat.sub i (S n)) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
case_eq (leb i n); intros.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@nth (list bool) (Init.Nat.sub i (S n)) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
(* Goal: @eq (list bool) (@nth (list bool) i xl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
apply leb_complete in H2.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@nth (list bool) (Init.Nat.sub i (S n)) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
(* Goal: @eq (list bool) (@nth (list bool) i xl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
rewrite app_nth1; trivial; omega.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@nth (list bool) (Init.Nat.sub i (S n)) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
apply leb_complete_conv in H2.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@nth (list bool) (Init.Nat.sub i (S n)) yl (@nil bool)) (@nth (list bool) i (@app (list bool) xl yl) (@nil bool)) *)
rewrite app_nth2, H0; trivial; omega.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@cons bool b (@hd (list bool) (@nil bool) yl)) (@cons bool b (@hd (list bool) (@nil bool) (@app (list bool) xl yl))) *)
rewrite (length_nil _ xl); simpl; auto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
rewrite (length_nil _ xl); simpl; auto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) yl)) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) yl) (@tl (list bool) yl)) *)
destruct (hd nil yl); simpl; trivial; case b; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
rewrite (length_nil _ xl); simpl; auto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons a (nil as l) => @nil bool | cons a (cons b (nil as l0) as l) => match a with | nil => b | cons b0 l1 => @nil bool end | cons a (cons b (cons c (nil as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l2 => c | cons (false as b0) l2 => @nil bool end | cons a (cons b (cons c (cons d l2 as l1) as l0) as l) => match a with | nil => b | cons (true as b0) l3 => c | cons (false as b0) l3 => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) (@hd (list bool) (@nil bool) yl) (@tl (list bool) yl)) *)
destruct yl; simpl; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => @nil bool | cons b (nil as l0) => match l with | nil => b | cons b0 l => @nil bool end | cons b (cons c (nil as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => @nil bool end | cons b (cons c (cons d l2 as l1) as l0) => match l with | nil => b | cons (true as b0) l => c | cons (false as b0) l => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l yl) *)
destruct yl; simpl; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => match l with | nil => l0 | cons b l => @nil bool end | cons c (nil as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => @nil bool end | cons c (cons d l2 as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 yl)) *)
(* Goal: @eq (list bool) (@nil bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@nil (list bool))) *)
destruct l; simpl; trivial; case b; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => match l with | nil => l0 | cons b l => @nil bool end | cons c (nil as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => @nil bool end | cons c (cons d l2 as l1) => match l with | nil => l0 | cons (true as b) l => c | cons (false as b) l => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 yl)) *)
destruct yl; simpl; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => @nil bool end | cons d l2 => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 (@cons (list bool) l1 yl))) *)
(* Goal: @eq (list bool) match l with | nil => l0 | cons b l => @nil bool end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 (@nil (list bool)))) *)
destruct l; simpl; trivial; case b; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match yl with | nil => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => @nil bool end | cons d l2 => match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => d end end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 (@cons (list bool) l1 yl))) *)
destruct yl; simpl; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 (@cons (list bool) l1 (@cons (list bool) l2 yl)))) *)
(* Goal: @eq (list bool) match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => @nil bool end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 (@cons (list bool) l1 (@nil (list bool))))) *)
destruct l; simpl; trivial; case b; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
(* Goal: @eq (list bool) match l with | nil => l0 | cons (true as b) l => l1 | cons (false as b) l => l2 end (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S (S O)))) vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) (S (S (S O))) vl (@nil bool)) l (@cons (list bool) l0 (@cons (list bool) l1 (@cons (list bool) l2 yl)))) *)
destruct l; simpl; trivial; case b; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham (Init.Nat.sub n O) s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) (Init.Nat.sub n O) (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
rewrite <- minus_n_O.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) (@hd (list bool) (@nil bool) xl) (@tl (list bool) xl) yl) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) (@app (list bool) xl yl)) (@tl (list bool) (@app (list bool) xl yl))) *)
destruct xl; simpl in *.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) l (@app (list bool) xl yl)) *)
(* Goal: @eq (list bool) (sem g (@nil (list bool)) yl) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) (@hd (list bool) (@nil bool) yl) (@tl (list bool) yl)) *)
discriminate.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) l (@app (list bool) xl yl)) *)
induction l; simpl.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (if a then sem h1 (@cons (list bool) l xl) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl) else sem h0 (@cons (list bool) l xl) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl)) (if a then Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1)) (@cons (list bool) l (@cons (list bool) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) l (@app (list bool) xl yl)) (@app (list bool) xl yl))) else Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0)) (@cons (list bool) l (@cons (list bool) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) l (@app (list bool) xl yl)) (@app (list bool) xl yl)))) *)
(* Goal: @eq (list bool) (sem g xl yl) (Sem (BC_to_Cobham n s g) (@app (list bool) xl yl)) *)
apply H2; auto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (if a then sem h1 (@cons (list bool) l xl) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl) else sem h0 (@cons (list bool) l xl) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl)) (if a then Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1)) (@cons (list bool) l (@cons (list bool) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) l (@app (list bool) xl yl)) (@app (list bool) xl yl))) else Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0)) (@cons (list bool) l (@cons (list bool) (sem_Rec (Sem (BC_to_Cobham n s g)) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0))) (Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1))) l (@app (list bool) xl yl)) (@app (list bool) xl yl)))) *)
rewrite <- IHl.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (if a then sem h1 (@cons (list bool) l xl) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl) else sem h0 (@cons (list bool) l xl) (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl)) (if a then Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1)) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl))) else Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0)) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) *)
rewrite H3, H4; simpl; auto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S n) (S s) h1) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl))) else Sem (BC_to_Cobham (S n) (S s) h0) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl)))) (if a then Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h1)) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl))) else Sem (move_arg (S (S (Init.Nat.add n s))) (S O) n (BC_to_Cobham (S n) (S s) h0)) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) *)
injection H5; intros; subst.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl)))) (if a then Sem (move_arg (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) (S O) (@length (list bool) xl) (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1)) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl))) else Sem (move_arg (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) (S O) (@length (list bool) xl) (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0)) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) *)
repeat rewrite move_arg_correct.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) yl)))) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl))))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))))) *)
set (r := sem_rec (sem g) (sem h0) (sem h1) l xl yl).
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl)))) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl)))))) *)
assert (l :: xl ++ r :: yl = move_forward 1 (length xl) (l :: r :: xl ++ yl) l) as Hmf.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl)))) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl)))))) *)
(* Goal: @eq (list (list bool)) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl))) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) l) *)
unfold move_forward; simpl; f_equal.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl)))) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl)))))) *)
(* Goal: @eq (list (list bool)) (@app (list bool) xl (@cons (list bool) r yl)) (@app (list bool) (@firstn (list bool) (@length (list bool) xl) (@app (list bool) xl yl)) (@cons (list bool) r (@skipn (list bool) (@length (list bool) xl) (@app (list bool) xl yl)))) *)
rewrite firstn_app, skipn_app; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@cons (list bool) l (@app (list bool) xl (@cons (list bool) r yl)))) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl)))))) *)
rewrite Hmf.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq (list bool) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) l) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) l)) (if a then Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h1) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))))) else Sem (BC_to_Cobham (S (@length (list bool) xl)) (S (@length (list bool) yl)) h0) (@move_forward (list bool) (S O) (@length (list bool) xl) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl))) (Sem (Proj (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) O) (@cons (list bool) l (@cons (list bool) r (@app (list bool) xl yl)))))) *)
case a; f_equal; simpl.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
simpl; rewrite app_length; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
(* Goal: @eq nat (@length (list bool) (@cons (list bool) l (@cons (list bool) (sem_rec (sem g) (sem h0) (sem h1) l xl yl) (@app (list bool) xl yl)))) (S (S (Init.Nat.add (@length (list bool) xl) (@length (list bool) yl)))) *)
simpl; rewrite app_length; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@app Cobham (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
rewrite map_app.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@map BC Cobham (fun e : BC => dummies n s (BC_to_Cobham n O e)) rl)) (@map Cobham (list bool) (fun e : Cobham => Sem e (@app (list bool) xl yl)) (@map BC Cobham (BC_to_Cobham n s) tl)))) *)
do 2 rewrite map_map.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
assert (HA : map (fun ne : BC => sem ne xl nil) rl = map (fun x : BC => Sem (dummies (length xl) (length yl) (BC_to_Cobham (length xl) 0 x)) (xl ++ yl)) rl).
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: @eq (list (list bool)) (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun x : BC => Sem (dummies (@length (list bool) xl) (@length (list bool) yl) (BC_to_Cobham (@length (list bool) xl) O x)) (@app (list bool) xl yl)) rl) *)
apply map_ext2.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: forall (a : BC) (_ : @In BC a rl), @eq (list bool) (sem a xl (@nil (list bool))) (Sem (dummies (@length (list bool) xl) (@length (list bool) yl) (BC_to_Cobham (@length (list bool) xl) O a)) (@app (list bool) xl yl)) *)
intros.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: @eq (list bool) (sem a xl (@nil (list bool))) (Sem (dummies (@length (list bool) xl) (@length (list bool) yl) (BC_to_Cobham (@length (list bool) xl) O a)) (@app (list bool) xl yl)) *)
rewrite dummies_correct.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: le (@length (list bool) xl) (@length (list bool) (@app (list bool) xl yl)) *)
(* Goal: @eq (list bool) (sem a xl (@nil (list bool))) (Sem (BC_to_Cobham (@length (list bool) xl) O a) (@firstn (list bool) (@length (list bool) xl) (@app (list bool) xl yl))) *)
erewrite H3; eauto.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: le (@length (list bool) xl) (@length (list bool) (@app (list bool) xl yl)) *)
(* Goal: @eq (list bool) (Sem (BC_to_Cobham n O a) (@app (list bool) xl (@nil (list bool)))) (Sem (BC_to_Cobham (@length (list bool) xl) O a) (@firstn (list bool) (@length (list bool) xl) (@app (list bool) xl yl))) *)
f_equal; subst; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: le (@length (list bool) xl) (@length (list bool) (@app (list bool) xl yl)) *)
(* Goal: @eq (list (list bool)) (@app (list bool) xl (@nil (list bool))) (@firstn (list bool) (@length (list bool) xl) (@app (list bool) xl yl)) *)
rewrite firstn_app.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: le (@length (list bool) xl) (@length (list bool) (@app (list bool) xl yl)) *)
(* Goal: @eq (list (list bool)) (@app (list bool) xl (@nil (list bool))) xl *)
apply app_nil_r.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: le (@length (list bool) xl) (@length (list bool) (@app (list bool) xl yl)) *)
rewrite app_length; omega.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
assert (map (fun se : BC => sem se xl yl) tl = map (fun x : BC => Sem (BC_to_Cobham (length xl) (length yl) x) (xl ++ yl)) tl).
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: @eq (list (list bool)) (@map BC (list bool) (fun se : BC => sem se xl yl) tl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham (@length (list bool) xl) (@length (list bool) yl) x) (@app (list bool) xl yl)) tl) *)
apply map_ext2; intros; subst.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
(* Goal: @eq (list bool) (sem a xl yl) (Sem (BC_to_Cobham (@length (list bool) xl) (@length (list bool) yl) a) (@app (list bool) xl yl)) *)
eapply H4; trivial.
(* Goal: @eq (list bool) (sem h (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) (Sem (BC_to_Cobham (@length BC rl) (@length BC tl) h) (@app (list bool) (@map BC (list bool) (fun x : BC => Sem (dummies n s (BC_to_Cobham n O x)) (@app (list bool) xl yl)) rl) (@map BC (list bool) (fun x : BC => Sem (BC_to_Cobham n s x) (@app (list bool) xl yl)) tl))) *)
rewrite H2, HA, H7; subst; trivial.
(* Goal: @eq nat (@length BC tl) (@length (list bool) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) *)
(* Goal: @eq nat (@length BC rl) (@length (list bool) (@map BC (list bool) (fun ne : BC => sem ne xl (@nil (list bool))) rl)) *)
rewrite map_length; trivial.
(* Goal: @eq nat (@length BC tl) (@length (list bool) (@map BC (list bool) (fun se : BC => sem se xl yl) tl)) *)
rewrite map_length; trivial.
Qed.
Lemma app_prop : forall {A} (l2 l1 : list A) (P : A -> Prop),
(fix f (l : list A) : Prop :=
match l with
| nil => True
| e :: l' => P e /\ f l'
end) l1 ->
(fix f (l : list A) : Prop :=
match l with
| nil => True
| e :: l' => P e /\ f l'
end) l2 ->
(fix f (l : list A) : Prop :=
match l with
| nil => True
| e :: l' => P e /\ f l'
end) (l1 ++ l2).
Proof.
(* Goal: forall (A : Type) (l2 l1 : list A) (P : forall _ : A, Prop) (_ : (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) l1) (_ : (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) l2), (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A l1 l2) *)
induction l2; intros; simpl; auto.
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A l1 (@cons A a l2)) *)
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A l1 (@nil A)) *)
simpl_list; auto.
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A l1 (@cons A a l2)) *)
replace (l1 ++ a :: l2) with ((l1 ++ [a]) ++ l2).
(* Goal: @eq (list A) (@app A (@app A l1 (@cons A a (@nil A))) l2) (@app A l1 (@cons A a l2)) *)
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A (@app A l1 (@cons A a (@nil A))) l2) *)
apply IHl2 with (P := P) (l1 := (l1 ++ [a])).
(* Goal: @eq (list A) (@app A (@app A l1 (@cons A a (@nil A))) l2) (@app A l1 (@cons A a l2)) *)
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) l2 *)
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A l1 (@cons A a (@nil A))) *)
induction l1; simpl.
(* Goal: @eq (list A) (@app A (@app A l1 (@cons A a (@nil A))) l2) (@app A l1 (@cons A a l2)) *)
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) l2 *)
(* Goal: and (P a0) ((fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A l1 (@cons A a (@nil A)))) *)
(* Goal: and (P a) True *)
tauto.
(* Goal: @eq (list A) (@app A (@app A l1 (@cons A a (@nil A))) l2) (@app A l1 (@cons A a l2)) *)
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) l2 *)
(* Goal: and (P a0) ((fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) (@app A l1 (@cons A a (@nil A)))) *)
tauto.
(* Goal: @eq (list A) (@app A (@app A l1 (@cons A a (@nil A))) l2) (@app A l1 (@cons A a l2)) *)
(* Goal: (fix f (l : list A) : Prop := match l with | nil => True | cons e l' => and (P e) (f l') end) l2 *)
tauto.
(* Goal: @eq (list A) (@app A (@app A l1 (@cons A a (@nil A))) l2) (@app A l1 (@cons A a l2)) *)
apply app_ass.
Qed.
Lemma plusl_monotonic : forall l (f1 f2 : nat -> nat),
(forall x, f1 x <= f2 x) ->
plusl (map f1 l) <= plusl (map f2 l).
Proof.
(* Goal: forall (l : list nat) (f1 f2 : forall _ : nat, nat) (_ : forall x : nat, le (f1 x) (f2 x)), le (plusl (@map nat nat f1 l)) (plusl (@map nat nat f2 l)) *)
induction l; simpl; intros.
(* Goal: le (Init.Nat.add (f1 a) (plusl (@map nat nat f1 l))) (Init.Nat.add (f2 a) (plusl (@map nat nat f2 l))) *)
(* Goal: le O O *)
trivial.
(* Goal: le (Init.Nat.add (f1 a) (plusl (@map nat nat f1 l))) (Init.Nat.add (f2 a) (plusl (@map nat nat f2 l))) *)
apply plus_le_compat.
(* Goal: le (plusl (@map nat nat f1 l)) (plusl (@map nat nat f2 l)) *)
(* Goal: le (f1 a) (f2 a) *)
apply H.
(* Goal: le (plusl (@map nat nat f1 l)) (plusl (@map nat nat f2 l)) *)
apply IHl.
(* Goal: forall x : nat, le (f1 x) (f2 x) *)
trivial.
Qed.
Lemma BC_to_Cobham_bounded : forall (e : BC) n s,
arities e = ok_arities n s ->
rec_bounded' (BC_to_Cobham n s e).
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Module_kernel.
Require Export Free_module.
Section Generated_module_def.
Variable R : RING.
Variable Mod : MODULE R.
Variable A : part_set Mod.
Definition generated_module : submodule Mod := coKer (FMd_lift (inj_part A)).
End Generated_module_def.
Lemma generated_module_minimal :
forall (R : RING) (Mod : MODULE R) (A : part_set Mod) (H : submodule Mod),
included A H -> included (generated_module A) H.
Proof.
(* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (H : @submodule R Mod) (_ : @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A (@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 H))))), @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@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 (@generated_module R Mod A))))) (@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 H)))) *)
unfold included in |- *.
(* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (H : @submodule R Mod) (_ : 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 A), @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 H))))) (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 (@generated_module R Mod A)))))), @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 H)))) *)
simpl in |- *.
(* Goal: forall (R : ring) (Mod : module R) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (H : @submodule R Mod) (_ : 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 A), @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 H))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0)))), @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 H)))) *)
intros R Mod A H H' x H'0; try assumption.
(* Goal: @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 H)))) *)
elim H'0; intros x0; clear H'0.
(* Goal: forall _ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0)), @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 H)))) *)
generalize x; clear x.
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0))), @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 H)))) *)
elim x0.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @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 H)))) *)
(* Goal: forall (c : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c)))), @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 H)))) *)
intros c; try assumption.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c)))), @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 H)))) *)
elim c.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @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 H)))) *)
(* Goal: forall (subtype_elt : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (subtype_prf : @Pred_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A subtype_elt) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A subtype_elt subtype_prf))))), @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 H)))) *)
simpl in |- *.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @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 H)))) *)
(* Goal: forall (subtype_elt : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @Pred_fun (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A subtype_elt) (x : 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 Mod))))) x subtype_elt)), @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 H)))) *)
intros y subtype_prf x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @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 H)))) *)
(* Goal: @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 H)))) *)
apply in_part_comp_l with y; auto with algebra.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (f0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f0))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Law R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f f0)))), @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 H)))) *)
intros f H'0 f0 H'1 x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: @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 H)))) *)
simpl in H'4.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
(* Goal: @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 H)))) *)
apply in_part_comp_l with (sgroup_law Mod (FMd_lift_fun (inj_part A) f) (FMd_lift_fun (inj_part A) f0)); auto with algebra.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (Unit R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))), @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 H)))) *)
simpl in |- *.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: forall (x : 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 Mod))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (monoid_on_def (group_monoid (abelian_group_group (@module_carrier R Mod))))))), @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 H)))) *)
intros x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
(* Goal: @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 H)))) *)
apply in_part_comp_l with (monoid_unit Mod); auto with algebra.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: forall (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Inv R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) f)))), @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 H)))) *)
intros f H'0 x H'1; try assumption.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: @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 H)))) *)
elim H'1; intros H'2 H'3; simpl in H'3; clear H'1.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
(* Goal: @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 H)))) *)
apply in_part_comp_l with (group_inverse Mod (FMd_lift_fun (inj_part A) f)); auto with algebra.
(* Goal: forall (c : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R)))))) (f : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (_ : forall (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) f))), @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 H))))) (x : 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 Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Op R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) c f)))), @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 H)))) *)
intros c f H'0 x H'1; try assumption.
(* Goal: @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 H)))) *)
simpl in H'1.
(* Goal: @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 H)))) *)
elim H'1; intros H'2 H'3; try exact H'3; clear H'1.
(* Goal: @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 H)))) *)
apply in_part_comp_l with (module_mult c (FMd_lift_fun (inj_part A) f)); auto with algebra.
Qed.
Lemma generated_module_prop_included :
forall (R : RING) (Mod : MODULE R) (A : part_set Mod),
included A (generated_module A).
Proof.
(* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))), @included (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A (@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 (@generated_module R Mod A))))) *)
unfold included in |- *.
(* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (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 A), @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 (@generated_module R Mod A))))) *)
simpl in |- *.
(* Goal: forall (R : ring) (Mod : module R) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (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 A), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0))) *)
intros R Mod A x H'; try assumption.
(* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x0 : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x0))) *)
exists (Var R (V:=A) (Build_subtype (E:=Mod) (P:=A) (subtype_elt:=x) H')); split; [ idtac | try assumption ].
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A x H'))) *)
(* Goal: True *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) (@Var R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A x H'))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) x x *)
auto with algebra.
Qed.
Lemma generated_module_prop :
forall (R : RING) (Mod : MODULE R) (A : part_set Mod) (y : Mod),
in_part y (generated_module A) ->
exists x : FMd R A, Equal y (FMd_lift (inj_part A) x).
Proof.
(* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (y : 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))))) y (@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 (@generated_module R Mod A)))))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))) (group_monoid (abelian_group_group (@module_carrier R Mod))) (@module_monoid_hom R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) Mod (@FMd_lift R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))) x)) *)
simpl in |- *; auto with algebra.
(* Goal: forall (R : ring) (Mod : module R) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x)))), @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x)) *)
intros R Mod A y H'; try assumption.
(* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x)) *)
elim H'; intros x E; elim E; intros H'0 H'1; try exact H'1; clear E H'.
(* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x)) *)
exists x; try assumption.
Qed.
Lemma generated_module_prop_rev :
forall (R : RING) (Mod : MODULE R) (A : part_set Mod) (y : Mod),
(exists x : FMd R A, Equal y (FMd_lift (inj_part A) x)) ->
in_part y (generated_module A).
Proof.
(* Goal: forall (R : Ob RING) (Mod : Ob (MODULE R)) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))))) (_ : @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@sgroup_map (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))))) (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod)))) (@monoid_sgroup_hom (group_monoid (abelian_group_group (@module_carrier R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)))))) (group_monoid (abelian_group_group (@module_carrier R Mod))) (@module_monoid_hom R (FreeModule R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) Mod (@FMd_lift R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))))) x))), @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@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 (@generated_module R Mod A))))) *)
intros R Mod A y H'; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@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 (@generated_module R Mod A))))) *)
elim H'; intros x E; try exact E; clear H'.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@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 (@generated_module R Mod A))))) *)
simpl in |- *; auto with algebra.
(* Goal: @ex (FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A))) (fun x : FMd R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) y (@FMd_lift_fun R (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) (@part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A)) Mod (@inj_part (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (@module_carrier R Mod))))) A) x))) *)
exists x; split; [ idtac | try assumption ].
(* Goal: True *)
auto with algebra.
Qed.
Hint Resolve generated_module_minimal generated_module_prop_included
generated_module_prop_rev: algebra.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export ZArith.
Require Export ZArith.
Require Export auxiliary.
Require Export ZArith_dec.
Require Export Zmisc.
Hint Resolve Zle_refl: algebra.
Require Export Ring_util.
Require Export Integral_domain_facts.
Definition Zr_aux : RING.
Proof.
(* Goal: Ob RING *)
apply (BUILD_RING (E:=Leibnitz_set BinInt.Z) (ringplus:=Zplus) (ringmult:=Zmult) (zero:=0%Z) (un:=1%Z) (ringopp:=Zopp)).
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add x' y') *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *)
(* Goal: forall (x x' y y' : Z) (_ : @eq Z x x') (_ : @eq Z y y'), @eq Z (Z.add x y) (Z.add x' y') *)
intros x x' y y' H' H'0; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *)
(* Goal: @eq Z (Z.add x y) (Z.add x' y') *)
rewrite H'0.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *)
(* Goal: @eq Z (Z.add x y') (Z.add x' y') *)
rewrite H'.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *)
(* Goal: @eq Z (Z.add x' y') (Z.add x' y') *)
auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *)
intros x y z; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: @Equal (Leibnitz_set Z) (Z.add (Z.add x y) z) (Z.add x (Z.add y z)) *)
apply Sym.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: @Equal (Leibnitz_set Z) (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: @eq Z (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) *)
generalize BinInt.Zplus_assoc.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: forall _ : forall n m p : Z, @eq Z (Z.add n (Z.add m p)) (Z.add (Z.add n m) p), @eq Z (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: @eq Z (Z.add x (Z.add y z)) (Z.add (Z.add x y) z) *)
rewrite (H' x y z).
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
(* Goal: @eq Z (Z.add (Z.add x y) z) (Z.add (Z.add x y) z) *)
auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x Z0) x *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall x : Z, @eq Z (Z.add x Z0) x *)
intros x; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: @eq Z (Z.add x Z0) x *)
generalize BinInt.Zplus_0_r.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: forall _ : forall n : Z, @eq Z (Z.add n Z0) n, @eq Z (Z.add x Z0) x *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
(* Goal: @eq Z (Z.add x Z0) x *)
rewrite (H' x); auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x y), @Equal (Leibnitz_set Z) (Z.opp x) (Z.opp y) *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: forall (x y : Z) (_ : @eq Z x y), @eq Z (Z.opp x) (Z.opp y) *)
intros x y H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
(* Goal: @eq Z (Z.opp x) (Z.opp y) *)
rewrite H'; auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x (Z.opp x)) Z0 *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall x : Z, @eq Z (Z.add x (Z.opp x)) Z0 *)
intros x; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: @eq Z (Z.add x (Z.opp x)) Z0 *)
generalize BinInt.Zplus_opp_r.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: forall _ : forall n : Z, @eq Z (Z.add n (Z.opp n)) Z0, @eq Z (Z.add x (Z.opp x)) Z0 *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
(* Goal: @eq Z (Z.add x (Z.opp x)) Z0 *)
rewrite (H' x); auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.add x y) (Z.add y x) *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall x y : Z, @eq Z (Z.add x y) (Z.add y x) *)
intros x y; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: @eq Z (Z.add x y) (Z.add y x) *)
generalize BinInt.Zplus_comm.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: forall _ : forall n m : Z, @eq Z (Z.add n m) (Z.add m n), @eq Z (Z.add x y) (Z.add y x) *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
(* Goal: @eq Z (Z.add x y) (Z.add y x) *)
rewrite (H' x y); auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Carrier (Leibnitz_set Z)) (_ : @Equal (Leibnitz_set Z) x x') (_ : @Equal (Leibnitz_set Z) y y'), @Equal (Leibnitz_set Z) (Z.mul x y) (Z.mul x' y') *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: forall (x x' y y' : Z) (_ : @eq Z x x') (_ : @eq Z y y'), @eq Z (Z.mul x y) (Z.mul x' y') *)
intros x x' y y' H' H'0; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: @eq Z (Z.mul x y) (Z.mul x' y') *)
rewrite H'0.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: @eq Z (Z.mul x y') (Z.mul x' y') *)
rewrite H'.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
(* Goal: @eq Z (Z.mul x' y') (Z.mul x' y') *)
auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall x y z : Z, @eq Z (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
intros x y z; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: @eq Z (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
generalize BinInt.Zmult_assoc.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: forall _ : forall n m p : Z, @eq Z (Z.mul n (Z.mul m p)) (Z.mul (Z.mul n m) p), @eq Z (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
(* Goal: @eq Z (Z.mul (Z.mul x y) z) (Z.mul x (Z.mul y z)) *)
rewrite (H' x y z); auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Zpos xH)) x *)
simpl in |- *.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall x : Z, @eq Z (Z.mul x (Zpos xH)) x *)
intros x; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: @eq Z (Z.mul x (Zpos xH)) x *)
generalize BinInt.Zmult_1_l.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: forall _ : forall n : Z, @eq Z (Z.mul (Zpos xH) n) n, @eq Z (Z.mul x (Zpos xH)) x *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: @eq Z (Z.mul x (Zpos xH)) x *)
replace (x * 1)%Z with (1 * x)%Z.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: @eq Z (Z.mul (Zpos xH) x) (Z.mul x (Zpos xH)) *)
(* Goal: @eq Z (Z.mul (Zpos xH) x) x *)
rewrite (H' x); auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
(* Goal: @eq Z (Z.mul (Zpos xH) x) (Z.mul x (Zpos xH)) *)
apply BinInt.Zmult_comm.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall x : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
intros x; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
generalize BinInt.Zmult_1_l.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: forall _ : forall n : Z, @eq Z (Z.mul (Zpos xH) n) n, @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
(* Goal: @Equal (Leibnitz_set Z) (Z.mul (Zpos xH) x) x *)
rewrite (H' x); auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
intros x y z; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
generalize BinInt.Zmult_plus_distr_r.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: forall _ : forall n m p : Z, @eq Z (Z.mul n (Z.add m p)) (Z.add (Z.mul n m) (Z.mul n p)), @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
intros H'; try assumption.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
(* Goal: @Equal (Leibnitz_set Z) (Z.mul x (Z.add y z)) (Z.add (Z.mul x y) (Z.mul x z)) *)
rewrite (H' x y z); auto with algebra.
(* Goal: forall x y z : Carrier (Leibnitz_set Z), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
intros x y z; try assumption.
(* Goal: @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
generalize BinInt.Zmult_plus_distr_l.
(* Goal: forall _ : forall n m p : Z, @eq Z (Z.mul (Z.add n m) p) (Z.add (Z.mul n p) (Z.mul m p)), @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
intros H'; try assumption.
(* Goal: @Equal (Leibnitz_set Z) (Z.mul (Z.add x y) z) (Z.add (Z.mul x z) (Z.mul y z)) *)
rewrite (H' x y z); auto with algebra.
Qed.
Definition Zr : CRING.
Proof.
(* Goal: Ob CRING *)
apply (Build_cring (cring_ring:=Zr_aux)).
(* Goal: cring_on Zr_aux *)
apply (Build_cring_on (R:=Zr_aux)).
(* Goal: @commutative (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (@sgroup_law_map (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (sgroup_on_def (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux)))))) *)
red in |- *.
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))), @Equal (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (@Ap (cart (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux)))))) (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (@sgroup_law_map (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (sgroup_on_def (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux)))))) (@couple (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) x y)) (@Ap (cart (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux)))))) (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (@sgroup_law_map (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (sgroup_on_def (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux)))))) (@couple (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) (sgroup_set (monoid_sgroup (@Build_monoid (@Build_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group Zr_aux))))) (@ring_mult_sgroup (ring_group Zr_aux) (ring_on_def Zr_aux))) (@ring_mult_monoid (ring_group Zr_aux) (ring_on_def Zr_aux))))) y x)) *)
simpl in |- *.
(* Goal: forall x y : Z, @eq Z (Z.mul x y) (Z.mul y x) *)
intros x y; try assumption.
(* Goal: @eq Z (Z.mul x y) (Z.mul y x) *)
generalize BinInt.Zmult_comm.
(* Goal: forall _ : forall n m : Z, @eq Z (Z.mul n m) (Z.mul m n), @eq Z (Z.mul x y) (Z.mul y x) *)
intros H'; try assumption.
(* Goal: @eq Z (Z.mul x y) (Z.mul y x) *)
rewrite (H' x y); auto with algebra.
Qed.
Definition Zzero_dec :
forall x : Zr, {Equal x (monoid_unit Zr)} + {~ Equal x (monoid_unit Zr)}.
Proof.
(* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))), sumbool (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) (not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) *)
simpl in |- *.
(* Goal: forall x : Z, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
intros x; try assumption.
(* Goal: sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
case (Z_eq_dec x 0).
(* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
(* Goal: forall _ : @eq Z x Z0, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
intros H'; try assumption.
(* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
(* Goal: sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
cut (x = 0%Z :>BinInt.Z).
(* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
(* Goal: @eq Z x Z0 *)
(* Goal: forall _ : @eq Z x Z0, sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
auto with algebra.
(* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
(* Goal: @eq Z x Z0 *)
rewrite H'.
(* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
(* Goal: @eq Z Z0 Z0 *)
auto with algebra.
(* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
intros H'; try assumption.
(* Goal: sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
cut (x <> 0%Z :>BinInt.Z).
(* Goal: not (@eq Z x Z0) *)
(* Goal: forall _ : not (@eq Z x Z0), sumbool (@eq Z x Z0) (not (@eq Z x Z0)) *)
auto with algebra.
(* Goal: not (@eq Z x Z0) *)
red in |- *.
(* Goal: forall _ : @eq Z x Z0, False *)
intros H'0; try assumption.
(* Goal: False *)
apply H'.
(* Goal: @eq Z x Z0 *)
rewrite H'0.
(* Goal: @eq Z Z0 Z0 *)
auto with algebra.
Qed.
Definition ZZ : INTEGRAL_DOMAIN.
Proof.
(* Goal: Ob INTEGRAL_DOMAIN *)
apply (Build_idomain (idomain_ring:=Zr)).
(* Goal: idomain_on Zr *)
apply Build_idomain_on.
(* Goal: idomain_prop Zr *)
red in |- *.
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *)
intros x y; try assumption.
(* Goal: forall (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) x (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))) (_ : not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) y (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))))), not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) x y) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring Zr))))))) *)
simpl in |- *.
(* Goal: forall (_ : not (@eq Z x Z0)) (_ : not (@eq Z y Z0)), not (@eq Z (@ring_mult Zr_aux x y) Z0) *)
generalize (BinInt.Zmult_integral_l x y).
(* Goal: forall (_ : forall (_ : not (@eq Z x Z0)) (_ : @eq Z (Z.mul y x) Z0), @eq Z y Z0) (_ : not (@eq Z x Z0)) (_ : not (@eq Z y Z0)), not (@eq Z (@ring_mult Zr_aux x y) Z0) *)
unfold not in |- *.
(* Goal: forall (_ : forall (_ : forall _ : @eq Z x Z0, False) (_ : @eq Z (Z.mul y x) Z0), @eq Z y Z0) (_ : forall _ : @eq Z x Z0, False) (_ : forall _ : @eq Z y Z0, False) (_ : @eq Z (@ring_mult Zr_aux x y) Z0), False *)
intros H' H'0 H'1 H'2; try assumption.
(* Goal: False *)
apply H'1.
(* Goal: @eq Z y Z0 *)
rewrite H'.
(* Goal: @eq Z (Z.mul y x) Z0 *)
(* Goal: forall _ : @eq Z x Z0, False *)
(* Goal: @eq Z Z0 Z0 *)
auto with algebra.
(* Goal: @eq Z (Z.mul y x) Z0 *)
(* Goal: forall _ : @eq Z x Z0, False *)
intros H'3; try assumption.
(* Goal: @eq Z (Z.mul y x) Z0 *)
(* Goal: False *)
apply H'0.
(* Goal: @eq Z (Z.mul y x) Z0 *)
(* Goal: @eq Z x Z0 *)
rewrite H'3.
(* Goal: @eq Z (Z.mul y x) Z0 *)
(* Goal: @eq Z Z0 Z0 *)
auto with algebra.
(* Goal: @eq Z (Z.mul y x) Z0 *)
rewrite <- H'2.
(* Goal: @eq Z (Z.mul y x) (@ring_mult Zr_aux x y) *)
change (Equal (ring_mult y x) (ring_mult x y)) in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring Zr)))))) (@ring_mult (cring_ring Zr) y x) (@ring_mult (cring_ring Zr) x y) *)
auto with algebra.
Qed.
|
Require Export GeoCoq.Elements.OriginalProofs.proposition_10.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma proposition_12 :
forall A B C,
nCol A B C ->
exists X, Perp_at C X A B X.
Proof.
(* Goal: forall (A B C : @Point Ax0) (_ : @nCol Ax0 A B C), @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
intros.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (~ eq B C).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
(* 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 *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (neq C B) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (~ eq A B).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
(* Goal: not (@eq Ax0 A B) *)
{
(* Goal: not (@eq Ax0 A B) *)
intro.
(* Goal: False *)
assert (Col A B C) by (conclude_def Col ).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
let Tf:=fresh in assert (Tf:exists E, (BetS C B E /\ Cong B E C B)) by (conclude lemma_extension);destruct Tf as [E];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (neq C E) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (neq E C) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
let Tf:=fresh in assert (Tf:exists F, (BetS E C F /\ Cong C F E C)) by (conclude lemma_extension);destruct Tf as [F];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong E C C E) by (conclude cn_equalityreverse).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C E C E) by (conclude cn_congruencereflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C F C E) by (conclude lemma_congruencetransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (BetS E B C) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (BetS E B F) by (conclude lemma_3_6b).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
let Tf:=fresh in assert (Tf:exists K, CI K C C E) by (conclude postulate_Euclid3);destruct Tf as [K];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C E C E) by (conclude cn_congruencereflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C B C B) by (conclude cn_congruencereflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (InCirc B K) by (conclude_def InCirc ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
let Tf:=fresh in assert (Tf:exists P Q, (Col A B P /\ BetS A B Q /\ OnCirc P K /\ OnCirc Q K /\ BetS P B Q)) by (conclude postulate_line_circle);destruct Tf as [P[Q]];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col A B Q) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C P C E) by (conclude axiom_circle_center_radius).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C Q C E) by (conclude axiom_circle_center_radius).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C E C Q) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong C P C Q) by (conclude lemma_congruencetransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong P C Q C) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (neq P Q) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
let Tf:=fresh in assert (Tf:exists M, (BetS P M Q /\ Cong M P M Q)) by (conclude proposition_10);destruct Tf as [M];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Cong P M Q M) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col P M Q) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col P B Q) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col P Q B) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col P Q M) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col Q B M) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col Q B A) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (neq B Q) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (neq Q B) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col B M A) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col A B M) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (~ eq M C).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
(* Goal: not (@eq Ax0 M C) *)
{
(* Goal: not (@eq Ax0 M C) *)
intro.
(* Goal: False *)
assert (Col A B C) by (conclude cn_equalitysub).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Per P M C) by (conclude_def Per ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (eq M M) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Col C M M) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
assert (Perp_at C M A B M) by (conclude_def Perp_at ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @Perp_at Ax0 C X A B X) *)
close.
Qed.
End Euclid.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCdistinct.
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCorder.
Require Export GeoCoq.Elements.OriginalProofs.lemma_NChelper.
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglesreflexive.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma proposition_13 :
forall A B C D,
BetS D B C -> nCol A B C ->
RT C B A A B D.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @BetS Ax0 D B C) (_ : @nCol Ax0 A B C), @RT Ax0 C B A A B D *)
intros.
(* Goal: @RT Ax0 C B A A B D *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: @RT Ax0 C B A A B D *)
assert (neq B A) by (forward_using lemma_NCdistinct).
(* Goal: @RT Ax0 C B A A B D *)
assert (Out B A A) by (conclude lemma_ray4).
(* Goal: @RT Ax0 C B A A B D *)
assert (BetS C B D) by (conclude axiom_betweennesssymmetry).
(* Goal: @RT Ax0 C B A A B D *)
assert (Supp C B A A D) by (conclude_def Supp ).
(* Goal: @RT Ax0 C B A A B D *)
assert (nCol C B A) by (forward_using lemma_NCorder).
(* Goal: @RT Ax0 C B A A B D *)
assert (Col D B C) by (conclude_def Col ).
(* Goal: @RT Ax0 C B A A B D *)
assert (Col C B D) by (forward_using lemma_collinearorder).
(* Goal: @RT Ax0 C B A A B D *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @RT Ax0 C B A A B D *)
assert (Col C B B) by (conclude_def Col ).
(* Goal: @RT Ax0 C B A A B D *)
assert (neq D B) by (forward_using lemma_betweennotequal).
(* Goal: @RT Ax0 C B A A B D *)
assert (nCol D B A) by (conclude lemma_NChelper).
(* Goal: @RT Ax0 C B A A B D *)
assert (nCol A B D) by (forward_using lemma_NCorder).
(* Goal: @RT Ax0 C B A A B D *)
assert (CongA A B D A B D) by (conclude lemma_equalanglesreflexive).
(* Goal: @RT Ax0 C B A A B D *)
assert (CongA C B A C B A) by (conclude lemma_equalanglesreflexive).
(* Goal: @RT Ax0 C B A A B D *)
assert (RT C B A A B D) by (conclude_def RT ).
(* Goal: @RT Ax0 C B A A B D *)
close.
Qed.
End Euclid. |
Module Import SetSyntax.
Notation "\sub%set" := (@le (display_set _) _) : abstract_set_scope.
Notation "\super%set" := (@ge (display_set _) _) : abstract_set_scope.
Notation "\proper%set" := (@lt (display_set _) _) : abstract_set_scope.
Notation "\superproper%set" := (@gt (display_set _) _) : abstract_set_scope.
Notation "\sub?%set" := (@leif (display_set _) _) : abstract_set_scope.
Notation "\subsets y" := (\super%set y) : abstract_set_scope.
Notation "\subsets y :> T" := (\subsets (y : T)) : abstract_set_scope.
Notation "\supersets y" := (\sub%set y) : abstract_set_scope.
Notation "\supersets y :> T" := (\supersets (y : T)) : abstract_set_scope.
Notation "\propersets y" := (\superproper%set y) : abstract_set_scope.
Notation "\propersets y :> T" := (\propersets (y : T)) : abstract_set_scope.
Notation "\superpropersets y" := (\proper%set y) : abstract_set_scope.
Notation "\superpropersets y :> T" := (\superpropersets (y : T)) : abstract_set_scope.
Notation "x \subset y" := (\sub%set x y) : abstract_set_scope.
Notation "x \subset y :> T" := ((x : T) \subset (y : T)) : abstract_set_scope.
Notation "x \proper y" := (\proper%set x y) : abstract_set_scope.
Notation "x \proper y :> T" := ((x : T) \proper (y : T)) : abstract_set_scope.
Notation "x \subset y \subset z" := ((x \subset y)%set && (y \subset z)%set) : abstract_set_scope.
Notation "x \proper y \subset z" := ((x \proper y)%set && (y \subset z)%set) : abstract_set_scope.
Notation "x \subset y \proper z" := ((x \subset y)%set && (y \proper z)%set) : abstract_set_scope.
Notation "x \proper y \proper z" := ((x \proper y)%set && (y \proper z)%set) : abstract_set_scope.
Notation "x \subset y ?= 'iff' C" := (\sub?%set x y C) : abstract_set_scope.
Notation "x \subset y ?= 'iff' C :> R" := ((x : R) \subset (y : R) ?= iff C)
(only parsing) : abstract_set_scope.
Notation set0 := (@bottom (display_set _) _).
Notation setT := (@top (display_set _) _).
Notation setU := (@join (display_set _) _).
Notation setI := (@meet (display_set _) _).
Notation setD := (@sub (display_set _) _).
Notation setC := (@compl (display_set _) _).
Notation "x :&: y" := (setI x y).
Notation "x :|: y" := (setU x y).
Notation "x :\: y" := (setD x y).
Notation "~: x" := (setC x).
Notation "x \subset y" := (\sub%set x y) : bool_scope.
Notation "x \proper y" := (\proper%set x y) : bool_scope.
End SetSyntax.
Ltac EqualityPack cT xclass xT :=
match type of Equality.Pack with
| forall sort : Type, Equality.mixin_of sort -> eqType =>
exact (@Equality.Pack cT xclass)
| _ =>
exact (@Equality.Pack cT xclass xT)
end.
Ltac ChoicePack cT xclass xT :=
match type of Choice.Pack with
| forall sort : Type, Choice.class_of sort -> choiceType =>
exact (@Choice.Pack cT xclass)
| _ =>
exact (@Choice.Pack cT xclass xT)
end.
Module Semiset.
Section ClassDef.
Variable elementType : Type.
Variable eqType_of_elementType : elementType -> eqType.
Coercion eqType_of_elementType : elementType >-> eqType.
Implicit Types (X Y : elementType).
Structure mixin_of d (set : elementType -> (cblatticeType (display_set d))) :=
Mixin {
memset : forall X, set X -> X -> bool;
set1 : forall X, X -> set X;
_ : forall X (x : X), ~~ memset set0 x;
_ : forall X (x y : X), memset (set1 y) x = (x == y);
_ : forall X (x : X) A, (set1 x \subset A) = (memset A x);
_ : forall X (A : set X), (set0 \proper A) -> {x | memset A x} ;
_ : forall X (A B : set X), {subset memset A <= memset B} -> A \subset B;
_ : forall X (x : X) A B, (memset (A :|: B) x) =
(memset A x) || (memset B x);
funsort : elementType -> elementType -> Type;
fun_of_funsort : forall X Y, funsort X Y -> X -> Y;
imset : forall X Y, funsort X Y -> set X -> set Y;
_ : forall X Y (f : funsort X Y) (A : set X) (y : Y),
reflect (exists2 x : X, memset A x & y = fun_of_funsort f x)
(memset (imset f A) y)
}.
Record class_of d (set : elementType -> Type) := Class {
base : forall X, @Order.CBLattice.class_of (display_set d) (set X);
mixin : mixin_of (fun X => Order.CBLattice.Pack (base X) (set X))
}.
Local Coercion base : class_of >-> Funclass.
Structure type d := Pack { sort ; _ : class_of d sort;
_ : elementType -> Type }.
Local Coercion sort : type >-> Funclass.
Variables (set : elementType -> Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c _ as cT' := cT return class_of _ cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' set c set.
Let xset := let: Pack set _ _ := cT in set.
Notation xclass := (class : class_of _ xset).
Definition pack b0
(m0 : mixin_of
(fun X=> @Order.CBLattice.Pack (display_set disp) (set X) (b0 X) (set X))) :=
fun bT b &
(forall X, phant_id (@Order.CBLattice.class (display_set disp) (bT X)) (b X)) =>
fun m & phant_id m0 m => Pack (@Class disp set b m) set.
End ClassDef.
Section CanonicalDef.
Variable elementType : Type.
Variable eqType_of_elementType : elementType -> eqType.
Coercion eqType_of_elementType : elementType >-> eqType.
Notation type := (type eqType_of_elementType).
Local Coercion base : class_of >-> Funclass.
Local Coercion sort : type >-> Funclass.
Variables (set : elementType -> Type) (X : elementType).
Variables (disp : unit) (cT : type disp).
Local Notation ddisp := (display_set disp).
Let xset := let: Pack set _ _ := cT in set.
Notation xclass := (@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset).
Definition eqType := ltac:(EqualityPack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)).
Definition choiceType := ltac:(ChoicePack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)).
Definition porderType :=
@Order.POrder.Pack ddisp (cT X) (xclass X) (xset X).
Definition latticeType :=
@Order.Lattice.Pack ddisp (cT X) (xclass X) (xset X).
Definition blatticeType :=
@Order.BLattice.Pack ddisp (cT X) (xclass X) (xset X).
Definition cblatticeType :=
@Order.CBLattice.Pack ddisp (cT X) (xclass X) (xset X).
End CanonicalDef.
Module Import Exports.
Coercion mixin : class_of >-> mixin_of.
Coercion base : class_of >-> Funclass.
Coercion sort : type >-> Funclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Coercion porderType : type >-> Order.POrder.type.
Coercion latticeType : type >-> Order.Lattice.type.
Coercion blatticeType : type >-> Order.BLattice.type.
Coercion cblatticeType : type >-> Order.CBLattice.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Canonical latticeType.
Canonical blatticeType.
Canonical cblatticeType.
Notation semisetType := type.
Notation semisetMixin := mixin_of.
Notation SemisetMixin := Mixin.
Notation SemisetType set m := (@pack _ _ set _ _ m _ _ (fun=> id) _ id).
Notation "[ 'semisetType' 'of' set 'for' cset ]" := (@clone _ _ set _ cset _ _ erefl id)
(at level 0, format "[ 'semisetType' 'of' set 'for' cset ]") : form_scope.
Notation "[ 'semisetType' 'of' set 'for' cset 'with' disp ]" :=
(@clone _ _ set _ cset disp _ (unit_irrelevance _ _) id)
(at level 0, format "[ 'semisetType' 'of' set 'for' cset 'with' disp ]") : form_scope.
Notation "[ 'semisetType' 'of' set ]" := [semisetType of set for _]
(at level 0, format "[ 'semisetType' 'of' set ]") : form_scope.
Notation "[ 'semisetType' 'of' set 'with' disp ]" := [semisetType of set for _ with disp]
(at level 0, format "[ 'semisetType' 'of' set 'with' disp ]") : form_scope.
End Exports.
End Semiset.
Import Semiset.Exports.
Section SemisetOperations.
Context {elementType : Type} {eqType_of_elementType : elementType -> eqType}.
Coercion eqType_of_elementType : elementType >-> eqType.
Context {disp : unit}.
Section setfun.
Variable (set : semisetType eqType_of_elementType disp).
Definition setfun := Semiset.funsort (Semiset.class set).
Definition fun_of_setfun X Y (f : setfun X Y) : X -> Y :=
@Semiset.fun_of_funsort _ _ _ _ (Semiset.class set) _ _ f.
Coercion fun_of_setfun : setfun >-> Funclass.
End setfun.
Context {set : semisetType eqType_of_elementType disp}.
Variable X Y : elementType.
Definition memset : set X -> X -> bool :=
@Semiset.memset _ _ _ _ (Semiset.class set) _.
Definition set1 : X -> set X :=
@Semiset.set1 _ _ _ _ (Semiset.class set) _.
Definition imset : setfun set X Y -> set X -> set Y:=
@Semiset.imset _ _ _ _ (Semiset.class set) _ _.
Canonical set_predType := Eval hnf in mkPredType memset.
Structure setpredType := SetPredType {
setpred_sort :> Type;
tosetpred : setpred_sort -> pred X;
_ : {mem : setpred_sort -> mem_pred X | isMem tosetpred mem};
_ : {pred_fset : setpred_sort -> set X |
forall p x, x \in pred_fset p = tosetpred p x}
}.
Canonical setpredType_predType (fpX : setpredType) :=
@PredType X (setpred_sort fpX) (@tosetpred fpX)
(let: SetPredType _ _ mem _ := fpX in mem).
Definition predset (fpX : setpredType) : fpX -> set X :=
let: SetPredType _ _ _ (exist pred_fset _) := fpX in pred_fset.
End SemisetOperations.
Module Import SemisetSyntax.
Notation "[ 'set' x : T | P ]" := (predset (fun x : T => P%B))
(at level 0, x at level 99, only parsing) : abstract_set_scope.
Notation "[ 'set' x | P ]" := [set x : _ | P]
(at level 0, x, P at level 99, format "[ 'set' x | P ]") : abstract_set_scope.
Notation "[ 'set' x 'in' A ]" := [set x | x \in A]
(at level 0, x at level 99, format "[ 'set' x 'in' A ]") : abstract_set_scope.
Notation "[ 'set' x : T 'in' A ]" := [set x : T | x \in A]
(at level 0, x at level 99, only parsing) : abstract_set_scope.
Notation "[ 'set' x : T | P & Q ]" := [set x : T | P && Q]
(at level 0, x at level 99, only parsing) : abstract_set_scope.
Notation "[ 'set' x | P & Q ]" := [set x | P && Q ]
(at level 0, x, P at level 99, format "[ 'set' x | P & Q ]") : abstract_set_scope.
Notation "[ 'set' x : T 'in' A | P ]" := [set x : T | x \in A & P]
(at level 0, x at level 99, only parsing) : abstract_set_scope.
Notation "[ 'set' x 'in' A | P ]" := [set x | x \in A & P]
(at level 0, x at level 99, format "[ 'set' x 'in' A | P ]") : abstract_set_scope.
Notation "[ 'set' x 'in' A | P & Q ]" := [set x in A | P && Q]
(at level 0, x at level 99,
format "[ 'set' x 'in' A | P & Q ]") : abstract_set_scope.
Notation "[ 'set' x : T 'in' A | P & Q ]" := [set x : T in A | P && Q]
(at level 0, x at level 99, only parsing) : abstract_set_scope.
Notation "[ 'set' a ]" := (set1 a)
(at level 0, a at level 99, format "[ 'set' a ]") : abstract_set_scope.
Notation "[ 'set' a : T ]" := [set (a : T)]
(at level 0, a at level 99, format "[ 'set' a : T ]") : abstract_set_scope.
Notation "a |: y" := ([set a] :|: y) : abstract_set_scope.
Notation "x :\ a" := (x :\: [set a]) : abstract_set_scope.
Notation "[ 'set' a1 ; a2 ; .. ; an ]" := (setU .. (a1 |: [set a2]) .. [set an]).
Notation "f @: A" := (imset f A) (at level 24) : abstract_set_scope.
End SemisetSyntax.
Module Import SemisetTheory.
Section SemisetTheory.
Variable elementType : Type.
Variable eqType_of_elementType : elementType -> eqType.
Coercion eqType_of_elementType : elementType >-> eqType.
Variable disp : unit.
Variable set : semisetType eqType_of_elementType disp.
Section setX.
Variables X : elementType.
Implicit Types (x y : X) (A B C : set X).
Lemma notin_set0 (x : X) : x \notin (set0 : set X).
Proof.
(* Goal: is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set) : @Semiset.sort elementType eqType_of_elementType disp set X)))) *)
rewrite /set1 /in_mem /= /memset.
(* Goal: is_true (negb (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) x)) *)
case: set => [S [base [memset set1 /= H ? ? ? ? ? ? ? ? ?]] ?] /=.
(* Goal: is_true (negb (memset X (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 H _e_ _e1_ _s_ _i_ _e2_ _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_))) x)) *)
exact: H.
Qed.
Lemma in_set1 x y : x \in ([set y] : set X) = (x == y).
Proof.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@set1 elementType eqType_of_elementType disp set X y : @Semiset.sort elementType eqType_of_elementType disp set X))) (@eq_op (eqType_of_elementType X) x y) *)
rewrite /set1 /in_mem /= /memset.
(* Goal: @eq bool (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X (@Semiset.set1 elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X y) x) (@eq_op (eqType_of_elementType X) x y) *)
case: set => [S [base [memset set1 /= ? H ? ? ? ? ? ? ? ?]] ?] /=.
(* Goal: @eq bool (memset X (set1 X y) x) (@eq_op (eqType_of_elementType X) x y) *)
exact: H.
Qed.
Lemma sub1set x A : ([set x] \subset A) = (x \in A).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *)
rewrite /set1 /in_mem /= /memset.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@Semiset.set1 elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X x) A) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x) *)
case: set A => [S [base [memset set1 /= ? ? H ? ? ? ? ? ? ?]] ?] A /=.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ H _s_ _i1_ _e1_ _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_)) (set1 X x) A) (memset X A x) *)
exact: H.
Qed.
Lemma set_gt0_ex A : set0 \proper A -> {x | x \in A}.
Proof.
(* Goal: forall _ : is_true (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A), @sig (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) *)
rewrite /set1 /in_mem /= /memset.
(* Goal: forall _ : is_true (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A), @sig (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) *)
case: set A => [S [base [memset set1 /= ? ? ? H ? ? ? ? ? ?]] ?] A /=.
(* Goal: forall _ : is_true (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ H _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_))) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ H _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_))) A), @sig (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) *)
exact: H.
Qed.
Lemma subsetP_subproof A B : {subset A <= B} -> A \subset B.
Proof.
(* Goal: forall _ : @sub_mem (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
rewrite /set1 /in_mem /= /memset.
(* Goal: forall _ : @sub_mem (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
case: set A B => [S [base [memset set1 /= ? ? ? ? H ? ? ? ? ?]] ?] /=.
(* Goal: forall (A B : S X) (_ : @sub_mem (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ H _e2_ _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_) X) A) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ H _e2_ _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_) X) B)), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ H _e2_ _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_)) A B) *)
exact: H.
Qed.
Lemma in_setU (x : X) A B : (x \in A :|: B) = (x \in A) || (x \in B).
Proof.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *)
rewrite /set1 /in_mem /= /memset.
(* Goal: @eq bool (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) x) (orb (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X B x)) *)
case: set A B => [S [base [memset set1 /= ? ? ? ? ? H ? ? ? ?]] ?] /=.
(* Goal: forall A B : S X, @eq bool (memset X (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ H _funsort_ _fun_of_funsort_ _imset_ _r_)) _T_)) A B) x) (orb (memset X A x) (memset X B x)) *)
exact: H.
Qed.
Lemma in_set0 x : x \in (set0 : set X) = false.
Proof.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set) : @Semiset.sort elementType eqType_of_elementType disp set X))) false *)
by rewrite (negPf (notin_set0 _)).
Qed.
Lemma subsetP {A B} : reflect {subset A <= B} (A <= B)%O.
Proof.
(* Goal: Bool.reflect (@sub_mem (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
apply: (iffP idP) => [sAB x xA|/subsetP_subproof//].
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)) *)
by rewrite -sub1set (le_trans _ sAB) // sub1set.
Qed.
Lemma setP A B : A =i B <-> A = B.
Proof.
(* Goal: iff (@eq_mem (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)) (@eq (@Semiset.sort elementType eqType_of_elementType disp set X) A B) *)
split=> [eqAB|->//]; apply/eqP; rewrite eq_le.
(* Goal: is_true (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A)) *)
gen have leAB : A B eqAB / A \subset B; last by rewrite !leAB.
(* Goal: is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
by apply/subsetP => x; rewrite eqAB.
Qed.
Lemma set1_neq0 (x : X) : [set x] != set0 :> set X.
Proof.
(* Goal: is_true (negb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x : @Semiset.sort elementType eqType_of_elementType disp set X) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set) : @Semiset.sort elementType eqType_of_elementType disp set X))) *)
by apply/negP=> /eqP /setP /(_ x); rewrite in_set0 in_set1 eqxx.
Qed.
Lemma set1_eq0 x : ([set x] == set0 :> set X) = false.
Proof.
(* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x : @Semiset.sort elementType eqType_of_elementType disp set X) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set) : @Semiset.sort elementType eqType_of_elementType disp set X)) false *)
by rewrite (negPf (set1_neq0 _)).
Qed.
Lemma set11 x : x \in ([set x] : set X).
Proof.
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@set1 elementType eqType_of_elementType disp set X x : @Semiset.sort elementType eqType_of_elementType disp set X))) *)
by rewrite -sub1set.
Qed.
Hint Resolve set11.
Lemma set1_inj : injective (@set1 _ _ _ set X).
Proof.
(* Goal: @injective (@Semiset.sort elementType eqType_of_elementType disp set X) (Equality.sort (eqType_of_elementType X)) (@set1 elementType eqType_of_elementType disp set X) *)
move=> x y /eqP; rewrite eq_le sub1set => /andP [].
(* Goal: forall (_ : is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@set1 elementType eqType_of_elementType disp set X y)))) (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X y) (@set1 elementType eqType_of_elementType disp set X x))), @eq (Equality.sort (eqType_of_elementType X)) x y *)
by rewrite in_set1 => /eqP.
Qed.
Lemma set_0Vmem A : (A = set0) + {x : X | x \in A}.
Proof.
(* Goal: sum (@eq (@Semiset.sort elementType eqType_of_elementType disp set X) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@sig (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *)
have [|AN0] := eqVneq A set0; [left|right] => //.
(* Goal: @sig (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) *)
by move: AN0; rewrite -lt0x => /set_gt0_ex.
Qed.
Lemma set0Pn A : reflect (exists x, x \in A) (A != set0).
Proof.
(* Goal: Bool.reflect (@ex (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) (negb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) *)
have [->|[x xA]] := set_0Vmem A; rewrite ?eqxx -?lt0x.
(* Goal: Bool.reflect (@ex (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) *)
(* Goal: Bool.reflect (@ex (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))))) (negb true) *)
by constructor=> [[x]]; rewrite in_set0.
(* Goal: Bool.reflect (@ex (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) *)
suff -> : set0 \proper A by constructor; exists x.
(* Goal: is_true (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) *)
by move: xA; rewrite -sub1set => /(lt_le_trans _)->; rewrite ?lt0x ?set1_eq0.
Qed.
Lemma subset1 A x : (A \subset [set x]) = (A == [set x]) || (A == set0).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)) (orb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) *)
symmetry; rewrite eq_le; have [] /= := boolP (A \subset [set x]); last first.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)), @eq bool (orb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) true *)
(* Goal: forall _ : is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x))), @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) false *)
by apply: contraNF => /eqP ->; rewrite ?le0x.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)), @eq bool (orb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) true *)
have [/eqP->|[y yA]] := set_0Vmem A; rewrite ?orbT // ?sub1set.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)), @eq bool (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) true *)
by move=> /subsetP /(_ _ yA); rewrite in_set1 => /eqP<-; rewrite yA.
Qed.
Lemma eq_set1 (x : X) A : (A == [set x]) = (set0 \proper A \subset [set x]).
Proof.
(* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)) (andb (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x))) *)
by rewrite subset1; have [->|?] := posxP A; rewrite 1?eq_sym ?set1_eq0 ?orbF.
Qed.
Lemma in_setI A B (x : X) : (x \in A :&: B) = (x \in A) && (x \in B).
Proof.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) (andb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *)
apply/idP/idP => [xAB|?]; last by rewrite -sub1set lexI !sub1set.
(* Goal: is_true (andb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *)
by rewrite (subsetP (leIr _ _) _ xAB) (subsetP (leIl _ _) _ xAB).
Qed.
Lemma set1U A x : [set x] :&: A = if x \in A then [set x] else set0.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A) (if @in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) then @set1 elementType eqType_of_elementType disp set X x else @bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) *)
apply/setP => y; rewrite (fun_if (fun E => y \in E)) in_setI in_set1 in_set0.
(* Goal: @eq bool (andb (@eq_op (eqType_of_elementType X) y x) (@in_mem (Equality.sort (eqType_of_elementType X)) y (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) (if @in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) then @eq_op (eqType_of_elementType X) y x else false) *)
by have [->|] := altP (y =P x); rewrite ?if_same //; case: (_ \in A).
Qed.
Lemma set1U_eq0 A x : ([set x] :&: A == set0) = (x \notin A).
Proof.
(* Goal: @eq bool (@eq_op (@Order.Lattice.eqType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) *)
by rewrite set1U; case: (x \in A); rewrite ?set1_eq0 ?eqxx.
Qed.
Lemma in_setD A B x : (x \in A :\: B) = (x \notin B) && (x \in A).
Definition inE := ((in_set0, in_set1, in_setU, in_setI, in_setD), inE).
Definition subset_trans B A C := (@le_trans _ _ B A C).
Definition proper_trans B A C := (@lt_trans _ _ B A C).
Definition sub_proper_trans B A C := (@le_lt_trans _ _ B A C).
Definition proper_sub_trans B A C := (@lt_le_trans _ _ B A C).
Definition proper_sub A B := (@ltW _ _ A B).
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 (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) (fun x : Equality.sort (eqType_of_elementType X) => is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))))) (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
apply: (iffP idP)=> [ltAB|[leAB [x xB xNA]]].
(* Goal: is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
(* Goal: and (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) (fun x : Equality.sort (eqType_of_elementType X) => is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))))) *)
rewrite ltW //; split => //; have := lt0B ltAB; rewrite lt0x.
(* Goal: is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
(* Goal: forall _ : is_true (negb (@eq_op (@Order.BLattice.eqType (display_set disp) (@Order.CBLattice.blatticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set))) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B A) (@bottom (display_set disp) (@Order.CBLattice.blatticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set))))), @ex2 (Equality.sort (eqType_of_elementType X)) (fun x0 : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x0 (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) (fun x0 : Equality.sort (eqType_of_elementType X) => is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x0 (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *)
by move => /set0Pn [x]; rewrite in_setD => /andP [xNA xB]; exists x.
(* Goal: is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
rewrite lt_neqAle leAB andbT; apply: contraTneq xNA.
(* Goal: forall _ : @eq (Equality.sort (@Order.POrder.eqType (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set))) A B, is_true (negb (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *)
by move=> /setP /(_ x) ->; rewrite xB.
Qed.
Lemma set1P x y : reflect (x = y) (x \in ([set y] : set X)).
Proof.
(* Goal: Bool.reflect (@eq (Equality.sort (eqType_of_elementType X)) x y) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@set1 elementType eqType_of_elementType disp set X y : @Semiset.sort elementType eqType_of_elementType disp set X))) *)
by rewrite in_set1; apply/eqP.
Qed.
Lemma subset_eqP A B : reflect (A =i B) (A \subset B \subset A)%set.
Proof.
(* Goal: Bool.reflect (@eq_mem (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A)) *)
apply: (iffP andP) => [[AB BA] x|eqAB]; first by apply/idP/idP; apply: subsetP.
(* Goal: and (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A)) *)
by split; apply/subsetP=> x; rewrite !eqAB.
Qed.
Lemma eqEsubset A B : (A == B) = (A \subset B) && (B \subset A).
Proof.
(* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A B) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A)) *)
exact: eq_le.
Qed.
Lemma properE A B : A \proper B = (A \subset B) && ~~ (B \subset A).
Proof.
(* Goal: @eq bool (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A))) *)
by case: comparableP.
Qed.
Lemma subEproper A B : A \subset B = (A == B) || (A \proper B).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (orb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A B) (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) *)
exact: le_eqVlt.
Qed.
Lemma eqVproper A B : A \subset B -> A = B \/ A \proper B.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), or (@eq (@Semiset.sort elementType eqType_of_elementType disp set X) A B) (is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) *)
by rewrite subEproper => /predU1P.
Qed.
Lemma properEneq A B : A \proper B = (A != B) && (A \subset B).
Proof.
(* Goal: @eq bool (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (andb (negb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A B)) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) *)
exact: lt_neqAle.
Qed.
Lemma proper_neq A B : A \proper B -> A != B.
Proof.
(* Goal: forall _ : is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (negb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A B)) *)
by rewrite properEneq; case/andP.
Qed.
Lemma eqEproper A B : (A == B) = (A \subset B) && ~~ (A \proper B).
Proof.
(* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A B) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (negb (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B))) *)
by case: comparableP.
Qed.
Lemma sub0set A : set0 \subset A.
Proof.
(* Goal: is_true (@le (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) *)
by apply/subsetP=> x; rewrite inE.
Qed.
Lemma subset0 A : (A \subset set0) = (A == set0).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *)
by rewrite eqEsubset sub0set andbT.
Qed.
Lemma proper0 A : (set0 \proper A) = (A != set0).
Proof.
(* Goal: @eq bool (@lt (display_set disp) (@Order.BLattice.porderType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) (negb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) *)
by rewrite properE sub0set subset0.
Qed.
Lemma subset_neq0 A B : A \subset B -> A != set0 -> B != set0.
Proof.
(* Goal: forall (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) (_ : is_true (negb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))))), is_true (negb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) B (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) *)
by rewrite -!proper0 => sAB /proper_sub_trans->.
Qed.
Lemma setU1r x a B : x \in B -> x \in a |: B.
Proof.
(* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) B))) *)
by move=> Bx; rewrite !inE predU1r.
Qed.
Lemma setU1P x a B : reflect (x = a \/ x \in B) (x \in a |: B).
Proof.
(* Goal: Bool.reflect (or (@eq (Equality.sort (eqType_of_elementType X)) x a) (is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)))) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) B))) *)
by rewrite !inE; apply: predU1P.
Qed.
Lemma set1Ul x A b : x \in A -> x \in A :|: [set b].
Proof.
(* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X b)))) *)
by move=> Ax; rewrite !inE Ax.
Qed.
Lemma set1Ur A b : b \in A :|: [set b].
Proof.
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) b (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X b)))) *)
by rewrite !inE eqxx orbT.
Qed.
Lemma setD1P x A b : reflect (x != b /\ x \in A) (x \in A :\ b).
Proof.
(* Goal: Bool.reflect (and (is_true (negb (@eq_op (eqType_of_elementType X) x b))) (is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X b)))) *)
by rewrite !inE; apply: andP.
Qed.
Lemma in_setD1 x A b : (x \in A :\ b) = (x != b) && (x \in A) .
Proof.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X b)))) (andb (negb (@eq_op (eqType_of_elementType X) x b)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) *)
by rewrite !inE.
Qed.
Lemma setD11 b A : (b \in A :\ b) = false.
Proof.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) b (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X b)))) false *)
by rewrite !inE eqxx.
Qed.
Lemma setD1K a A : a \in A -> a |: (A :\ a) = A.
Proof.
(* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType X)) a (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)), @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X a))) A *)
by move=> Aa; apply/setP=> x; rewrite !inE; case: eqP => // ->.
Qed.
Lemma setU1K a B : a \notin B -> (a |: B) :\ a = B.
Proof.
(* Goal: forall _ : is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) a (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))), @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) B) (@set1 elementType eqType_of_elementType disp set X a)) B *)
by move/negPf=> nBa; apply/setP=> x; rewrite !inE; case: eqP => // ->.
Qed.
Lemma set2P x a b : reflect (x = a \/ x = b) (x \in ([set a; b] : set X)).
Proof.
(* Goal: Bool.reflect (or (@eq (Equality.sort (eqType_of_elementType X)) x a) (@eq (Equality.sort (eqType_of_elementType X)) x b)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) (@set1 elementType eqType_of_elementType disp set X b) : @Semiset.sort elementType eqType_of_elementType disp set X))) *)
by rewrite !inE; apply: pred2P.
Qed.
Lemma in_set2 x a b : (x \in ([set a; b] : set X)) = (x == a) || (x == b).
Proof.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) (@set1 elementType eqType_of_elementType disp set X b) : @Semiset.sort elementType eqType_of_elementType disp set X))) (orb (@eq_op (eqType_of_elementType X) x a) (@eq_op (eqType_of_elementType X) x b)) *)
by rewrite !inE.
Qed.
Lemma set21 a b : a \in ([set a; b] : set X).
Proof.
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) a (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) (@set1 elementType eqType_of_elementType disp set X b) : @Semiset.sort elementType eqType_of_elementType disp set X))) *)
by rewrite !inE eqxx.
Qed.
Lemma set22 a b : b \in ([set a; b] : set X).
Proof.
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) b (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X a) (@set1 elementType eqType_of_elementType disp set X b) : @Semiset.sort elementType eqType_of_elementType disp set X))) *)
by rewrite !inE eqxx orbT.
Qed.
Lemma setUP x A B : reflect (x \in A \/ x \in B) (x \in A :|: B).
Proof.
(* Goal: Bool.reflect (or (is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) (is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)))) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) *)
by rewrite !inE; apply: orP.
Qed.
Lemma setUC A B : A :|: B = B :|: A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B A) *)
by apply/setP => x; rewrite !inE orbC.
Qed.
Lemma setUS A B C : A \subset B -> C :|: A \subset C :|: B.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C A) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C B)) *)
move=> sAB; apply/subsetP=> x; rewrite !inE.
(* Goal: forall _ : is_true (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) C)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))), is_true (orb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) C)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *)
by case: (x \in C) => //; apply: (subsetP sAB).
Qed.
Lemma setSU A B C : A \subset B -> A :|: C \subset B :|: C.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
by move=> sAB; rewrite -!(setUC C) setUS.
Qed.
Lemma setUSS A B C D : A \subset C -> B \subset D -> A :|: B \subset C :|: D.
Proof.
(* Goal: forall (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A C)) (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B D)), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C D)) *)
by move=> /(setSU B) /subset_trans sAC /(setUS C)/sAC.
Qed.
Lemma set0U A : set0 :|: A = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Order.BLattice.latticeType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@join (display_set disp) (@Order.BLattice.latticeType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) A *)
by apply/setP => x; rewrite !inE orFb.
Qed.
Lemma setU0 A : A :|: set0 = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) A *)
by rewrite setUC set0U.
Qed.
Lemma setUA A B C : A :|: (B :|: C) = A :|: B :|: C.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) *)
by apply/setP => x; rewrite !inE orbA.
Qed.
Lemma setUCA A B C : A :|: (B :|: C) = B :|: (A :|: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C)) *)
by rewrite !setUA (setUC B).
Qed.
Lemma setUAC A B C : A :|: B :|: C = A :|: C :|: B.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) B) *)
by rewrite -!setUA (setUC B).
Qed.
Lemma setUACA A B C D : (A :|: B) :|: (C :|: D) = (A :|: C) :|: (B :|: D).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C D)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B D)) *)
by rewrite -!setUA (setUCA B).
Qed.
Lemma setUid A : A :|: A = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A A) A *)
by apply/setP=> x; rewrite inE orbb.
Qed.
Lemma setUUl A B C : A :|: B :|: C = (A :|: C) :|: (B :|: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
by rewrite setUA !(setUAC _ C) -(setUA _ C) setUid.
Qed.
Lemma setUUr A B C : A :|: (B :|: C) = (A :|: B) :|: (A :|: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C)) *)
by rewrite !(setUC A) setUUl.
Qed.
Lemma setIP x A B : reflect (x \in A /\ x \in B) (x \in A :&: B).
Proof.
(* Goal: Bool.reflect (and (is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) (is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)))) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B))) *)
by rewrite !inE; apply: andP.
Qed.
Lemma setIC A B : A :&: B = B :&: A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B A) *)
by apply/setP => x; rewrite !inE andbC.
Qed.
Lemma setIS A B C : A \subset B -> C :&: A \subset C :&: B.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C A) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C B)) *)
move=> sAB; apply/subsetP=> x; rewrite !inE.
(* Goal: forall _ : is_true (andb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) C)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))), is_true (andb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) C)) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))) *)
by case: (x \in C) => //; apply: (subsetP sAB).
Qed.
Lemma setSI A B C : A \subset B -> A :&: C \subset B :&: C.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
by move=> sAB; rewrite -!(setIC C) setIS.
Qed.
Lemma setISS A B C D : A \subset C -> B \subset D -> A :&: B \subset C :&: D.
Proof.
(* Goal: forall (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A C)) (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B D)), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C D)) *)
by move=> /(setSI B) /subset_trans sAC /(setIS C) /sAC.
Qed.
Lemma set0I A : set0 :&: A = set0.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Order.BLattice.latticeType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@meet (display_set disp) (@Order.BLattice.latticeType (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) *)
by apply/setP => x; rewrite !inE andFb.
Qed.
Lemma setI0 A : A :&: set0 = set0.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)) *)
by rewrite setIC set0I.
Qed.
Lemma setIA A B C : A :&: (B :&: C) = A :&: B :&: C.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) *)
by apply/setP=> x; rewrite !inE andbA.
Qed.
Lemma setICA A B C : A :&: (B :&: C) = B :&: (A :&: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C)) *)
by rewrite !setIA (setIC A).
Qed.
Lemma setIAC A B C : A :&: B :&: C = A :&: C :&: B.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) B) *)
by rewrite -!setIA (setIC B).
Qed.
Lemma setIACA A B C D : (A :&: B) :&: (C :&: D) = (A :&: C) :&: (B :&: D).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) C D)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B D)) *)
by rewrite -!setIA (setICA B).
Qed.
Lemma setIid A : A :&: A = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A A) A *)
by apply/setP=> x; rewrite inE andbb.
Qed.
Lemma setIIl A B C : A :&: B :&: C = (A :&: C) :&: (B :&: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
by rewrite setIA !(setIAC _ C) -(setIA _ C) setIid.
Qed.
Lemma setIIr A B C : A :&: (B :&: C) = (A :&: B) :&: (A :&: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C)) *)
by rewrite !(setIC A) setIIl.
Qed.
Lemma setIUr A B C : A :&: (B :|: C) = (A :&: B) :|: (A :&: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C)) *)
by apply/setP=> x; rewrite !inE andb_orr.
Qed.
Lemma setIUl A B C : (A :|: B) :&: C = (A :&: C) :|: (B :&: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
by apply/setP=> x; rewrite !inE andb_orl.
Qed.
Lemma setUIr A B C : A :|: (B :&: C) = (A :|: B) :&: (A :|: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C)) *)
by apply/setP=> x; rewrite !inE orb_andr.
Qed.
Lemma setUIl A B C : (A :&: B) :|: C = (A :|: C) :&: (B :|: C).
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
by apply/setP=> x; rewrite !inE orb_andl.
Qed.
Lemma setUK A B : (A :|: B) :&: A = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A) A *)
by apply/setP=> x; rewrite !inE orbK.
Qed.
Lemma setKU A B : A :&: (B :|: A) = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B A)) A *)
by apply/setP=> x; rewrite !inE orKb.
Qed.
Lemma setIK A B : (A :&: B) :|: A = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A) A *)
by apply/setP=> x; rewrite !inE andbK.
Qed.
Lemma setKI A B : A :|: (B :&: A) = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B A)) A *)
by apply/setP=> x; rewrite !inE andKb.
Qed.
Lemma setDP A B x : reflect (x \in A /\ x \notin B) (x \in A :\: B).
Proof.
(* Goal: Bool.reflect (and (is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) (is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B))))) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B))) *)
by rewrite inE andbC; apply: andP.
Qed.
Lemma setSD A B C : A \subset B -> A :\: C \subset B :\: C.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A C) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B C)) *)
by move=> /subsetP AB; apply/subsetP => x; rewrite !inE => /andP[-> /AB].
Qed.
Lemma setDS A B C : A \subset B -> C :\: B \subset C :\: A.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B), is_true (@le (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) C B) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) C A)) *)
move=> /subsetP AB; apply/subsetP => x; rewrite !inE => /andP[].
(* Goal: forall (_ : is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)))) (_ : is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) C))), is_true (andb (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) C))) *)
by move=> /(contra (AB _)) ->.
Qed.
Lemma setDSS A B C D : A \subset C -> D \subset B -> A :\: B \subset C :\: D.
Proof.
(* Goal: forall (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A C)) (_ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) D B)), is_true (@le (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) C D)) *)
by move=> /(setSD B) /subset_trans sAC /(setDS C) /sAC.
Qed.
Lemma setD0 A : A :\: set0 = A.
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Order.CBLattice.blatticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)))) A *)
exact: subx0.
Qed.
Lemma set0D A : set0 :\: A = set0.
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) (@bottom (display_set disp) (@Order.CBLattice.blatticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set))) A) (@bottom (display_set disp) (@Order.CBLattice.blatticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set))) *)
exact: sub0x.
Qed.
Lemma setDv A : A :\: A = set0.
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A A) (@bottom (display_set disp) (@Order.CBLattice.blatticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set))) *)
exact: subxx.
Qed.
Lemma setID A B : A :&: B :|: A :\: B = A.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B)) A *)
exact: joinIB.
Qed.
Lemma setDUl A B C : (A :|: B) :\: C = (A :\: C) :|: (B :\: C).
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@join (display_set disp) (@Order.CBLattice.latticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A C) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B C)) *)
exact: subUx.
Qed.
Lemma setDUr A B C : A :\: (B :|: C) = (A :\: B) :&: (A :\: C).
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@meet (display_set disp) (@Order.CBLattice.latticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A C)) *)
exact: subxU.
Qed.
Lemma setDIl A B C : (A :&: B) :\: C = (A :\: C) :&: (B :\: C).
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) (@meet (display_set disp) (@Order.CBLattice.latticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A C) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B C)) *)
exact: subIx.
Qed.
Lemma setIDA A B C : A :&: (B :\: C) = (A :&: B) :\: C.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B C)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) *)
exact: meetxB.
Qed.
Lemma setIDAC A B C : (A :\: B) :&: C = (A :&: C) :\: B.
Proof.
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Order.CBLattice.latticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set))) (@meet (display_set disp) (@Order.CBLattice.latticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) C) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) B) *)
exact: meetBx.
Qed.
Lemma setDIr A B C : A :\: (B :&: C) = (A :\: B) :|: (A :\: C).
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (@join (display_set disp) (@Order.CBLattice.latticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A C)) *)
exact: subxI.
Qed.
Lemma setDDl A B C : (A :\: B) :\: C = A :\: (B :|: C).
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) C) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
exact: subBx.
Qed.
Lemma setDDr A B C : A :\: (B :\: C) = (A :\: B) :|: (A :&: C).
Proof.
(* Goal: @eq (@Order.CBLattice.sort (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B C)) (@join (display_set disp) (@Order.CBLattice.latticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C)) *)
exact: subxB.
Qed.
Lemma subsetIl A B : A :&: B \subset A.
Proof.
(* Goal: is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A) *)
by apply/subsetP=> x; rewrite inE; case/andP.
Qed.
Lemma subsetIr A B : A :&: B \subset B.
Proof.
(* Goal: is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) B) *)
by apply/subsetP=> x; rewrite inE; case/andP.
Qed.
Lemma subsetUl A B : A \subset A :|: B.
Proof.
(* Goal: is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B)) *)
by apply/subsetP=> x; rewrite inE => ->.
Qed.
Lemma subsetUr A B : B \subset A :|: B.
Proof.
(* Goal: is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B)) *)
by apply/subsetP=> x; rewrite inE orbC => ->.
Qed.
Lemma subsetU1 x A : A \subset x |: A.
Proof.
(* Goal: is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A)) *)
exact: subsetUr.
Qed.
Lemma subsetDl A B : A :\: B \subset A.
Proof.
(* Goal: is_true (@le (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) A) *)
exact: leBx.
Qed.
Lemma subD1set A x : A :\ x \subset A.
Proof.
(* Goal: is_true (@le (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)) A) *)
by rewrite subsetDl.
Qed.
Lemma setIidPl A B : reflect (A :&: B = A) (A \subset B).
Proof.
(* Goal: Bool.reflect (@eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
apply: (iffP subsetP) => [sAB | <- x /setIP[] //].
(* Goal: @eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A *)
by apply/setP=> x; rewrite inE; apply/andb_idr/sAB.
Qed.
Arguments setIidPl {A B}.
Lemma setIidPr A B : reflect (A :&: B = B) (B \subset A).
Proof.
(* Goal: Bool.reflect (@eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) B) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A) *)
by rewrite setIC; apply: setIidPl.
Qed.
Lemma setUidPl A B : reflect (A :|: B = A) (B \subset A).
Proof.
(* Goal: Bool.reflect (@eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A) *)
exact: join_idPr.
Qed.
Lemma setUidPr A B : reflect (A :|: B = B) (A \subset B).
Proof.
(* Goal: Bool.reflect (@eq (@Order.Lattice.sort (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) B) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
by rewrite setUC; apply: setUidPl.
Qed.
Lemma subIset A B C : (B \subset A) || (C \subset A) -> (B :&: C \subset A).
Proof.
(* Goal: forall _ : is_true (orb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) C A)), is_true (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C) A) *)
by case/orP; apply: subset_trans; rewrite (subsetIl, subsetIr).
Qed.
Lemma subsetI A B C : (A \subset B :&: C) = (A \subset B) && (A \subset C).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A C)) *)
rewrite !(sameP setIidPl eqP) setIA; have [-> //| ] := altP (A :&: B =P A).
(* Goal: forall _ : is_true (negb (@eq_op (@Order.Lattice.eqType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A)), @eq bool (@eq_op (@Order.Lattice.eqType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) A) (andb false (@eq_op (@Order.Lattice.eqType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A C) A)) *)
by apply: contraNF => /eqP <-; rewrite -setIA -setIIl setIAC.
Qed.
Lemma subsetIP A B C : reflect (A \subset B /\ A \subset C) (A \subset B :&: C).
Proof.
(* Goal: Bool.reflect (and (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A C))) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
by rewrite subsetI; apply: andP.
Qed.
Lemma subsetIidl A B : (A \subset A :&: B) = (A \subset B).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B)) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
by rewrite subsetI lexx.
Qed.
Lemma subsetIidr A B : (B \subset A :&: B) = (B \subset A).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B)) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A) *)
by rewrite setIC subsetIidl.
Qed.
Lemma subUset A B C : (B :|: C \subset A) = (B \subset A) && (C \subset A).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C) A) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) C A)) *)
exact: leUx.
Qed.
Lemma subsetU A B C : (A \subset B) || (A \subset C) -> A \subset B :|: C.
Proof.
(* Goal: forall _ : is_true (orb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A C)), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
exact: lexU.
Qed.
Lemma subUsetP A B C : reflect (A \subset C /\ B \subset C) (A :|: B \subset C).
Proof.
(* Goal: Bool.reflect (and (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A C)) (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B C))) (@le (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) C) *)
by rewrite subUset; apply: andP.
Qed.
Lemma subDset A B C : (A :\: B \subset C) = (A \subset B :|: C).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) C) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C)) *)
exact: leBLR.
Qed.
Lemma setU_eq0 A B : (A :|: B == set0) = (A == set0) && (B == set0).
Proof.
(* Goal: @eq bool (@eq_op (@Order.Lattice.eqType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (andb (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) B (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set)))) *)
by rewrite -!subset0 subUset.
Qed.
Lemma setD_eq0 A B : (A :\: B == set0) = (A \subset B).
Proof.
(* Goal: @eq bool (@eq_op (@Order.CBLattice.eqType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A B) (@bottom (display_set disp) (@Order.CBLattice.blatticeType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)))) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
by rewrite -subset0 subDset setU0.
Qed.
Lemma subsetD1 A B x : (A \subset B :\ x) = (A \subset B) && (x \notin A).
Proof.
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x))) (andb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)))) *)
rewrite andbC; have [xA|] //= := boolP (x \in A).
(* Goal: forall _ : is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))), @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x))) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
(* Goal: @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x))) false *)
by apply: contraTF isT => /subsetP /(_ x xA); rewrite !inE eqxx.
(* Goal: forall _ : is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))), @eq bool (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x))) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B) *)
move=> xNA; apply/subsetP/subsetP => sAB y yA.
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) y (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x)))) *)
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) y (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) B)) *)
by have:= sAB y yA; rewrite !inE => /andP[].
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) y (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x)))) *)
by rewrite !inE sAB // andbT; apply: contraNneq xNA => <-.
Qed.
Lemma subsetD1P A B x : reflect (A \subset B /\ x \notin A) (A \subset B :\ x).
Proof.
(* Goal: Bool.reflect (and (is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)) (is_true (negb (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))))) (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) B (@set1 elementType eqType_of_elementType disp set X x))) *)
by rewrite subsetD1; apply: andP.
Qed.
Lemma properD1 A x : x \in A -> A :\ x \proper A.
Proof.
(* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)), is_true (@lt (display_set disp) (@Order.CBLattice.porderType (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set)) (@sub (display_set disp) (@Semiset.cblatticeType elementType eqType_of_elementType X disp set) A (@set1 elementType eqType_of_elementType disp set X x)) A) *)
by move=> Ax; rewrite properE subsetDl /= subsetD1 Ax andbF.
Qed.
Lemma properIr A B : ~~ (B \subset A) -> A :&: B \proper B.
Proof.
(* Goal: forall _ : is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A)), is_true (@lt (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) B) *)
by move=> nsAB; rewrite properE subsetIr subsetI negb_and nsAB.
Qed.
Lemma properIl A B : ~~ (A \subset B) -> A :&: B \proper A.
Proof.
(* Goal: forall _ : is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)), is_true (@lt (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B) A) *)
by move=> nsBA; rewrite properE subsetIl subsetI negb_and nsBA orbT.
Qed.
Lemma properUr A B : ~~ (A \subset B) -> B \proper A :|: B.
Proof.
(* Goal: forall _ : is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A B)), is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B)) *)
by rewrite properE subsetUr subUset lexx /= andbT.
Qed.
Lemma properUl A B : ~~ (B \subset A) -> A \proper A :|: B.
Proof.
(* Goal: forall _ : is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A)), is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A (@join (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) A B)) *)
by move=> not_sBA; rewrite setUC properUr.
Qed.
Lemma proper1set A x : ([set x] \proper A) -> (x \in A).
Proof.
(* Goal: forall _ : is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) (@set1 elementType eqType_of_elementType disp set X x) A), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *)
by move/proper_sub; rewrite sub1set.
Qed.
Lemma properIset A B C : (B \proper A) || (C \proper A) -> (B :&: C \proper A).
Proof.
(* Goal: forall _ : is_true (orb (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) B A) (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) C A)), is_true (@lt (display_set disp) (@Order.Lattice.porderType (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set)) (@meet (display_set disp) (@Semiset.latticeType elementType eqType_of_elementType X disp set) B C) A) *)
by case/orP; apply: sub_proper_trans; rewrite (subsetIl, subsetIr).
Qed.
Lemma properI A B C : (A \proper B :&: C) -> (A \proper B) && (A \proper C).
Lemma properU A B C : (B :|: C \proper A) -> (B \proper A) && (C \proper A).
End setX.
Section setXY.
Variables X Y : elementType.
Implicit Types (x : X) (y : Y) (A : set X) (B : set Y) (f : setfun set X Y).
Lemma imsetP (f : setfun set X Y) A y :
reflect (exists2 x : X, x \in A & y = f x) (y \in imset f A).
Proof.
(* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A))) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@in_mem (Equality.sort (eqType_of_elementType Y)) y (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))) *)
move: A f; rewrite /set1 /in_mem /= /memset /imset /setfun.
(* Goal: forall (A : @Semiset.sort elementType eqType_of_elementType disp set X) (f : @Semiset.funsort elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y), Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x))) (@Semiset.memset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) Y (@Semiset.imset elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (@Semiset.sort elementType eqType_of_elementType disp set X) (@Semiset.base elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set) X) (@Semiset.sort elementType eqType_of_elementType disp set X)) (@Semiset.mixin elementType eqType_of_elementType disp (@Semiset.sort elementType eqType_of_elementType disp set) (@Semiset.class elementType eqType_of_elementType disp set)) X Y f A) y) *)
case: set => [S [base [memset set1 /= ? ? ? ? ? ? ? ? ? H]]] ? /= A f.
(* Goal: Bool.reflect (@ex2 (Equality.sort (eqType_of_elementType X)) (fun x : Equality.sort (eqType_of_elementType X) => is_true (memset X A x)) (fun x : Equality.sort (eqType_of_elementType X) => @eq (Equality.sort (eqType_of_elementType Y)) y (@fun_of_setfun elementType eqType_of_elementType disp (@Semiset.Pack elementType eqType_of_elementType disp S (@Semiset.Class elementType eqType_of_elementType disp S base (@Semiset.Mixin elementType eqType_of_elementType disp (fun X : elementType => @Order.CBLattice.Pack (display_set disp) (S X) (base X) (S X)) memset set1 _i_ _e_ _e1_ _s_ _i1_ _e2_ _funsort_ _fun_of_funsort_ _imset_ H)) _T_) X Y f x))) (memset Y (_imset_ X Y f A) y) *)
exact: H.
Qed.
Lemma mem_imset f A x : x \in A -> f x \in imset f A.
Proof.
(* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)), is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))) *)
by move=> Dx; apply/imsetP; exists x.
Qed.
Lemma imset0 f : imset f set0 = set0.
Proof.
(* Goal: @eq (@Semiset.sort elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set)) *)
apply/setP => y; rewrite in_set0.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType Y)) y (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))))) false *)
by apply/imsetP => [[x]]; rewrite in_set0.
Qed.
Lemma imset_eq0 f A : (imset f A == set0) = (A == set0).
Proof.
(* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) (@eq_op (@Semiset.eqType elementType eqType_of_elementType X disp set) A (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType X disp set))) *)
have [->|/set_gt0_ex [x xA]] := posxP A; first by rewrite imset0 eqxx.
(* Goal: @eq bool (@eq_op (@Semiset.eqType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@bottom (display_set disp) (@Semiset.blatticeType elementType eqType_of_elementType Y disp set))) false *)
by apply/set0Pn; exists (f x); rewrite mem_imset.
Qed.
Lemma imset_set1 f x : imset f [set x] = [set f x].
Proof.
(* Goal: @eq (@Semiset.sort elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f (@set1 elementType eqType_of_elementType disp set X x)) (@set1 elementType eqType_of_elementType disp set Y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x)) *)
apply/setP => y.
(* Goal: @eq bool (@in_mem (Equality.sort (eqType_of_elementType Y)) y (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f (@set1 elementType eqType_of_elementType disp set X x)))) (@in_mem (Equality.sort (eqType_of_elementType Y)) y (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@set1 elementType eqType_of_elementType disp set Y (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x)))) *)
by apply/imsetP/set1P=> [[x' /set1P-> //]| ->]; exists x; rewrite ?set11.
Qed.
Lemma imsetS f A A' : A \subset A' -> imset f A \subset imset f A'.
Proof.
(* Goal: forall _ : is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A'), is_true (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *)
move=> leAB; apply/subsetP => y /imsetP [x xA ->].
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A'))) *)
by rewrite mem_imset // (subsetP leAB).
Qed.
Lemma imset_proper f A A' :
{in A' &, injective f} -> A \proper A' -> imset f A \proper imset f A'.
Proof.
(* Goal: forall (_ : @prop_in2 (Equality.sort (eqType_of_elementType X)) (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A') (fun x1 x2 : Equality.sort (eqType_of_elementType X) => forall _ : @eq (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x1) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x2), @eq (Equality.sort (eqType_of_elementType X)) x1 x2) (inPhantom (@injective (Equality.sort (eqType_of_elementType Y)) (Equality.sort (eqType_of_elementType X)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f)))) (_ : is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType X disp set) A A')), is_true (@lt (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A) (@imset elementType eqType_of_elementType disp set X Y f A')) *)
move=> injf /properP[sAB [x Bx nAx]]; rewrite lt_leAnge imsetS //=.
(* Goal: is_true (negb (@le (display_set disp) (@Semiset.porderType elementType eqType_of_elementType Y disp set) (@imset elementType eqType_of_elementType disp set X Y f A') (@imset elementType eqType_of_elementType disp set X Y f A))) *)
apply: contra nAx => sfBA.
(* Goal: is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *)
have: f x \in imset f A by rewrite (subsetP sfBA) ?mem_imset.
(* Goal: forall _ : is_true (@in_mem (Equality.sort (eqType_of_elementType Y)) (@fun_of_setfun elementType eqType_of_elementType disp set X Y f x) (@mem (Equality.sort (eqType_of_elementType Y)) (@set_predType elementType eqType_of_elementType disp set Y) (@imset elementType eqType_of_elementType disp set X Y f A))), is_true (@in_mem (Equality.sort (eqType_of_elementType X)) x (@mem (Equality.sort (eqType_of_elementType X)) (@set_predType elementType eqType_of_elementType disp set X) A)) *)
by case/imsetP=> y Ay /injf-> //; apply: subsetP sAB y Ay.
Qed.
End setXY.
End SemisetTheory.
End SemisetTheory.
Module set.
Section ClassDef.
Variable elementType : Type.
Variable eqType_of_elementType : elementType -> eqType.
Coercion eqType_of_elementType : elementType >-> eqType.
Implicit Types (X Y : elementType).
Record class_of d (set : elementType -> Type) := Class {
base : forall X, Order.CTBLattice.class_of (display_set d) (set X);
mixin : Semiset.mixin_of eqType_of_elementType
(fun X => Order.CBLattice.Pack (base X) (set X))
}.
Local Coercion base : class_of >-> Funclass.
Definition base2 d (set : elementType -> Type)
(c : class_of d set) := Semiset.Class (@mixin _ set c).
Local Coercion base2 : class_of >-> Semiset.class_of.
Structure type d := Pack { sort ; _ : class_of d sort;
_ : elementType -> Type }.
Local Coercion sort : type >-> Funclass.
Variables (set : elementType -> Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c _ as cT' := cT return class_of _ cT' in c.
Let xset := let: Pack set _ _ := cT in set.
Notation xclass := (class : class_of xset).
Definition pack :=
fun bT (b : forall X, Order.CTBLattice.class_of _ _)
& (forall X, phant_id (@Order.CTBLattice.class disp (bT X)) (b X)) =>
fun mT m & phant_id (@Semiset.class _ eqType_of_elementType mT)
(@Semiset.Class _ _ disp set b m) =>
Pack (@Class _ set (fun x => b x) m) set.
End ClassDef.
Section CanonicalDef.
Variable elementType : Type.
Variable eqType_of_elementType : elementType -> eqType.
Coercion eqType_of_elementType : elementType >-> eqType.
Notation type := (type eqType_of_elementType).
Local Coercion sort : type >-> Funclass.
Local Coercion base : class_of >-> Funclass.
Local Coercion base2 : class_of >-> Semiset.class_of.
Variables (set : elementType -> Type) (X : elementType).
Variable (disp : unit) (cT : type disp).
Local Notation ddisp := (display_set disp).
Let xset := let: Pack set _ _ := cT in set.
Notation xclass := (@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset).
Definition eqType := ltac:(EqualityPack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)).
Definition choiceType := ltac:(ChoicePack (cT X) ((@class _ eqType_of_elementType _ cT : class_of eqType_of_elementType _ xset) X) (xset X)).
Definition porderType := @Order.POrder.Pack ddisp (cT X) (xclass X) (xset X).
Definition latticeType :=
@Order.Lattice.Pack ddisp (cT X) (xclass X) (xset X).
Definition blatticeType :=
@Order.BLattice.Pack ddisp (cT X) (xclass X) (xset X).
Definition cblatticeType :=
@Order.CBLattice.Pack ddisp (cT X) (xclass X) (xset X).
Definition ctblatticeType :=
@Order.CTBLattice.Pack ddisp (cT X) (xclass X) (xset X).
Definition semisetType := @Semiset.Pack _ _ disp cT xclass xset.
Definition semiset_ctblatticeType :=
@Order.CTBLattice.Pack ddisp (semisetType X) (xclass X) (xset X).
End CanonicalDef.
Module Import Exports.
Coercion base : class_of >-> Funclass.
Coercion base2 : class_of >-> Semiset.class_of.
Coercion sort : type >-> Funclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Coercion porderType : type >-> Order.POrder.type.
Coercion latticeType : type >-> Order.Lattice.type.
Coercion blatticeType : type >-> Order.BLattice.type.
Coercion cblatticeType : type >-> Order.CBLattice.type.
Coercion ctblatticeType : type >-> Order.CTBLattice.type.
Coercion semisetType : type >-> Semiset.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Canonical latticeType.
Canonical blatticeType.
Canonical cblatticeType.
Canonical ctblatticeType.
Canonical semisetType.
Notation setType := type.
Notation "[ 'setType' 'of' set ]" :=
(@pack _ _ set _ _ _ (fun=> id) _ _ id)
(at level 0, format "[ 'setType' 'of' set ]") : form_scope.
End Exports.
End set.
Import set.Exports.
Module Import setTheory.
Section setTheory.
Variable elementType : Type.
Variable eqType_of_elementType : elementType -> eqType.
Coercion eqType_of_elementType : elementType >-> eqType.
Variable disp : unit.
Variable set : setType eqType_of_elementType disp.
Section setX.
Variables X : elementType.
Implicit Types (x y : X) (A B : set X).
End setX.
End setTheory.
End setTheory.
Module Theory.
Export Semiset.Exports.
Export set.Exports.
Export SetSyntax.
Export SemisetSyntax.
Export SemisetTheory.
Export setTheory.
End Theory.
End SET. |
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearright.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_supplementofright :
forall A B C D F,
Supp A B C D F -> Per A B C ->
Per F B D /\ Per D B F.
Proof.
(* Goal: forall (A B C D F : @Point Ax0) (_ : @Supp Ax0 A B C D F) (_ : @Per Ax0 A B C), and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
intros.
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
assert ((Out B C D /\ BetS A B F)) by (conclude_def Supp ).
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
assert (Col A B F) by (conclude_def Col ).
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
assert (neq B F) by (forward_using lemma_betweennotequal).
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
assert (neq F B) by (conclude lemma_inequalitysymmetric).
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
assert (Per F B C) by (conclude lemma_collinearright).
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
assert (Per F B D) by (conclude lemma_8_3).
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
assert (Per D B F) by (conclude lemma_8_2).
(* Goal: and (@Per Ax0 F B D) (@Per Ax0 D B F) *)
close.
Qed.
End Euclid.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrbool ssrfun eqtype ssrnat seq path div choice.
From mathcomp
Require Import fintype tuple finfun bigop prime ssralg finalg zmodp poly.
From mathcomp
Require Import ssrnum ssrint rat polydiv intdiv algC matrix mxalgebra mxpoly.
From mathcomp
Require Import vector falgebra fieldext separable galois cyclotomic.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GRing.Theory Num.Theory.
Local Open Scope ring_scope.
Local Notation ZtoQ := (intr : int -> rat).
Local Notation ZtoC := (intr : int -> algC).
Local Notation QtoC := (ratr : rat -> algC).
Local Notation intrp := (map_poly intr).
Local Notation pZtoQ := (map_poly ZtoQ).
Local Notation pZtoC := (map_poly ZtoC).
Local Notation pQtoC := (map_poly ratr).
Local Hint Resolve (intr_inj : injective ZtoC) : core.
Local Notation QtoCm := [rmorphism of QtoC].
Lemma algC_PET (s : seq algC) :
{z | exists a : nat ^ size s, z = \sum_(i < size s) s`_i *+ a i
& exists ps, s = [seq (pQtoC p).[z] | p <- ps]}.
Canonical subfx_unitAlgType (F L : fieldType) iota (z : L) p :=
Eval hnf in [unitAlgType F of subFExtend iota z p].
Lemma num_field_exists (s : seq algC) :
{Qs : fieldExtType rat & {QsC : {rmorphism Qs -> algC}
& {s1 : seq Qs | map QsC s1 = s & <<1 & s1>>%VS = fullv}}}.
Definition in_Crat_span s x :=
exists a : rat ^ size s, x = \sum_i QtoC (a i) * s`_i.
Fact Crat_span_subproof s x : decidable (in_Crat_span s x).
Definition Crat_span s : pred algC := Crat_span_subproof s.
Lemma Crat_spanP s x : reflect (in_Crat_span s x) (x \in Crat_span s).
Proof.
(* Goal: Bool.reflect (in_Crat_span s x) (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span s))) *)
exact: sumboolP.
Qed.
Canonical Crat_span_keyed s := KeyedPred (Crat_span_key s).
Lemma mem_Crat_span s : {subset s <= Crat_span s}.
Proof.
(* Goal: @sub_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) s) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span s)) *)
move=> _ /(nthP 0)[ix ltxs <-]; pose i0 := Ordinal ltxs.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@nth (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s ix) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span s))) *)
apply/Crat_spanP; exists [ffun i => (i == i0)%:R].
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@nth (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s ix) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat (@FunFinfun.finfun (ordinal_finType (@size (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) s)) (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun i1 : Finite.sort (ordinal_finType (@size (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) s)) => @GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (nat_of_bool (@eq_op (Finite.eqType (ordinal_finType (@size (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) s))) i1 i0)))) i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))) *)
rewrite (bigD1 i0) //= ffunE eqxx // rmorph1 mul1r.
(* Goal: @eq Algebraics.Implementation.type (@nth Algebraics.Implementation.type (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s ix) (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@nth Algebraics.Implementation.type (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s ix) (@BigOp.bigop Algebraics.Implementation.type (ordinal (@size Algebraics.Implementation.type s)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (ordinal_finType (@size Algebraics.Implementation.type s))) (fun i : ordinal (@size Algebraics.Implementation.type s) => @BigBody Algebraics.Implementation.type (ordinal (@size Algebraics.Implementation.type s)) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (negb (@eq_op (Finite.eqType (ordinal_finType (@size Algebraics.Implementation.type s))) i i0)) (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) rat (@FunFinfun.finfun (ordinal_finType (@size Algebraics.Implementation.type s)) rat (fun i1 : ordinal (@size Algebraics.Implementation.type s) => @GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (nat_of_bool (@eq_op (Finite.eqType (ordinal_finType (@size Algebraics.Implementation.type s))) i1 i0)))) i)) (@nth Algebraics.Implementation.type (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size Algebraics.Implementation.type s) i)))))) *)
by rewrite big1 ?addr0 // => i; rewrite ffunE rmorph_nat mulr_natl => /negbTE->.
Qed.
Fact Crat_span_zmod_closed s : zmod_closed (Crat_span s).
Proof.
(* Goal: @GRing.zmod_closed Algebraics.Implementation.zmodType (Crat_span s) *)
split=> [|_ _ /Crat_spanP[x ->] /Crat_spanP[y ->]].
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat x i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))) (@GRing.opp Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat y i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (Crat_span s))) *)
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (Crat_span s))) *)
apply/Crat_spanP; exists 0.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat x i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))) (@GRing.opp Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat y i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (Crat_span s))) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero Algebraics.Implementation.zmodType) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat (GRing.zero (ffun_zmodType (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat_ZmodType)) i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))) *)
by apply/esym/big1=> i _; rewrite ffunE rmorph0 mul0r.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat x i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))) (@GRing.opp Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat y i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (Crat_span s))) *)
apply/Crat_spanP; exists (x - y); rewrite -sumrB; apply: eq_bigr => i _.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.add Algebraics.Implementation.zmodType (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat x i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))) (@GRing.opp Algebraics.Implementation.zmodType (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat y i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))))) (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat (@GRing.add (ffun_zmodType (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat_ZmodType) x (@GRing.opp (ffun_zmodType (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s)) rat_ZmodType) y)) i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) s) i))) *)
by rewrite -mulrBl -rmorphB !ffunE.
Qed.
Canonical Crat_span_opprPred s := OpprPred (Crat_span_zmod_closed s).
Canonical Crat_span_addrPred s := AddrPred (Crat_span_zmod_closed s).
Canonical Crat_span_zmodPred s := ZmodPred (Crat_span_zmod_closed s).
Section MoreAlgCaut.
Implicit Type rR : unitRingType.
Lemma alg_num_field (Qz : fieldExtType rat) a : a%:A = ratr a :> Qz.
Proof.
(* Goal: @eq (@FieldExt.sort rat_Ring (Phant rat) Qz) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz)) a (GRing.one (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz)))) (@ratr (@FieldExt.unitRingType rat_Ring (Phant rat) Qz) a) *)
by rewrite -in_algE fmorph_eq_rat.
Qed.
Lemma rmorphZ_num (Qz : fieldExtType rat) rR (f : {rmorphism Qz -> rR}) a x :
f (a *: x) = ratr a * f x.
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType rR))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qz) (GRing.UnitRing.ringType rR) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qz, GRing.UnitRing.sort rR)) f (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz)) a x)) (@GRing.mul (GRing.UnitRing.ringType rR) (@ratr rR a) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qz) (GRing.UnitRing.ringType rR) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qz, GRing.UnitRing.sort rR)) f x)) *)
by rewrite -mulr_algl rmorphM alg_num_field fmorph_rat.
Qed.
Lemma fmorph_numZ (Qz1 Qz2 : fieldExtType rat) (f : {rmorphism Qz1 -> Qz2}) :
scalable f.
Proof.
(* Goal: @GRing.Linear.mixin_of rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz1)) (@GRing.Zmodule.Pack (@GRing.Lmodule.sort rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz2))) (@GRing.Lmodule.base rat_Ring (@GRing.Lmodule.sort rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz2))) (@GRing.Lmodule.class rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz2))))) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qz2))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qz1) (@FieldExt.ringType rat_Ring (Phant rat) Qz2) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qz1, @FieldExt.sort rat_Ring (Phant rat) Qz2)) f) *)
by move=> a x; rewrite rmorphZ_num -alg_num_field mulr_algl.
Qed.
Definition NumLRmorphism Qz1 Qz2 f := AddLRMorphism (@fmorph_numZ Qz1 Qz2 f).
End MoreAlgCaut.
Section NumFieldProj.
Variables (Qn : fieldExtType rat) (QnC : {rmorphism Qn -> algC}).
Lemma Crat_spanZ b a : {in Crat_span b, forall x, ratr a * x \in Crat_span b}.
Proof.
(* Goal: @prop_in1 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span b)) (fun x : GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) => is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType a) x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span b)))) (inPhantom (forall x : GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType), is_true (@in_mem (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType a) x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span b))))) *)
move=> _ /Crat_spanP[a1 ->]; apply/Crat_spanP; exists [ffun i => a * a1 i].
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.mul (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType a) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b)) rat a1 i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b) i)))))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b)) rat (@FunFinfun.finfun (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b)) (GRing.Ring.sort rat_Ring) (fun i0 : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b)) => @GRing.mul rat_Ring a (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b)) rat a1 i0))) i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) b) i))))) *)
by rewrite mulr_sumr; apply: eq_bigr => i _; rewrite ffunE mulrA -rmorphM.
Qed.
Lemma Crat_spanM b : {in Crat & Crat_span b, forall a x, a * x \in Crat_span b}.
Proof.
(* Goal: @prop_in11 Algebraics.Implementation.type Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Crat) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span b)) (fun a x : GRing.Ring.sort Algebraics.Implementation.ringType => is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType a x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span b)))) (inPhantom (forall a x : GRing.Ring.sort Algebraics.Implementation.ringType, is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType a x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span b))))) *)
by move=> _ x /CratP[a ->]; apply: Crat_spanZ.
Qed.
Lemma num_field_proj : {CtoQn | CtoQn 0 = 0 & cancel QnC CtoQn}.
Proof.
(* Goal: @sig2 (forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (CtoQn (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn) *)
pose b := vbasis {:Qn}.
(* Goal: @sig2 (forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (CtoQn (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn) *)
have Qn_bC (u : {x | x \in Crat_span (map QnC b)}): {y | QnC y = sval u}.
(* Goal: @sig2 (forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (CtoQn (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn) *)
(* Goal: @sig (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC y) (@proj1_sig Algebraics.Implementation.type (fun x : Algebraics.Implementation.type => is_true (@in_mem Algebraics.Implementation.type x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span (@map (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@GRing.Lmodule.sort (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@FieldExt.vectType rat_Ring (Phant rat) Qn))) b)))))) u)) *)
case: u => _ /= /Crat_spanP/sig_eqW[a ->].
(* Goal: @sig2 (forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (CtoQn (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn) *)
(* Goal: @sig (@FieldExt.sort rat_Ring (Phant rat) Qn) (fun y : @FieldExt.sort rat_Ring (Phant rat) Qn => @eq Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC y) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))))) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (index_enum (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))))) (fun i : Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (Finite.sort (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))))) i (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType)) true (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))) rat a i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)) (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))) i)))))) *)
exists (\sum_i a i *: b`_i); rewrite rmorph_sum; apply: eq_bigr => i _.
(* Goal: @sig2 (forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (CtoQn (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn) *)
(* Goal: @eq Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : GRing.Ring.sort (@FieldExt.ringType rat_Ring (Phant rat) Qn), GRing.Ring.sort Algebraics.Implementation.ringType)) QnC (@GRing.scale rat_Ring (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@FieldExt.vectType rat_Ring (Phant rat) Qn)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))) (Choice.sort rat_choiceType) a i) (@nth (GRing.Zmodule.sort (@GRing.Lmodule.zmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@FieldExt.vectType rat_Ring (Phant rat) Qn)))) (GRing.zero (@GRing.Lmodule.zmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@FieldExt.vectType rat_Ring (Phant rat) Qn)))) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@GRing.Lmodule.sort (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@FieldExt.vectType rat_Ring (Phant rat) Qn))) b) (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))) i)))) (@GRing.mul Algebraics.Implementation.ringType (@ratr Algebraics.Implementation.unitRingType (@FunFinfun.fun_of_fin (exp_finIndexType (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))) rat a i)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)) (@nat_of_ord (@size (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))) i))) *)
by rewrite rmorphZ_num (nth_map 0) // -(size_map QnC).
(* Goal: @sig2 (forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (CtoQn (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn) *)
pose CtoQn x := oapp (fun u => sval (Qn_bC u)) 0 (insub x).
(* Goal: @sig2 (forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (CtoQn (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)))) (fun CtoQn : forall _ : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn) *)
suffices QnCK: cancel QnC CtoQn by exists CtoQn; rewrite // -(rmorph0 QnC).
(* Goal: @cancel (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) CtoQn *)
move=> x; rewrite /CtoQn insubT => /= [|Qn_x]; last first.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))))) *)
(* Goal: @eq (@FieldExt.sort rat_Ring (Phant rat) Qn) (@proj1_sig (@FieldExt.sort rat_Ring (Phant rat) Qn) (fun y : @FieldExt.sort rat_Ring (Phant rat) Qn => @eq Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC y) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC x)) (Qn_bC (@exist Algebraics.Implementation.type (fun x : Algebraics.Implementation.type => is_true (@in_mem Algebraics.Implementation.type x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC x) Qn_x))) x *)
by case: (Qn_bC _) => x1 /= /fmorph_inj.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Crat_span (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))))) *)
rewrite (coord_vbasis (memvf x)) rmorph_sum rpred_sum // => i _.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : GRing.Ring.sort (@FieldExt.ringType rat_Ring (Phant rat) Qn), GRing.Ring.sort Algebraics.Implementation.ringType)) QnC (@GRing.scale (GRing.Field.ringType rat_fieldType) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))) (@coord rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@dimv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@fullv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (@vbasis rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@fullv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) i x) (@nth (GRing.Zmodule.sort (@GRing.Lmodule.zmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) (GRing.zero (@GRing.Lmodule.zmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) (@tval (@dimv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@fullv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (@GRing.Lmodule.sort (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (@vbasis rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@fullv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) (@nat_of_ord (@dimv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@fullv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) i)))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (@unkey_pred (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Crat_span (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))) (@GRing.Pred.add_key Algebraics.Implementation.zmodType (Crat_span (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b))) (Crat_span_addrPred (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))) (Crat_span_keyed (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))))) *)
rewrite rmorphZ_num Crat_spanZ ?mem_Crat_span // -/b.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, GRing.UnitRing.sort Algebraics.Implementation.unitRingType)) QnC (@nth (GRing.Zmodule.sort (@GRing.Lmodule.zmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) (GRing.zero (@GRing.Lmodule.zmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) (@tval (@dimv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@fullv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (@GRing.Lmodule.sort (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) b) (@nat_of_ord (@dimv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@fullv rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) i))) (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@map (@FieldExt.sort rat_Ring (Phant rat) Qn) Algebraics.Implementation.type (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (@tval (@dimv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn) (@fullv rat_fieldType (@FieldExt.vectType rat_Ring (Phant rat) Qn))) (@FieldExt.sort rat_Ring (Phant rat) Qn) b)))) *)
by rewrite -tnth_nth -tnth_map mem_tnth.
Qed.
Lemma restrict_aut_to_num_field (nu : {rmorphism algC -> algC}) :
(forall x, exists y, nu (QnC x) = QnC y) ->
{nu0 : {lrmorphism Qn -> Qn} | {morph QnC : x / nu0 x >-> nu x}}.
Proof.
(* Goal: forall _ : forall x : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC y)), @sig (@GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn))) (fun nu0 : @GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) => @morphism_1 (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @GRing.LRMorphism.apply rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) nu0 x) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu x)) *)
move=> Qn_nu; pose nu0 x := sval (sig_eqW (Qn_nu x)).
(* Goal: @sig (@GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn))) (fun nu0 : @GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) => @morphism_1 (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @GRing.LRMorphism.apply rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) nu0 x) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu x)) *)
have QnC_nu0: {morph QnC : x / nu0 x >-> nu x}.
(* Goal: @sig (@GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn))) (fun nu0 : @GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) => @morphism_1 (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @GRing.LRMorphism.apply rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) nu0 x) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu x)) *)
(* Goal: @morphism_1 (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => nu0 x) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu x) *)
by rewrite /nu0 => x; case: (sig_eqW _).
(* Goal: @sig (@GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn))) (fun nu0 : @GRing.LRMorphism.map rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) => @morphism_1 (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) => @GRing.LRMorphism.apply rat_Ring (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn) (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@FieldExt.lalgType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) Qn))) (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, @FieldExt.sort rat_Ring (Phant rat) Qn)) nu0 x) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu x)) *)
suffices nu0M: rmorphism nu0 by exists (NumLRmorphism (RMorphism nu0M)).
(* Goal: @GRing.RMorphism.class_of (@FieldExt.ringType rat_Ring (Phant rat) Qn) (@FieldExt.ringType rat_Ring (Phant rat) Qn) nu0 *)
do 2?split=> [x y|]; apply: (fmorph_inj QnC); rewrite ?QnC_nu0 ?rmorph1 //.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC (@GRing.mul (@FieldExt.ringType rat_Ring (Phant rat) Qn) x y))) (@GRing.RMorphism.apply (GRing.Field.ringType (@FieldExt.fieldType rat_Ring (Phant rat) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : GRing.Field.sort (@FieldExt.fieldType rat_Ring (Phant rat) Qn), GRing.Ring.sort Algebraics.Implementation.ringType)) QnC (@GRing.mul (@FieldExt.ringType rat_Ring (Phant rat) Qn) (nu0 x) (nu0 y))) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC (@GRing.add (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) x (@GRing.opp (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) y)))) (@GRing.RMorphism.apply (GRing.Field.ringType (@FieldExt.fieldType rat_Ring (Phant rat) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : GRing.Field.sort (@FieldExt.fieldType rat_Ring (Phant rat) Qn), GRing.Ring.sort Algebraics.Implementation.ringType)) QnC (@GRing.add (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) (nu0 x) (@GRing.opp (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn)) (nu0 y)))) *)
by rewrite ?(rmorphB, QnC_nu0).
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC (@GRing.mul (@FieldExt.ringType rat_Ring (Phant rat) Qn) x y))) (@GRing.RMorphism.apply (GRing.Field.ringType (@FieldExt.fieldType rat_Ring (Phant rat) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : GRing.Field.sort (@FieldExt.fieldType rat_Ring (Phant rat) Qn), GRing.Ring.sort Algebraics.Implementation.ringType)) QnC (@GRing.mul (@FieldExt.ringType rat_Ring (Phant rat) Qn) (nu0 x) (nu0 y))) *)
by rewrite ?(rmorphM, QnC_nu0).
Qed.
Lemma map_Qnum_poly (nu : {rmorphism algC -> algC}) p :
p \in polyOver 1%VS -> map_poly (nu \o QnC) p = (map_poly QnC p).
Proof.
(* Goal: forall _ : is_true (@in_mem (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) p (@mem (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) (predPredType (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))))) (@has_quality (S O) (@poly_of (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (Phant (GRing.Ring.sort (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) (@polyOver (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (@pred_of_vspace rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (Phant (@Vector.sort (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (@vline rat_fieldType (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)) (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))))))), @eq (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@map_poly (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (@funcomp (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) tt (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC)) p) (@map_poly (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC) p) *)
move=> Qp; apply/polyP=> i; rewrite /= !coef_map /=.
(* Goal: @eq Algebraics.Implementation.type (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC (@nth (@FieldExt.sort rat_Ring (Phant rat) Qn) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@polyseq (@FieldExt.ringType rat_Ring (Phant rat) Qn) p) i))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC (@nth (@FieldExt.sort rat_Ring (Phant rat) Qn) (GRing.zero (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) Qn))) (@polyseq (@FieldExt.ringType rat_Ring (Phant rat) Qn) p) i)) *)
have /vlineP[a ->]: p`_i \in 1%VS by apply: polyOverP.
(* Goal: @eq Algebraics.Implementation.type (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC (@GRing.scale (GRing.Field.ringType rat_fieldType) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))) a (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn)))))) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) Qn, Algebraics.Implementation.type)) QnC (@GRing.scale (GRing.Field.ringType rat_fieldType) (@Vector.lmodType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@Falgebra.vectType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))) a (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) Qn))))) *)
by rewrite alg_num_field !fmorph_rat.
Qed.
End NumFieldProj.
Lemma restrict_aut_to_normal_num_field (Qn : splittingFieldType rat)
(QnC : {rmorphism Qn -> algC})(nu : {rmorphism algC -> algC}) :
{nu0 : {lrmorphism Qn -> Qn} | {morph QnC : x / nu0 x >-> nu x}}.
Proof.
(* Goal: @sig (@GRing.LRMorphism.map (GRing.Field.ringType rat_fieldType) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn) (@GRing.Lalgebra.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn)) (@GRing.scale (GRing.Field.ringType rat_fieldType) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn))) (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, @SplittingField.sort rat_fieldType (Phant rat) Qn))) (fun nu0 : @GRing.LRMorphism.map (GRing.Field.ringType rat_fieldType) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn) (@GRing.Lalgebra.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn)) (@GRing.scale (GRing.Field.ringType rat_fieldType) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn))) (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, @SplittingField.sort rat_fieldType (Phant rat) Qn)) => @morphism_1 (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn)) => @GRing.LRMorphism.apply (GRing.Field.ringType rat_fieldType) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn) (@GRing.Lalgebra.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn)) (@GRing.scale (GRing.Field.ringType rat_fieldType) (@GRing.Lalgebra.lmod_ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) (@SplittingField.lalgType rat_fieldType (Phant (GRing.Ring.sort (GRing.Field.ringType rat_fieldType))) Qn))) (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, @SplittingField.sort rat_fieldType (Phant rat) Qn)) nu0 x) (fun x : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu x)) *)
apply: restrict_aut_to_num_field => x.
(* Goal: @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
case: (splitting_field_normal 1%AS x) => rs /eqP Hrs.
(* Goal: @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
have: root (map_poly (nu \o QnC) (minPoly 1%AS x)) (nu (QnC x)).
(* Goal: forall _ : is_true (@root Algebraics.Implementation.ringType (@map_poly (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (@funcomp (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) tt (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC)) (@minPoly rat_fieldType (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn) (@asval rat_fieldType (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@aspace1 rat_fieldType (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) x)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x))), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
(* Goal: is_true (@root Algebraics.Implementation.ringType (@map_poly (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (@funcomp (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) tt (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC)) (@minPoly rat_fieldType (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn) (@asval rat_fieldType (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@aspace1 rat_fieldType (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) x)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x))) *)
by rewrite fmorph_root root_minPoly.
(* Goal: forall _ : is_true (@root Algebraics.Implementation.ringType (@map_poly (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (@funcomp (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) tt (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC)) (@minPoly rat_fieldType (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn) (@asval rat_fieldType (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) (@aspace1 rat_fieldType (@FieldExt.FalgType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) x)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x))), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
rewrite map_Qnum_poly ?minPolyOver // Hrs.
(* Goal: forall _ : is_true (@root Algebraics.Implementation.ringType (@map_poly (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn)) Algebraics.Implementation.ringType (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn), Algebraics.Implementation.type)) QnC) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (GRing.one (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) rs (fun y : GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)) => @BigBody (GRing.Ring.sort (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) y (@GRing.mul (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) true (@GRing.add (poly_zmodType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (polyX (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (@GRing.opp (poly_zmodType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (@polyC (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)) y)))))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x))), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
rewrite [map_poly _ _](_:_ = \prod_(y <- map QnC rs) ('X - y%:P)); last first.
(* Goal: forall _ : is_true (@root Algebraics.Implementation.ringType (@BigOp.bigop (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.one (poly_ringType Algebraics.Implementation.ringType)) (@map (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC) rs) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @BigBody (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) y (@GRing.mul (poly_ringType Algebraics.Implementation.ringType)) true (@GRing.add (poly_zmodType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) (@GRing.opp (poly_zmodType Algebraics.Implementation.ringType) (@polyC Algebraics.Implementation.ringType y))))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x))), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
(* Goal: @eq (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (@map_poly (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn)) Algebraics.Implementation.ringType (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn), Algebraics.Implementation.type)) QnC) (@BigOp.bigop (GRing.Ring.sort (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (GRing.one (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) rs (fun y : GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)) => @BigBody (GRing.Ring.sort (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) (GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) y (@GRing.mul (poly_ringType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)))) true (@GRing.add (poly_zmodType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (polyX (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (@GRing.opp (poly_zmodType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (@polyC (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)) y)))))) (@BigOp.bigop (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.one (poly_ringType Algebraics.Implementation.ringType)) (@map (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC) rs) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @BigBody (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) y (@GRing.mul (poly_ringType Algebraics.Implementation.ringType)) true (@GRing.add (poly_zmodType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) (@GRing.opp (poly_zmodType Algebraics.Implementation.ringType) (@polyC Algebraics.Implementation.ringType y))))) *)
rewrite big_map rmorph_prod; apply eq_bigr => i _.
(* Goal: forall _ : is_true (@root Algebraics.Implementation.ringType (@BigOp.bigop (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.one (poly_ringType Algebraics.Implementation.ringType)) (@map (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC) rs) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @BigBody (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) y (@GRing.mul (poly_ringType Algebraics.Implementation.ringType)) true (@GRing.add (poly_zmodType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) (@GRing.opp (poly_zmodType Algebraics.Implementation.ringType) (@polyC Algebraics.Implementation.ringType y))))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x))), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
(* Goal: @eq (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (poly_ringType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn))) (poly_ringType Algebraics.Implementation.ringType) (Phant (forall _ : GRing.Ring.sort (poly_ringType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn))), GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType))) (@map_poly_rmorphism (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant rat) Qn)) Algebraics.Implementation.ringType QnC) (@GRing.add (poly_zmodType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (polyX (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (@GRing.opp (poly_zmodType (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn))) (@polyC (@FieldExt.ringType (GRing.Field.ringType rat_fieldType) (Phant (GRing.Field.sort rat_fieldType)) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Field.sort rat_fieldType)) Qn)) i)))) (@GRing.add (poly_zmodType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) (@GRing.opp (poly_zmodType Algebraics.Implementation.ringType) (@polyC Algebraics.Implementation.ringType (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC i)))) *)
by rewrite rmorphB /= map_polyX map_polyC.
(* Goal: forall _ : is_true (@root Algebraics.Implementation.ringType (@BigOp.bigop (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.one (poly_ringType Algebraics.Implementation.ringType)) (@map (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC) rs) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType) => @BigBody (GRing.Ring.sort (poly_ringType Algebraics.Implementation.ringType)) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) y (@GRing.mul (poly_ringType Algebraics.Implementation.ringType)) true (@GRing.add (poly_zmodType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) (@GRing.opp (poly_zmodType Algebraics.Implementation.ringType) (@polyC Algebraics.Implementation.ringType y))))) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x))), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
rewrite root_prod_XsubC.
(* Goal: forall _ : is_true (@in_mem (GRing.IntegralDomain.sort Algebraics.Implementation.idomainType) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC x)) (@mem (Equality.sort (GRing.Ring.eqType (GRing.IntegralDomain.ringType Algebraics.Implementation.idomainType))) (seq_predType (GRing.Ring.eqType (GRing.IntegralDomain.ringType Algebraics.Implementation.idomainType))) (@map (GRing.Zmodule.sort (GRing.Ring.zmodType (@SplittingField.ringType rat_fieldType (Phant rat) Qn))) (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply (@SplittingField.ringType rat_fieldType (Phant rat) Qn) Algebraics.Implementation.ringType (Phant (forall _ : @SplittingField.sort rat_fieldType (Phant rat) Qn, Algebraics.Implementation.type)) QnC) rs))), @ex (GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)))) (fun y : GRing.Zmodule.sort (GRing.Ring.zmodType (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn))) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC x)) (@GRing.RMorphism.apply (@FieldExt.ringType rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn)) Algebraics.Implementation.ringType (Phant (forall _ : @FieldExt.sort rat_Ring (Phant rat) (@SplittingField.fieldExtType rat_fieldType (Phant (GRing.Ring.sort rat_Ring)) Qn), Algebraics.Implementation.type)) QnC y)) *)
by case/mapP => y _ ?; exists y.
Qed.
Lemma dec_Cint_span (V : vectType algC) m (s : m.-tuple V) v :
Definition Cint_span (s : seq algC) : pred algC :=
fun x => dec_Cint_span (in_tuple [seq \row_(i < 1) y | y <- s]) (\row_i x).
Canonical Cint_span_keyed s := KeyedPred (Cint_span_key s).
Lemma Cint_spanP n (s : n.-tuple algC) x :
Proof.
(* Goal: Bool.reflect (@inIntSpan Algebraics.Implementation.zmodType n s x) (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (Cint_span (@tval n Algebraics.Implementation.type s)))) *)
rewrite unfold_in; case: (dec_Cint_span _ _) => [Zs_x | Zs'x] /=.
(* Goal: Bool.reflect (@inIntSpan Algebraics.Implementation.zmodType n s x) false *)
(* Goal: Bool.reflect (@inIntSpan Algebraics.Implementation.zmodType n s x) true *)
left; have{Zs_x} [] := Zs_x; rewrite /= size_map size_tuple => a /rowP/(_ 0).
(* Goal: Bool.reflect (@inIntSpan Algebraics.Implementation.zmodType n s x) false *)
(* Goal: forall _ : @eq Algebraics.Implementation.type (@fun_of_matrix Algebraics.Implementation.type (S O) (S O) (@matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : ordinal (S O) => x)) (GRing.zero (Zp_zmodType O)) (GRing.zero (Zp_zmodType O))) (@fun_of_matrix Algebraics.Implementation.type (S O) (S O) (@BigOp.bigop (matrix Algebraics.Implementation.type (S O) (S O)) (ordinal n) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (matrix Algebraics.Implementation.type (S O) (S O)) (ordinal n) i (@GRing.add (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) true (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O))) (@nth (matrix Algebraics.Implementation.type (S O) (S O)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) (@map Algebraics.Implementation.type (matrix Algebraics.Implementation.type (S O) (S O)) (fun y : Algebraics.Implementation.type => @matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : ordinal (S O) => y)) (@tval n Algebraics.Implementation.type s)) (@nat_of_ord n i)) (@FunFinfun.fun_of_fin (exp_finIndexType n) int a i)))) (GRing.zero (Zp_zmodType O)) (GRing.zero (Zp_zmodType O))), @inIntSpan Algebraics.Implementation.zmodType n s x *)
rewrite !mxE => ->; exists a; rewrite summxE; apply: eq_bigr => i _.
(* Goal: Bool.reflect (@inIntSpan Algebraics.Implementation.zmodType n s x) false *)
(* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) (S O) (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O))) (@nth (matrix Algebraics.Implementation.type (S O) (S O)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) (@map Algebraics.Implementation.type (matrix Algebraics.Implementation.type (S O) (S O)) (fun y : Algebraics.Implementation.type => @matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : ordinal (S O) => y)) (@tval n Algebraics.Implementation.type s)) (@nat_of_ord n i)) (@FunFinfun.fun_of_fin (exp_finIndexType n) int a i)) (GRing.zero (Zp_zmodType O)) (GRing.zero (Zp_zmodType O))) (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval n (GRing.Zmodule.sort Algebraics.Implementation.zmodType) s) (@nat_of_ord n i)) (@FunFinfun.fun_of_fin (exp_finIndexType n) int a i)) *)
by rewrite -scaler_int (nth_map 0) ?size_tuple // !mxE mulrzl.
(* Goal: Bool.reflect (@inIntSpan Algebraics.Implementation.zmodType n s x) false *)
right=> [[a Dx]]; have{Zs'x} [] := Zs'x.
(* Goal: @inIntSpan (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O))) (@size (matrix Algebraics.Implementation.type (S O) (S O)) (@map Algebraics.Implementation.type (matrix Algebraics.Implementation.type (S O) (S O)) (fun y : Algebraics.Implementation.type => @matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : Finite.sort (ordinal_finType (S O)) => y)) (@tval n Algebraics.Implementation.type s))) (@in_tuple (matrix Algebraics.Implementation.type (S O) (S O)) (@map Algebraics.Implementation.type (matrix Algebraics.Implementation.type (S O) (S O)) (fun y : Algebraics.Implementation.type => @matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : Finite.sort (ordinal_finType (S O)) => y)) (@tval n Algebraics.Implementation.type s))) (@matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : Finite.sort (ordinal_finType (S O)) => x)) *)
rewrite /inIntSpan /= size_map size_tuple; exists a.
(* Goal: @eq (matrix Algebraics.Implementation.type (S O) (S O)) (@matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : ordinal (S O) => x)) (@BigOp.bigop (matrix Algebraics.Implementation.type (S O) (S O)) (ordinal n) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) (index_enum (ordinal_finType n)) (fun i : ordinal n => @BigBody (matrix Algebraics.Implementation.type (S O) (S O)) (ordinal n) i (@GRing.add (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) true (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O))) (@nth (matrix Algebraics.Implementation.type (S O) (S O)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) (@map Algebraics.Implementation.type (matrix Algebraics.Implementation.type (S O) (S O)) (fun y : Algebraics.Implementation.type => @matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : ordinal (S O) => y)) (@tval n Algebraics.Implementation.type s)) (@nat_of_ord n i)) (@FunFinfun.fun_of_fin (exp_finIndexType n) int a i)))) *)
apply/rowP=> i0; rewrite !mxE summxE Dx; apply: eq_bigr => i _.
(* Goal: @eq Algebraics.Implementation.type (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval n (GRing.Zmodule.sort Algebraics.Implementation.zmodType) s) (@nat_of_ord n i)) (@FunFinfun.fun_of_fin (exp_finIndexType n) int a i)) (@fun_of_matrix (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (S O) (S O) (@intmul (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O))) (@nth (matrix Algebraics.Implementation.type (S O) (S O)) (GRing.zero (@Vector.zmodType Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type) (matrix_vectType Algebraics.Implementation.ringType (S O) (S O)))) (@map Algebraics.Implementation.type (matrix Algebraics.Implementation.type (S O) (S O)) (fun y : Algebraics.Implementation.type => @matrix_of_fun Algebraics.Implementation.type (S O) (S O) matrix_key (fun _ _ : ordinal (S O) => y)) (@tval n Algebraics.Implementation.type s)) (@nat_of_ord n i)) (@FunFinfun.fun_of_fin (exp_finIndexType n) int a i)) (GRing.zero (Zp_zmodType O)) i0) *)
by rewrite -scaler_int mxE mulrzl (nth_map 0) ?size_tuple // !mxE.
Qed.
Lemma mem_Cint_span s : {subset s <= Cint_span s}.
Lemma Cint_span_zmod_closed s : zmod_closed (Cint_span s).
Proof.
(* Goal: @GRing.zmod_closed Algebraics.Implementation.zmodType (Cint_span s) *)
have sP := Cint_spanP (in_tuple s); split=> [|_ _ /sP[x ->] /sP[y ->]].
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (ordinal_finType (@size Algebraics.Implementation.type s))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (ordinal_finType (@size Algebraics.Implementation.type s))) (fun i : ordinal (@size Algebraics.Implementation.type s) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (ordinal (@size Algebraics.Implementation.type s)) i (@GRing.add Algebraics.Implementation.zmodType) true (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@size Algebraics.Implementation.type s) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@in_tuple Algebraics.Implementation.type s)) (@nat_of_ord (@size Algebraics.Implementation.type s) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) int x i)))) (@GRing.opp Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (ordinal_finType (@size Algebraics.Implementation.type s))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (ordinal_finType (@size Algebraics.Implementation.type s))) (fun i : ordinal (@size Algebraics.Implementation.type s) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (ordinal (@size Algebraics.Implementation.type s)) i (@GRing.add Algebraics.Implementation.zmodType) true (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@size Algebraics.Implementation.type s) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@in_tuple Algebraics.Implementation.type s)) (@nat_of_ord (@size Algebraics.Implementation.type s) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) int y i)))))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (Cint_span s))) *)
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (Cint_span s))) *)
by apply/sP; exists 0; rewrite big1 // => i; rewrite ffunE.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (ordinal_finType (@size Algebraics.Implementation.type s))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (ordinal_finType (@size Algebraics.Implementation.type s))) (fun i : ordinal (@size Algebraics.Implementation.type s) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (ordinal (@size Algebraics.Implementation.type s)) i (@GRing.add Algebraics.Implementation.zmodType) true (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@size Algebraics.Implementation.type s) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@in_tuple Algebraics.Implementation.type s)) (@nat_of_ord (@size Algebraics.Implementation.type s) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) int x i)))) (@GRing.opp Algebraics.Implementation.zmodType (@BigOp.bigop (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (Finite.sort (ordinal_finType (@size Algebraics.Implementation.type s))) (GRing.zero Algebraics.Implementation.zmodType) (index_enum (ordinal_finType (@size Algebraics.Implementation.type s))) (fun i : ordinal (@size Algebraics.Implementation.type s) => @BigBody (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (ordinal (@size Algebraics.Implementation.type s)) i (@GRing.add Algebraics.Implementation.zmodType) true (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@size Algebraics.Implementation.type s) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@in_tuple Algebraics.Implementation.type s)) (@nat_of_ord (@size Algebraics.Implementation.type s) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) int y i)))))) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (Cint_span s))) *)
apply/sP; exists (x - y); rewrite -sumrB; apply: eq_bigr => i _.
(* Goal: @eq (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@size Algebraics.Implementation.type s) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@in_tuple Algebraics.Implementation.type s)) (@nat_of_ord (@size Algebraics.Implementation.type s) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) int x i)) (@GRing.opp Algebraics.Implementation.zmodType (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@size Algebraics.Implementation.type s) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@in_tuple Algebraics.Implementation.type s)) (@nat_of_ord (@size Algebraics.Implementation.type s) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) int y i)))) (@intmul Algebraics.Implementation.zmodType (@nth (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@tval (@size Algebraics.Implementation.type s) (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@in_tuple Algebraics.Implementation.type s)) (@nat_of_ord (@size Algebraics.Implementation.type s) i)) (@FunFinfun.fun_of_fin (exp_finIndexType (@size Algebraics.Implementation.type s)) int (@GRing.add (ffun_zmodType (exp_finIndexType (@size Algebraics.Implementation.type s)) int_ZmodType) x (@GRing.opp (ffun_zmodType (exp_finIndexType (@size Algebraics.Implementation.type s)) int_ZmodType) y)) i)) *)
by rewrite !ffunE raddfB.
Qed.
Canonical Cint_span_opprPred s := OpprPred (Cint_span_zmod_closed s).
Canonical Cint_span_addrPred s := AddrPred (Cint_span_zmod_closed s).
Canonical Cint_span_zmodPred s := ZmodPred (Cint_span_zmod_closed s).
Lemma extend_algC_subfield_aut (Qs : fieldExtType rat)
(QsC : {rmorphism Qs -> algC}) (phi : {rmorphism Qs -> Qs}) :
{nu : {rmorphism algC -> algC} | {morph QsC : x / phi x >-> nu x}}.
Lemma Qn_aut_exists k n :
coprime k n ->
{u : {rmorphism algC -> algC} | forall z, z ^+ n = 1 -> u z = z ^+ k}.
Definition Aint : pred_class :=
fun x : algC => minCpoly x \is a polyOver Cint.
Canonical Aint_keyed := KeyedPred Aint_key.
Lemma root_monic_Aint p x :
root p x -> p \is monic -> p \is a polyOver Cint -> x \in Aint.
Proof.
(* Goal: forall (_ : is_true (@root Algebraics.Implementation.ringType p x)) (_ : is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) p (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality O (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@monic Algebraics.Implementation.ringType))))) (_ : is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) p (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint))))), is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
have pZtoQtoC pz: pQtoC (pZtoQ pz) = pZtoC pz.
(* Goal: forall (_ : is_true (@root Algebraics.Implementation.ringType p x)) (_ : is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) p (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality O (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@monic Algebraics.Implementation.ringType))))) (_ : is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) p (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint))))), is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
(* Goal: @eq (@poly_of (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (Phant (GRing.Ring.sort (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType)))) (@map_poly rat_Ring (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) pz)) (@map_poly int_Ring Algebraics.Implementation.ringType (@intmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType)) pz) *)
by rewrite -map_poly_comp; apply: eq_map_poly => b; rewrite /= rmorph_int.
(* Goal: forall (_ : is_true (@root Algebraics.Implementation.ringType p x)) (_ : is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) p (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality O (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@monic Algebraics.Implementation.ringType))))) (_ : is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) p (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint))))), is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
move=> px0 mon_p /floorCpP[pz Dp]; rewrite unfold_in.
(* Goal: is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (minCpoly x) (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
move: px0; rewrite Dp -pZtoQtoC; have [q [-> mon_q] ->] := minCpolyP x.
(* Goal: forall _ : is_true (Pdiv.Field.dvdp rat_iDomain q (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) pz)), is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@map_poly rat_Ring (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType) q) (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
case/dvdpP_rat_int=> qz [a nz_a Dq] [r].
(* Goal: forall _ : @eq (@poly_of int_Ring (Phant (GRing.Ring.sort int_Ring))) pz (@GRing.mul (poly_ringType int_Ring) qz r), is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@map_poly rat_Ring (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType) q) (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
move/(congr1 (fun q1 => lead_coef (a *: pZtoQ q1))).
(* Goal: forall _ : @eq (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (@lead_coef rat_Ring (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) pz))) (@lead_coef rat_Ring (@GRing.scale rat_Ring (poly_lmodType rat_Ring) a (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (@GRing.mul (poly_ringType int_Ring) qz r)))), is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@map_poly rat_Ring (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType) q) (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
rewrite rmorphM scalerAl -Dq lead_coefZ lead_coefM /=.
(* Goal: forall _ : @eq rat (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) a (@lead_coef (GRing.IntegralDomain.ringType rat_iDomain) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) pz))) (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) (@lead_coef (GRing.IntegralDomain.ringType rat_iDomain) q) (@lead_coef (GRing.IntegralDomain.ringType rat_iDomain) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) r))), is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@map_poly rat_Ring (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType) q) (@mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
have /monicP->: pZtoQ pz \is monic by rewrite -(map_monic QtoCm) pZtoQtoC -Dp.
(* Goal: forall _ : @eq rat (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) a (GRing.one rat_Ring)) (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) (@lead_coef (GRing.IntegralDomain.ringType rat_iDomain) q) (@lead_coef (GRing.IntegralDomain.ringType rat_iDomain) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) r))), is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@map_poly rat_Ring (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType) q) (@mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
rewrite (monicP mon_q) mul1r mulr1 lead_coef_map_inj //; last exact: intr_inj.
(* Goal: forall _ : @eq rat a (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@lead_coef int_Ring r)), is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@map_poly rat_Ring (GRing.UnitRing.ringType Algebraics.Implementation.unitRingType) (@ratr Algebraics.Implementation.unitRingType) q) (@mem (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant Algebraics.Implementation.type)) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
rewrite Dq => ->; apply/polyOverP=> i; rewrite !(coefZ, coef_map).
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.Additive.apply (GRing.Ring.zmodType rat_Ring) (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Phant (forall _ : GRing.Ring.sort rat_Ring, GRing.Ring.sort Algebraics.Implementation.ringType)) (ratr_additive Algebraics.Implementation.numFieldType) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@lead_coef int_Ring r)) (@GRing.Additive.apply (GRing.Ring.zmodType int_Ring) (GRing.Ring.zmodType rat_Ring) (Phant (forall _ : GRing.Ring.sort int_Ring, GRing.Ring.sort rat_Ring)) (@intmul_additive (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring qz) i)))) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) Cint (@GRing.Pred.add_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) Cint Cint_addrPred) Cint_keyed))) *)
by rewrite -rmorphM /= rmorph_int Cint_int.
Qed.
Lemma Cint_rat_Aint z : z \in Crat -> z \in Aint -> z \in Cint.
Proof.
(* Goal: forall (_ : is_true (@in_mem Algebraics.Implementation.type z (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Crat))) (_ : is_true (@in_mem Algebraics.Implementation.type z (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))), is_true (@in_mem Algebraics.Implementation.type z (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *)
case/CratP=> a ->{z} /polyOverP/(_ 0%N).
(* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (GRing.zero (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@polyseq Algebraics.Implementation.ringType (minCpoly (@ratr Algebraics.Implementation.unitRingType a))) O) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) Cint (@GRing.Pred.add_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) Cint Cint_addrPred) Cint_keyed))), is_true (@in_mem Algebraics.Implementation.type (@ratr Algebraics.Implementation.unitRingType a) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *)
have [p [Dp mon_p] dv_p] := minCpolyP (ratr a); rewrite Dp coef_map.
(* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.Additive.apply (GRing.Ring.zmodType rat_Ring) (GRing.Ring.zmodType Algebraics.Implementation.ringType) (Phant (forall _ : GRing.Ring.sort rat_Ring, GRing.Ring.sort Algebraics.Implementation.ringType)) (ratr_additive Algebraics.Implementation.numFieldType) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) O)) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) Cint (@GRing.Pred.add_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) Cint Cint_addrPred) Cint_keyed))), is_true (@in_mem Algebraics.Implementation.type (@ratr Algebraics.Implementation.unitRingType a) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *)
suffices /eqP->: p == 'X - a%:P by rewrite polyseqXsubC /= rmorphN rpredN.
(* Goal: is_true (@eq_op (poly_eqType rat_Ring) p (@GRing.add (poly_zmodType rat_Ring) (polyX rat_Ring) (@GRing.opp (poly_zmodType rat_Ring) (@polyC rat_Ring a)))) *)
rewrite -eqp_monic ?monicXsubC // irredp_XsubC //.
(* Goal: is_true (@dvdp rat_iDomain p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (polyX (GRing.IntegralDomain.ringType rat_iDomain)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (@polyC (GRing.IntegralDomain.ringType rat_iDomain) a)))) *)
(* Goal: is_true (negb (@eq_op nat_eqType (@size (GRing.Ring.sort (GRing.IntegralDomain.ringType rat_iDomain)) (@polyseq (GRing.IntegralDomain.ringType rat_iDomain) p)) (S O))) *)
by rewrite -(size_map_poly QtoCm) -Dp neq_ltn size_minCpoly orbT.
(* Goal: is_true (@dvdp rat_iDomain p (@GRing.add (poly_zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (polyX (GRing.IntegralDomain.ringType rat_iDomain)) (@GRing.opp (poly_zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (@polyC (GRing.IntegralDomain.ringType rat_iDomain) a)))) *)
by rewrite -dv_p fmorph_root root_XsubC.
Qed.
Lemma Aint_Cint : {subset Cint <= Aint}.
Proof.
(* Goal: @sub_mem Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) *)
move=> x; rewrite -polyOverXsubC.
(* Goal: forall _ : is_true (@in_mem (GRing.Zmodule.sort (poly_zmodType Algebraics.Implementation.ringType)) (@GRing.add (poly_zmodType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) (@GRing.opp (poly_zmodType Algebraics.Implementation.ringType) (@polyC Algebraics.Implementation.ringType x))) (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) Cint (@GRing.Pred.opp_key (GRing.Ring.zmodType Algebraics.Implementation.ringType) Cint (@GRing.Pred.zmod_opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) Cint (@GRing.Pred.subring_zmod Algebraics.Implementation.ringType Cint Cint_subringPred))) Cint_keyed))))), is_true (@in_mem Algebraics.Implementation.type x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
by apply: root_monic_Aint; rewrite ?monicXsubC ?root_XsubC.
Qed.
Lemma Aint_int x : x%:~R \in Aint.
Proof.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@intmul (GRing.Ring.zmodType Algebraics.Implementation.ringType) (GRing.one Algebraics.Implementation.ringType) x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
by rewrite Aint_Cint ?Cint_int.
Qed.
Lemma Aint0 : 0 \in Aint. Proof. exact: (Aint_int 0). Qed.
Proof.
(* Goal: is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (GRing.zero Algebraics.Implementation.zmodType) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
exact: (Aint_int 0).
Qed.
Hint Resolve Aint0 Aint1 : core.
Lemma Aint_unity_root n x : (n > 0)%N -> n.-unity_root x -> x \in Aint.
Proof.
(* Goal: forall (_ : is_true (leq (S O) n)) (_ : is_true (@root_of_unity Algebraics.Implementation.ringType n x)), is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
move=> n_gt0 xn1; apply: root_monic_Aint xn1 (monic_Xn_sub_1 _ n_gt0) _.
(* Goal: is_true (@in_mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@GRing.add (GRing.Ring.zmodType (poly_ringType Algebraics.Implementation.ringType)) (@GRing.exp (poly_ringType Algebraics.Implementation.ringType) (polyX Algebraics.Implementation.ringType) n) (@GRing.opp (GRing.Ring.zmodType (poly_ringType Algebraics.Implementation.ringType)) (GRing.one (poly_ringType Algebraics.Implementation.ringType)))) (@mem (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (predPredType (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType)))) (@has_quality (S O) (@poly_of Algebraics.Implementation.ringType (Phant (GRing.Ring.sort Algebraics.Implementation.ringType))) (@polyOver Algebraics.Implementation.ringType Cint)))) *)
by apply/polyOverP=> i; rewrite coefB coefC -mulrb coefXn /= rpredB ?rpred_nat.
Qed.
Lemma Aint_prim_root n z : n.-primitive_root z -> z \in Aint.
Lemma Aint_Cnat : {subset Cnat <= Aint}.
Proof.
(* Goal: @sub_mem Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cnat) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) *)
by move=> z /Cint_Cnat/Aint_Cint.
Qed.
Lemma Aint_subring_exists (X : seq algC) :
{subset X <= Aint} ->
{S : pred algC &
subring_closed S
/\ {subset X <= S}
& {Y : {n : nat & n.-tuple algC} &
Section AlgIntSubring.
Import DefaultKeying GRing.DefaultPred perm.
Theorem fin_Csubring_Aint S n (Y : n.-tuple algC) :
Corollary Aint_subring : subring_closed Aint.
Proof.
(* Goal: @GRing.subring_closed Algebraics.Implementation.ringType Aint *)
suff rAZ: {in Aint &, forall x y, (x - y \in Aint) * (x * y \in Aint)}.
(* Goal: @prop_in2 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun x y : GRing.Zmodule.sort Algebraics.Implementation.zmodType => prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)))) (inPhantom (forall x y : GRing.Zmodule.sort Algebraics.Implementation.zmodType, prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))))) *)
(* Goal: @GRing.subring_closed Algebraics.Implementation.ringType Aint *)
by split=> // x y AZx AZy; rewrite rAZ.
(* Goal: @prop_in2 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun x y : GRing.Zmodule.sort Algebraics.Implementation.zmodType => prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)))) (inPhantom (forall x y : GRing.Zmodule.sort Algebraics.Implementation.zmodType, prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))))) *)
move=> x y AZx AZy.
(* Goal: prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) *)
have [|S [ringS] ] := @Aint_subring_exists [:: x; y]; first exact/allP/and3P.
(* Goal: forall (_ : @sub_mem (Equality.sort Algebraics.Implementation.eqType) (@mem (Equality.sort Algebraics.Implementation.eqType) (seq_predType Algebraics.Implementation.eqType) (@cons Algebraics.Implementation.type x (@cons Algebraics.Implementation.type y (@nil Algebraics.Implementation.type)))) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) S)) (_ : @sigT2 (@sigT nat (fun n : nat => tuple_of n Algebraics.Implementation.type)) (fun Y : @sigT nat (fun n : nat => tuple_of n Algebraics.Implementation.type) => @sub_mem (Equality.sort Algebraics.Implementation.eqType) (@mem (Equality.sort Algebraics.Implementation.eqType) (tuple_predType (@tag nat (fun x : nat => tuple_of x Algebraics.Implementation.type) Y) Algebraics.Implementation.eqType) (@tagged nat (fun n : nat => tuple_of n Algebraics.Implementation.type) Y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) S)) (fun Y : @sigT nat (fun n : nat => tuple_of n Algebraics.Implementation.type) => forall x : GRing.Zmodule.sort Algebraics.Implementation.zmodType, Bool.reflect (@inIntSpan Algebraics.Implementation.zmodType (@tag nat (fun x0 : nat => tuple_of x0 Algebraics.Implementation.type) Y) (@tagged nat (fun n : nat => tuple_of n Algebraics.Implementation.type) Y) x) (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) S)))), prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) *)
move=> /allP/and3P[Sx Sy _] [Y _ genYS].
(* Goal: prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) *)
have AZ_S := fin_Csubring_Aint ringS genYS.
(* Goal: prod (is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x y) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) *)
by have [_ S_B S_M] := ringS; rewrite !AZ_S ?S_B ?S_M.
Qed.
Canonical Aint_opprPred := OpprPred Aint_subring.
Canonical Aint_addrPred := AddrPred Aint_subring.
Canonical Aint_mulrPred := MulrPred Aint_subring.
Canonical Aint_zmodPred := ZmodPred Aint_subring.
Canonical Aint_semiringPred := SemiringPred Aint_subring.
Canonical Aint_smulrPred := SmulrPred Aint_subring.
Canonical Aint_subringPred := SubringPred Aint_subring.
End AlgIntSubring.
Lemma Aint_aut (nu : {rmorphism algC -> algC}) x :
(nu x \in Aint) = (x \in Aint).
Proof.
(* Goal: @eq bool (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) (@GRing.RMorphism.apply Algebraics.Implementation.ringType Algebraics.Implementation.ringType (Phant (forall _ : Algebraics.Implementation.type, Algebraics.Implementation.type)) nu x) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)) x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
by rewrite !unfold_in minCpoly_aut.
Qed.
Definition dvdA (e : Algebraics.divisor) : pred_class :=
Canonical dvdA_keyed e := KeyedPred (dvdA_key e).
Delimit Scope algC_scope with A.
Delimit Scope algC_expanded_scope with Ax.
Notation "e %| x" := (x \in dvdA e) : algC_expanded_scope.
Notation "e %| x" := (@in_mem Algebraics.divisor x (mem (dvdA e))) : algC_scope.
Fact dvdA_zmod_closed e : zmod_closed (dvdA e).
Proof.
(* Goal: @GRing.zmod_closed Algebraics.Implementation.zmodType (dvdA e) *)
split=> [|x y]; first by rewrite unfold_in mul0r eqxx rpred0 ?if_same.
(* Goal: forall (_ : is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) x (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (dvdA e)))) (_ : is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) y (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (dvdA e)))), is_true (@in_mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@mem (GRing.Zmodule.sort Algebraics.Implementation.zmodType) (predPredType (GRing.Zmodule.sort Algebraics.Implementation.zmodType)) (dvdA e))) *)
rewrite ![(e %| _)%A]unfold_in.
(* Goal: forall (_ : is_true (if @eq_op Algebraics.Implementation.eqType e (GRing.zero Algebraics.Implementation.zmodType) then @eq_op Algebraics.Implementation.eqType x (GRing.zero Algebraics.Implementation.zmodType) else @in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (_ : is_true (if @eq_op Algebraics.Implementation.eqType e (GRing.zero Algebraics.Implementation.zmodType) then @eq_op Algebraics.Implementation.eqType y (GRing.zero Algebraics.Implementation.zmodType) else @in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType y (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))), is_true (if @eq_op Algebraics.Implementation.eqType e (GRing.zero Algebraics.Implementation.zmodType) then @eq_op Algebraics.Implementation.eqType (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (GRing.zero Algebraics.Implementation.zmodType) else @in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
case: ifP => [_ x0 /eqP-> | _]; first by rewrite subr0.
(* Goal: forall (_ : is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))) (_ : is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType y (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint))), is_true (@in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
by rewrite mulrBl; apply: rpredB.
Qed.
Canonical dvdA_opprPred e := OpprPred (dvdA_zmod_closed e).
Canonical dvdA_addrPred e := AddrPred (dvdA_zmod_closed e).
Canonical dvdA_zmodPred e := ZmodPred (dvdA_zmod_closed e).
Definition eqAmod (e x y : Algebraics.divisor) := (e %| x - y)%A.
Notation "x == y %[mod e ]" := (eqAmod e x y) : algC_scope.
Notation "x != y %[mod e ]" := (~~ (eqAmod e x y)) : algC_scope.
Lemma eqAmod_refl e x : (x == x %[mod e])%A.
Proof.
(* Goal: is_true (eqAmod e x x) *)
by rewrite /eqAmod subrr rpred0.
Qed.
Hint Resolve eqAmod_refl : core.
Lemma eqAmod_sym e x y : ((x == y %[mod e]) = (y == x %[mod e]))%A.
Proof.
(* Goal: @eq bool (eqAmod e x y) (eqAmod e y x) *)
by rewrite /eqAmod -opprB rpredN.
Qed.
Lemma eqAmod_trans e y x z :
(x == y %[mod e] -> y == z %[mod e] -> x == z %[mod e])%A.
Proof.
(* Goal: forall (_ : is_true (eqAmod e x y)) (_ : is_true (eqAmod e y z)), is_true (eqAmod e x z) *)
by move=> Exy Eyz; rewrite /eqAmod -[x](subrK y) -addrA rpredD.
Qed.
Lemma eqAmod_transl e x y z :
(x == y %[mod e])%A -> (x == z %[mod e])%A = (y == z %[mod e])%A.
Proof.
(* Goal: forall _ : is_true (eqAmod e x y), @eq bool (eqAmod e x z) (eqAmod e y z) *)
by move/(sym_left_transitive (eqAmod_sym e) (@eqAmod_trans e)).
Qed.
Lemma eqAmod_transr e x y z :
(x == y %[mod e])%A -> (z == x %[mod e])%A = (z == y %[mod e])%A.
Proof.
(* Goal: forall _ : is_true (eqAmod e x y), @eq bool (eqAmod e z x) (eqAmod e z y) *)
by move/(sym_right_transitive (eqAmod_sym e) (@eqAmod_trans e)).
Qed.
Lemma eqAmod0 e x : (x == 0 %[mod e])%A = (e %| x)%A.
Proof.
(* Goal: @eq bool (eqAmod e x (GRing.zero Algebraics.Implementation.zmodType)) (@in_mem Algebraics.divisor x (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (dvdA e))) *)
by rewrite /eqAmod subr0.
Qed.
Lemma eqAmodN e x y : (- x == y %[mod e])%A = (x == - y %[mod e])%A.
Proof.
(* Goal: @eq bool (eqAmod e (@GRing.opp Algebraics.Implementation.zmodType x) y) (eqAmod e x (@GRing.opp Algebraics.Implementation.zmodType y)) *)
by rewrite eqAmod_sym /eqAmod !opprK addrC.
Qed.
Lemma eqAmodDr e x y z : (y + x == z + x %[mod e])%A = (y == z %[mod e])%A.
Proof.
(* Goal: @eq bool (eqAmod e (@GRing.add Algebraics.Implementation.zmodType y x) (@GRing.add Algebraics.Implementation.zmodType z x)) (eqAmod e y z) *)
by rewrite /eqAmod addrAC opprD !addrA subrK.
Qed.
Lemma eqAmodDl e x y z : (x + y == x + z %[mod e])%A = (y == z %[mod e])%A.
Proof.
(* Goal: @eq bool (eqAmod e (@GRing.add Algebraics.Implementation.zmodType x y) (@GRing.add Algebraics.Implementation.zmodType x z)) (eqAmod e y z) *)
by rewrite !(addrC x) eqAmodDr.
Qed.
Lemma eqAmodD e x1 x2 y1 y2 :
(x1 == x2 %[mod e] -> y1 == y2 %[mod e] -> x1 + y1 == x2 + y2 %[mod e])%A.
Proof.
(* Goal: forall (_ : is_true (eqAmod e x1 x2)) (_ : is_true (eqAmod e y1 y2)), is_true (eqAmod e (@GRing.add Algebraics.Implementation.zmodType x1 y1) (@GRing.add Algebraics.Implementation.zmodType x2 y2)) *)
by rewrite -(eqAmodDl e x2 y1) -(eqAmodDr e y1); apply: eqAmod_trans.
Qed.
Lemma eqAmodm0 e : (e == 0 %[mod e])%A.
Proof.
(* Goal: is_true (eqAmod e e (GRing.zero Algebraics.Implementation.zmodType)) *)
by rewrite /eqAmod subr0 unfold_in; case: ifPn => // /divff->.
Qed.
Hint Resolve eqAmodm0 : core.
Lemma eqAmodMr e :
{in Aint, forall z x y, x == y %[mod e] -> x * z == y * z %[mod e]}%A.
Proof.
(* Goal: @prop_in1 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun z : GRing.Ring.sort Algebraics.Implementation.ringType => forall (x y : Algebraics.divisor) (_ : is_true (eqAmod e x y)), is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x z) (@GRing.mul Algebraics.Implementation.ringType y z))) (inPhantom (forall (z : GRing.Ring.sort Algebraics.Implementation.ringType) (x y : Algebraics.divisor) (_ : is_true (eqAmod e x y)), is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x z) (@GRing.mul Algebraics.Implementation.ringType y z)))) *)
move=> z Zz x y.
(* Goal: forall _ : is_true (eqAmod e x y), is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x z) (@GRing.mul Algebraics.Implementation.ringType y z)) *)
rewrite /eqAmod -mulrBl ![(e %| _)%A]unfold_in mulf_eq0 mulrAC.
(* Goal: forall _ : is_true (if @eq_op Algebraics.Implementation.eqType e (GRing.zero Algebraics.Implementation.zmodType) then @eq_op Algebraics.Implementation.eqType (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (GRing.zero Algebraics.Implementation.zmodType) else @in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.add Algebraics.Implementation.zmodType x (@GRing.opp Algebraics.Implementation.zmodType y)) (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)), is_true (if @eq_op Algebraics.Implementation.eqType e (GRing.zero Algebraics.Implementation.zmodType) then orb (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) x (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) y)) (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType))) (@eq_op (GRing.IntegralDomain.eqType Algebraics.Implementation.idomainType) z (GRing.zero (GRing.IntegralDomain.zmodType Algebraics.Implementation.idomainType))) else @in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@GRing.mul (GRing.ComRing.ringType Algebraics.Implementation.comRingType) (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) x (@GRing.opp (GRing.Ring.zmodType Algebraics.Implementation.ringType) y)) (@GRing.inv Algebraics.Implementation.unitRingType e)) z) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) *)
by case: ifP => [_ -> // | _ Exy]; apply: rpredM.
Qed.
Lemma eqAmodMl e :
{in Aint, forall z x y, x == y %[mod e] -> z * x == z * y %[mod e]}%A.
Proof.
(* Goal: @prop_in1 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun z : GRing.Ring.sort Algebraics.Implementation.ringType => forall (x y : Algebraics.divisor) (_ : is_true (eqAmod e x y)), is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType z x) (@GRing.mul Algebraics.Implementation.ringType z y))) (inPhantom (forall (z : GRing.Ring.sort Algebraics.Implementation.ringType) (x y : Algebraics.divisor) (_ : is_true (eqAmod e x y)), is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType z x) (@GRing.mul Algebraics.Implementation.ringType z y)))) *)
by move=> z Zz x y Exy; rewrite !(mulrC z) eqAmodMr.
Qed.
Lemma eqAmodMl0 e : {in Aint, forall x, x * e == 0 %[mod e]}%A.
Proof.
(* Goal: @prop_in1 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun x : GRing.Ring.sort Algebraics.Implementation.ringType => is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x e) (GRing.zero Algebraics.Implementation.zmodType))) (inPhantom (forall x : GRing.Ring.sort Algebraics.Implementation.ringType, is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x e) (GRing.zero Algebraics.Implementation.zmodType)))) *)
by move=> x Zx; rewrite -(mulr0 x) eqAmodMl.
Qed.
Lemma eqAmodMr0 e : {in Aint, forall x, e * x == 0 %[mod e]}%A.
Proof.
(* Goal: @prop_in1 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun x : GRing.Ring.sort Algebraics.Implementation.ringType => is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType e x) (GRing.zero Algebraics.Implementation.zmodType))) (inPhantom (forall x : GRing.Ring.sort Algebraics.Implementation.ringType, is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType e x) (GRing.zero Algebraics.Implementation.zmodType)))) *)
by move=> x Zx; rewrite /= mulrC eqAmodMl0.
Qed.
Lemma eqAmod_addl_mul e : {in Aint, forall x y, x * e + y == y %[mod e]}%A.
Proof.
(* Goal: @prop_in1 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun x : GRing.Ring.sort Algebraics.Implementation.ringType => forall y : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType), is_true (eqAmod e (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x e) y) y)) (inPhantom (forall (x : GRing.Ring.sort Algebraics.Implementation.ringType) (y : GRing.Zmodule.sort (GRing.Ring.zmodType Algebraics.Implementation.ringType)), is_true (eqAmod e (@GRing.add (GRing.Ring.zmodType Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType x e) y) y))) *)
by move=> x Zx y; rewrite -{2}[y]add0r eqAmodDr eqAmodMl0.
Qed.
Lemma eqAmodM e : {in Aint &, forall x1 y2 x2 y1,
x1 == x2 %[mod e] -> y1 == y2 %[mod e] -> x1 * y1 == x2 * y2 %[mod e]}%A.
Proof.
(* Goal: @prop_in2 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint) (fun x1 y2 : Algebraics.divisor => forall (x2 y1 : Algebraics.divisor) (_ : is_true (eqAmod e x1 x2)) (_ : is_true (eqAmod e y1 y2)), is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x1 y1) (@GRing.mul Algebraics.Implementation.ringType x2 y2))) (inPhantom (forall (x1 y2 x2 y1 : Algebraics.divisor) (_ : is_true (eqAmod e x1 x2)) (_ : is_true (eqAmod e y1 y2)), is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x1 y1) (@GRing.mul Algebraics.Implementation.ringType x2 y2)))) *)
move=> x1 y2 Zx1 Zy2 x2 y1 eq_x /(eqAmodMl Zx1)/eqAmod_trans-> //.
(* Goal: is_true (eqAmod e (@GRing.mul Algebraics.Implementation.ringType x1 y2) (@GRing.mul Algebraics.Implementation.ringType x2 y2)) *)
exact: eqAmodMr.
Qed.
Lemma eqAmod_rat :
{in Crat & &, forall e m n, (m == n %[mod e])%A = (m == n %[mod e])%C}.
Proof.
(* Goal: @prop_in3 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Crat) (fun e m n : Algebraics.divisor => @eq bool (eqAmod e m n) (eqCmod e m n)) (inPhantom (forall e m n : Algebraics.divisor, @eq bool (eqAmod e m n) (eqCmod e m n))) *)
move=> e m n Qe Qm Qn; rewrite /eqCmod unfold_in /eqAmod unfold_in.
(* Goal: @eq bool (if @eq_op Algebraics.Implementation.eqType e (GRing.zero Algebraics.Implementation.zmodType) then @eq_op Algebraics.Implementation.eqType (@GRing.add Algebraics.Implementation.zmodType m (@GRing.opp Algebraics.Implementation.zmodType n)) (GRing.zero Algebraics.Implementation.zmodType) else @in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.add Algebraics.Implementation.zmodType m (@GRing.opp Algebraics.Implementation.zmodType n)) (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Aint)) (if @eq_op Algebraics.Implementation.eqType e (GRing.zero Algebraics.Implementation.zmodType) then @eq_op Algebraics.Implementation.eqType (@GRing.add Algebraics.Implementation.zmodType m (@GRing.opp Algebraics.Implementation.zmodType n)) (GRing.zero Algebraics.Implementation.zmodType) else @in_mem (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.mul Algebraics.Implementation.ringType (@GRing.add Algebraics.Implementation.zmodType m (@GRing.opp Algebraics.Implementation.zmodType n)) (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Cint)) *)
case: ifPn => // nz_e; apply/idP/idP=> [/Cint_rat_Aint | /Aint_Cint] -> //.
(* Goal: is_true (@in_mem Algebraics.Implementation.type (@GRing.mul Algebraics.Implementation.ringType (@GRing.add Algebraics.Implementation.zmodType m (@GRing.opp Algebraics.Implementation.zmodType n)) (@GRing.inv Algebraics.Implementation.unitRingType e)) (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Crat)) *)
by rewrite rpred_div ?rpredB.
Qed.
Lemma eqAmod0_rat : {in Crat &, forall e n, (n == 0 %[mod e])%A = (e %| n)%C}.
Proof.
(* Goal: @prop_in2 Algebraics.Implementation.type (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) Crat) (fun e n : Algebraics.divisor => @eq bool (eqAmod e n (GRing.zero Algebraics.Implementation.zmodType)) (@in_mem Algebraics.divisor n (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (dvdC e)))) (inPhantom (forall e n : Algebraics.divisor, @eq bool (eqAmod e n (GRing.zero Algebraics.Implementation.zmodType)) (@in_mem Algebraics.divisor n (@mem Algebraics.Implementation.type (predPredType Algebraics.Implementation.type) (dvdC e))))) *)
by move=> e n Qe Qn; rewrite /= eqAmod_rat /eqCmod ?subr0 ?Crat0.
Qed.
Lemma eqAmod_nat (e m n : nat) : (m == n %[mod e])%A = (m == n %[mod e])%N.
Proof.
(* Goal: @eq bool (eqAmod (Algebraics.Internals.nat_divisor e) (Algebraics.Internals.nat_divisor m) (Algebraics.Internals.nat_divisor n)) (@eq_op nat_eqType (modn m e) (modn n e)) *)
by rewrite eqAmod_rat ?rpred_nat // eqCmod_nat.
Qed.
Lemma eqAmod0_nat (e m : nat) : (m == 0 %[mod e])%A = (e %| m)%N.
Proof.
(* Goal: @eq bool (eqAmod (Algebraics.Internals.nat_divisor e) (Algebraics.Internals.nat_divisor m) (GRing.zero Algebraics.Implementation.zmodType)) (dvdn e m) *)
by rewrite eqAmod0_rat ?rpred_nat // dvdC_nat.
Qed.
Definition orderC x :=
let p := minCpoly x in
oapp val 0%N [pick n : 'I_(2 * size p ^ 2) | p == intrp 'Phi_n].
Notation "#[ x ]" := (orderC x) : C_scope.
Lemma exp_orderC x : x ^+ #[x]%C = 1.
Proof.
(* Goal: @eq (GRing.Ring.sort Algebraics.Implementation.ringType) (@GRing.exp Algebraics.Implementation.ringType x (orderC x)) (GRing.one Algebraics.Implementation.ringType) *)
rewrite /orderC; case: pickP => //= [] [n _] /= /eqP Dp.
(* Goal: @eq Algebraics.Implementation.type (@GRing.exp Algebraics.Implementation.ringType x n) (GRing.one Algebraics.Implementation.ringType) *)
have n_gt0: (0 < n)%N.
(* Goal: @eq Algebraics.Implementation.type (@GRing.exp Algebraics.Implementation.ringType x n) (GRing.one Algebraics.Implementation.ringType) *)
(* Goal: is_true (leq (S O) n) *)
rewrite lt0n; apply: contraTneq (size_minCpoly x) => n0.
(* Goal: @eq Algebraics.Implementation.type (@GRing.exp Algebraics.Implementation.ringType x n) (GRing.one Algebraics.Implementation.ringType) *)
(* Goal: is_true (negb (leq (S (S O)) (@size (GRing.Ring.sort Algebraics.Implementation.ringType) (@polyseq Algebraics.Implementation.ringType (minCpoly x))))) *)
by rewrite Dp n0 Cyclotomic0 rmorph1 size_poly1.
(* Goal: @eq Algebraics.Implementation.type (@GRing.exp Algebraics.Implementation.ringType x n) (GRing.one Algebraics.Implementation.ringType) *)
have [z prim_z] := C_prim_root_exists n_gt0.
(* Goal: @eq Algebraics.Implementation.type (@GRing.exp Algebraics.Implementation.ringType x n) (GRing.one Algebraics.Implementation.ringType) *)
rewrite prim_expr_order // -(root_cyclotomic prim_z).
(* Goal: is_true (@root (GRing.Field.ringType Algebraics.Implementation.fieldType) (@cyclotomic (GRing.Field.ringType Algebraics.Implementation.fieldType) z n) x) *)
by rewrite -Cintr_Cyclotomic // -Dp root_minCpoly.
Qed.
Lemma dvdn_orderC x n : (#[x]%C %| n)%N = (x ^+ n == 1).
|
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt.
Lemma zerob_If :
forall (b : bool) (x y : nat),
zerob (if_bool _ b x y) = true -> x <> 0 -> b = false.
Proof.
(* Goal: forall (b : bool) (x y : nat) (_ : @eq bool (zerob (if_bool nat b x y)) true) (_ : not (@eq nat x O)), @eq bool b false *)
simple induction b; simpl in |- *; intros; auto.
(* Goal: @eq bool true false *)
absurd (x <> 0).
(* Goal: not (@eq nat x O) *)
(* Goal: not (not (@eq nat x O)) *)
apply no_no_A; apply zerob_true_elim; auto.
(* Goal: not (@eq nat x O) *)
trivial.
Qed.
Lemma lt_no_zerob : forall n : nat, 0 < n -> zerob n <> true.
Proof.
(* Goal: forall (n : nat) (_ : lt O n), not (@eq bool (zerob n) true) *)
simple induction n; [ intros; inversion H | auto ].
Qed.
Hint Resolve lt_no_zerob.
Lemma zerob_pred_no : forall n : nat, zerob (pred n) = false -> n <> 0.
Proof.
(* Goal: forall (n : nat) (_ : @eq bool (zerob (Nat.pred n)) false), not (@eq nat n O) *)
simple induction n; auto with bool.
Qed.
Hint Resolve zerob_pred_no.
Lemma zerob_lt : forall n : nat, zerob n = false -> 0 < n.
Proof.
(* Goal: forall (n : nat) (_ : @eq bool (zerob n) false), lt O n *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall _ : @eq bool (zerob n) false, lt O n) (_ : @eq bool (zerob (S n)) false), lt O (S n) *)
(* Goal: forall _ : @eq bool (zerob O) false, lt O O *)
simpl in |- *; intro.
(* Goal: forall (n : nat) (_ : forall _ : @eq bool (zerob n) false, lt O n) (_ : @eq bool (zerob (S n)) false), lt O (S n) *)
(* Goal: lt O O *)
absurd (true = false); auto with bool.
(* Goal: forall (n : nat) (_ : forall _ : @eq bool (zerob n) false, lt O n) (_ : @eq bool (zerob (S n)) false), lt O (S n) *)
intros.
(* Goal: lt O (S n0) *)
auto with arith.
Qed.
Hint Resolve zerob_lt.
Lemma no_zerob_true : forall n : nat, n <> 0 -> zerob n <> true.
Proof.
(* Goal: forall (n : nat) (_ : not (@eq nat n O)), not (@eq bool (zerob n) true) *)
simple induction n; auto.
Qed.
Hint Resolve no_zerob_true.
Lemma x_1_or_y_0 :
forall x y : nat,
zerob (pred x) || zerob y = true -> x <> 0 -> x = 1 \/ y = 0.
Proof.
(* Goal: forall (x y : nat) (_ : @eq bool (orb (zerob (Nat.pred x)) (zerob y)) true) (_ : not (@eq nat x O)), or (@eq nat x (S O)) (@eq nat y O) *)
simple induction x; simple induction y.
(* Goal: forall (n0 : nat) (_ : forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob n0)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat n0 O)) (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob (S n0))) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat (S n0) O) *)
(* Goal: forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob O)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat O O) *)
(* Goal: forall (n : nat) (_ : forall (_ : @eq bool (orb (zerob (Nat.pred O)) (zerob n)) true) (_ : not (@eq nat O O)), or (@eq nat O (S O)) (@eq nat n O)) (_ : @eq bool (orb (zerob (Nat.pred O)) (zerob (S n))) true) (_ : not (@eq nat O O)), or (@eq nat O (S O)) (@eq nat (S n) O) *)
(* Goal: forall (_ : @eq bool (orb (zerob (Nat.pred O)) (zerob O)) true) (_ : not (@eq nat O O)), or (@eq nat O (S O)) (@eq nat O O) *)
intros; right; try trivial.
(* Goal: forall (n0 : nat) (_ : forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob n0)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat n0 O)) (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob (S n0))) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat (S n0) O) *)
(* Goal: forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob O)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat O O) *)
(* Goal: forall (n : nat) (_ : forall (_ : @eq bool (orb (zerob (Nat.pred O)) (zerob n)) true) (_ : not (@eq nat O O)), or (@eq nat O (S O)) (@eq nat n O)) (_ : @eq bool (orb (zerob (Nat.pred O)) (zerob (S n))) true) (_ : not (@eq nat O O)), or (@eq nat O (S O)) (@eq nat (S n) O) *)
intros.
(* Goal: forall (n0 : nat) (_ : forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob n0)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat n0 O)) (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob (S n0))) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat (S n0) O) *)
(* Goal: forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob O)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat O O) *)
(* Goal: or (@eq nat O (S O)) (@eq nat (S n) O) *)
absurd (0 <> 0); auto with arith.
(* Goal: forall (n0 : nat) (_ : forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob n0)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat n0 O)) (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob (S n0))) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat (S n0) O) *)
(* Goal: forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob O)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat O O) *)
right; auto.
(* Goal: forall (n0 : nat) (_ : forall (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob n0)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat n0 O)) (_ : @eq bool (orb (zerob (Nat.pred (S n))) (zerob (S n0))) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat (S n0) O) *)
simpl in |- *.
(* Goal: forall (n0 : nat) (_ : forall (_ : @eq bool (orb (zerob n) (zerob n0)) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat n0 O)) (_ : @eq bool (orb (zerob n) false) true) (_ : not (@eq nat (S n) O)), or (@eq nat (S n) (S O)) (@eq nat (S n0) O) *)
elim orb_sym; simpl in |- *; intros.
(* Goal: or (@eq nat (S n) (S O)) (@eq nat (S n0) O) *)
left; replace n with 0.
(* Goal: @eq nat O n *)
(* Goal: @eq nat (S O) (S O) *)
try trivial.
(* Goal: @eq nat O n *)
apply sym_equal; apply zerob_true_elim; try trivial.
Qed.
Lemma zerob_pred_false :
forall n : nat, zerob (pred n) = false -> zerob n = false.
Proof.
(* Goal: forall (n : nat) (_ : @eq bool (zerob (Nat.pred n)) false), @eq bool (zerob n) false *)
simple induction n; auto.
Qed.
Hint Resolve zerob_pred_false.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCorder.
Section Euclid.
Context `{Ax1:euclidean_neutral}.
Lemma lemma_samesideflip :
forall A B P Q,
OS P Q A B ->
OS P Q B A.
Proof.
(* Goal: forall (A B P Q : @Point Ax1) (_ : @OS Ax1 P Q A B), @OS Ax1 P Q B A *)
intros.
(* Goal: @OS Ax1 P Q B A *)
let Tf:=fresh in assert (Tf:exists p q r, (Col A B p /\ Col A B q /\ BetS P p r /\ BetS Q q r /\ nCol A B P /\ nCol A B Q)) by (conclude_def OS );destruct Tf as [p[q[r]]];spliter.
(* Goal: @OS Ax1 P Q B A *)
assert (Col B A p) by (forward_using lemma_collinearorder).
(* Goal: @OS Ax1 P Q B A *)
assert (Col B A q) by (forward_using lemma_collinearorder).
(* Goal: @OS Ax1 P Q B A *)
assert (nCol B A P) by (forward_using lemma_NCorder).
(* Goal: @OS Ax1 P Q B A *)
assert (nCol B A Q) by (forward_using lemma_NCorder).
(* Goal: @OS Ax1 P Q B A *)
assert (OS P Q B A) by (conclude_def OS ).
(* Goal: @OS Ax1 P Q B A *)
close.
Qed.
End Euclid.
|
Require Export GeoCoq.Tarski_dev.Ch15_lengths.
Section T16.
Context `{T2D:Tarski_2D}.
Context `{TE:@Tarski_euclidean Tn TnEQD}.
Lemma grid_exchange_axes : forall O E S U1 U2,
Cs O E S U1 U2 -> Cs O E S U2 U1.
Proof.
(* Goal: forall (O E S U1 U2 : @Tpoint Tn) (_ : @Cs Tn O E S U1 U2), @Cs Tn O E S U2 U1 *)
intros O E S U1 U2 HCs.
(* Goal: @Cs Tn O E S U2 U1 *)
destruct HCs as [HDiff [HCong1 [HCong2 HPer]]].
(* Goal: @Cs Tn O E S U2 U1 *)
repeat (split; Perp).
Qed.
Lemma Cs_not_Col : forall O E S U1 U2, Cs O E S U1 U2 -> ~ Col U1 S U2.
Proof.
(* Goal: forall (O E S U1 U2 : @Tpoint Tn) (_ : @Cs Tn O E S U1 U2), not (@Col Tn U1 S U2) *)
unfold Cs; intros O E S U1 U2 HCs.
(* Goal: not (@Col Tn U1 S U2) *)
spliter; assert_diffs; apply per_not_col; Perp.
Qed.
Lemma exists_grid : exists O E E' S U1 U2, ~ Col O E E' /\ Cs O E S U1 U2.
Proof.
(* Goal: @ex (@Tpoint Tn) (fun O : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun E' : @Tpoint Tn => @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => and (not (@Col Tn O E E')) (@Cs Tn O E S U1 U2))))))) *)
destruct lower_dim_ex as [O [I [X HNC]]].
(* Goal: @ex (@Tpoint Tn) (fun O : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun E' : @Tpoint Tn => @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => and (not (@Col Tn O E E')) (@Cs Tn O E S U1 U2))))))) *)
assert (H : ~ Col O I X) by auto; clear HNC; rename H into HNC.
(* Goal: @ex (@Tpoint Tn) (fun O : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun E' : @Tpoint Tn => @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => and (not (@Col Tn O E E')) (@Cs Tn O E S U1 U2))))))) *)
assert_diffs; destruct (ex_per_cong I O O X O I) as [J HJ]; Col; spliter.
(* Goal: @ex (@Tpoint Tn) (fun O : @Tpoint Tn => @ex (@Tpoint Tn) (fun E : @Tpoint Tn => @ex (@Tpoint Tn) (fun E' : @Tpoint Tn => @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => and (not (@Col Tn O E E')) (@Cs Tn O E S U1 U2))))))) *)
exists O; exists I; exists X; exists O; exists I; exists J.
(* Goal: and (not (@Col Tn O I X)) (@Cs Tn O I O I J) *)
repeat (split; finish).
Qed.
Lemma exists_grid_spec : exists S U1 U2, Cs PA PB S U1 U2.
Proof.
(* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => @Cs Tn (@PA Tn) (@PB Tn) S U1 U2))) *)
assert (~ Col PA PB PC) by (apply lower_dim).
(* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => @Cs Tn (@PA Tn) (@PB Tn) S U1 U2))) *)
assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => @Cs Tn (@PA Tn) (@PB Tn) S U1 U2))) *)
destruct (ex_per_cong PB PA PA PC PA PB) as [J HJ]; Col; spliter.
(* Goal: @ex (@Tpoint Tn) (fun S : @Tpoint Tn => @ex (@Tpoint Tn) (fun U1 : @Tpoint Tn => @ex (@Tpoint Tn) (fun U2 : @Tpoint Tn => @Cs Tn (@PA Tn) (@PB Tn) S U1 U2))) *)
exists PA; exists PB; exists J.
(* Goal: @Cs Tn (@PA Tn) (@PB Tn) (@PA Tn) (@PB Tn) J *)
repeat (split; finish).
Qed.
Lemma coord_exchange_axes : forall O E S U1 U2 P X Y,
Cd O E S U1 U2 P X Y -> Cd O E S U2 U1 P Y X.
Proof.
(* Goal: forall (O E S U1 U2 P X Y : @Tpoint Tn) (_ : @Cd Tn O E S U1 U2 P X Y), @Cd Tn O E S U2 U1 P Y X *)
intros O E S U1 U2 P X Y HCd.
(* Goal: @Cd Tn O E S U2 U1 P Y X *)
destruct HCd as [HCs [H [HPX HPY]]]; clear H.
(* Goal: @Cd Tn O E S U2 U1 P Y X *)
split; try (apply grid_exchange_axes; auto).
(* Goal: and (@Coplanar Tn P S U2 U1) (and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U2) (@Cong_3 Tn O E Y S U2 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U1) (@Cong_3 Tn O E X S U1 PY)))) *)
split; try apply all_coplanar.
(* Goal: and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U2) (@Cong_3 Tn O E Y S U2 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U1) (@Cong_3 Tn O E X S U1 PY))) *)
split; auto.
Qed.
Lemma Cd_Col : forall O E S U1 U2 P X Y,
Cd O E S U1 U2 P X Y -> Col O E X /\ Col O E Y.
Proof.
(* Goal: forall (O E S U1 U2 P X Y : @Tpoint Tn) (_ : @Cd Tn O E S U1 U2 P X Y), and (@Col Tn O E X) (@Col Tn O E Y) *)
unfold Cd; unfold Projp; intros O E S U1 U2 P X Y HCd.
(* Goal: and (@Col Tn O E X) (@Col Tn O E Y) *)
destruct HCd as [HCs [HC [[PX HPX] [PY HPY]]]]; clear HC.
(* Goal: and (@Col Tn O E X) (@Col Tn O E Y) *)
destruct HPX as [[HDiff1 HElim1] HCong1]; destruct HPY as [[HDiff2 HElim2] HCong2].
(* Goal: and (@Col Tn O E X) (@Col Tn O E Y) *)
split; [apply l4_13 with S U1 PX|apply l4_13 with S U2 PY]; Cong; [induction HElim1|induction HElim2]; spliter; treat_equalities; Col.
Qed.
Lemma exists_projp : forall A B P, A <> B -> exists P', Projp P P' A B.
Proof.
(* Goal: forall (A B P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)), @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => @Projp Tn P P' A B) *)
intros A B P HAB.
(* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => @Projp Tn P P' A B) *)
elim (col_dec A B P); intro HNC; [exists P; split; Col; right|].
(* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => @Projp Tn P P' A B) *)
destruct (l8_18_existence A B P HNC) as [P' HP'].
(* Goal: @ex (@Tpoint Tn) (fun P' : @Tpoint Tn => @Projp Tn P P' A B) *)
exists P'; split; Col.
Qed.
Lemma exists_coord : forall O E S U P,
S <> U -> Cong O E S U ->
exists PX, exists X, Projp P PX S U /\ Cong_3 O E X S U PX.
Proof.
(* Goal: forall (O E S U P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) S U)) (_ : @Cong Tn O E S U), @ex (@Tpoint Tn) (fun PX : @Tpoint Tn => @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Projp Tn P PX S U) (@Cong_3 Tn O E X S U PX))) *)
intros O E S U P HSU HCong.
(* Goal: @ex (@Tpoint Tn) (fun PX : @Tpoint Tn => @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Projp Tn P PX S U) (@Cong_3 Tn O E X S U PX))) *)
destruct (exists_projp S U P HSU) as [PX Hprojp].
(* Goal: @ex (@Tpoint Tn) (fun PX : @Tpoint Tn => @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Projp Tn P PX S U) (@Cong_3 Tn O E X S U PX))) *)
assert (HCol : Col S U PX) by (destruct Hprojp as [H' H]; induction H; spliter; treat_equalities; Col).
(* Goal: @ex (@Tpoint Tn) (fun PX : @Tpoint Tn => @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Projp Tn P PX S U) (@Cong_3 Tn O E X S U PX))) *)
destruct (l4_14 S U PX O E) as [X HCong']; Cong.
(* Goal: @ex (@Tpoint Tn) (fun PX : @Tpoint Tn => @ex (@Tpoint Tn) (fun X : @Tpoint Tn => and (@Projp Tn P PX S U) (@Cong_3 Tn O E X S U PX))) *)
exists PX; exists X; auto with cong.
Qed.
Lemma coordinates_of_point : forall O E S U1 U2 P,
Cs O E S U1 U2 -> exists X, exists Y, Cd O E S U1 U2 P X Y.
Proof.
(* Goal: forall (O E S U1 U2 P : @Tpoint Tn) (_ : @Cs Tn O E S U1 U2), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y)) *)
intros O E S U1 U2 P HCs.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y)) *)
assert (H := HCs); destruct H as [HDiff [HCong1 [HCong2 H]]]; clear H.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y)) *)
assert (HSU1 : S <> U1) by (assert_diffs; auto).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y)) *)
assert (HSU2 : S <> U2) by (assert_diffs; auto).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y)) *)
destruct (exists_coord O E S U1 P HSU1 HCong1) as [PX [X HX]].
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y)) *)
destruct (exists_coord O E S U2 P HSU2 HCong2) as [PY [Y HY]].
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y)) *)
exists X; exists Y; split; auto.
(* Goal: and (@Coplanar Tn P S U1 U2) (and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U1) (@Cong_3 Tn O E X S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U2) (@Cong_3 Tn O E Y S U2 PY)))) *)
split; try (apply all_coplanar).
(* Goal: and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U1) (@Cong_3 Tn O E X S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U2) (@Cong_3 Tn O E Y S U2 PY))) *)
split; [exists PX|exists PY]; auto.
Qed.
Lemma point_of_coordinates_origin : forall O E S U1 U2,
Cs O E S U1 U2 -> Cd O E S U1 U2 S O O.
Proof.
(* Goal: forall (O E S U1 U2 : @Tpoint Tn) (_ : @Cs Tn O E S U1 U2), @Cd Tn O E S U1 U2 S O O *)
intros O E S U1 U2 HCs.
(* Goal: @Cd Tn O E S U1 U2 S O O *)
split; auto.
(* Goal: and (@Coplanar Tn S S U1 U2) (and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn S PX S U1) (@Cong_3 Tn O E O S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn S PY S U2) (@Cong_3 Tn O E O S U2 PY)))) *)
split; try apply all_coplanar.
(* Goal: and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn S PX S U1) (@Cong_3 Tn O E O S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn S PY S U2) (@Cong_3 Tn O E O S U2 PY))) *)
destruct HCs as [HDiff [HCong1 [HCong2 H]]]; clear H.
(* Goal: and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn S PX S U1) (@Cong_3 Tn O E O S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn S PY S U2) (@Cong_3 Tn O E O S U2 PY))) *)
assert_diffs; split; exists S; repeat (split; Col; Cong).
Qed.
Lemma point_of_coordinates_on_an_axis : forall O E S U1 U2 X,
Cs O E S U1 U2 -> Col O E X -> O <> X -> exists P, Cd O E S U1 U2 P X O.
Proof.
(* Goal: forall (O E S U1 U2 X : @Tpoint Tn) (_ : @Cs Tn O E S U1 U2) (_ : @Col Tn O E X) (_ : not (@eq (@Tpoint Tn) O X)), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X O) *)
intros O E S U1 U2 X HCs HCol HOX.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X O) *)
assert (H := HCs); destruct H as [HDiff [HCong1 [HCong2 H]]]; clear H.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X O) *)
destruct (l4_14 O E X S U1 HCol HCong1) as [P HP].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X O) *)
exists P; split; auto.
(* Goal: and (@Coplanar Tn P S U1 U2) (and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U1) (@Cong_3 Tn O E X S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U2) (@Cong_3 Tn O E O S U2 PY)))) *)
destruct HCs as [H [H' [H'' HPer]]]; clear H; clear H'; clear H''.
(* Goal: and (@Coplanar Tn P S U1 U2) (and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U1) (@Cong_3 Tn O E X S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U2) (@Cong_3 Tn O E O S U2 PY)))) *)
split; try apply all_coplanar.
(* Goal: and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U1) (@Cong_3 Tn O E X S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U2) (@Cong_3 Tn O E O S U2 PY))) *)
assert_diffs; split; [exists P|exists S]; repeat (split; Cong); [right; split; try apply l4_13 with O E X; Col|].
(* Goal: or (and (@Col Tn S U2 S) (@Perp Tn S U2 P S)) (and (@Col Tn S U2 P) (@eq (@Tpoint Tn) P S)) *)
left; split; Col.
(* Goal: @Perp Tn S U2 P S *)
apply per_perp in HPer; auto.
(* Goal: @Perp Tn S U2 P S *)
apply perp_col0 with S U1; Col; Perp; [unfold Cong_3 in *; spliter; assert_diffs|apply l4_13 with O E X]; Col.
Qed.
Lemma point_of_coordinates : forall O E S U1 U2 X Y,
Cs O E S U1 U2 -> Col O E X -> Col O E Y -> exists P, Cd O E S U1 U2 P X Y.
Proof.
(* Goal: forall (O E S U1 U2 X Y : @Tpoint Tn) (_ : @Cs Tn O E S U1 U2) (_ : @Col Tn O E X) (_ : @Col Tn O E Y), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
intros O E S U1 U2 X Y HCs HCol1 HCol2.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
elim (eq_dec_points O X); intro HOX; elim (eq_dec_points O Y); intro HOY; treat_equalities; [exists S; apply point_of_coordinates_origin| destruct (point_of_coordinates_on_an_axis O E S U2 U1 Y) as [P HP]; try apply grid_exchange_axes; try (exists P; apply coord_exchange_axes)| apply point_of_coordinates_on_an_axis|]; auto.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
assert (H := HCs); destruct H as [HDiff [HCong1 [HCong2 H]]]; clear H.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
destruct (l4_14 O E X S U1 HCol1 HCong1) as [PX HPX].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
destruct (l4_14 O E Y S U2 HCol2 HCong2) as [PY HPY].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
destruct (perp_exists PX S U1) as [PX' HPerp1]; [assert_diffs; auto|].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
destruct (perp_exists PY S U2) as [PY' HPerp2]; [assert_diffs; auto|].
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
assert (HPerp3 : Perp PX PX' PY PY').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
(* Goal: @Perp Tn PX PX' PY PY' *)
{
(* Goal: @Perp Tn PX PX' PY PY' *)
apply par_perp__perp with S U2; Perp.
(* Goal: @Par Tn S U2 PX PX' *)
apply l12_9_2D with S U1; Perp.
(* Goal: @Perp Tn S U2 S U1 *)
destruct HCs as [H [H' [H'' HPer]]]; clear H; clear H'; clear H''.
(* Goal: @Perp Tn S U2 S U1 *)
assert_diffs; apply per_perp in HPer; Perp.
(* BG Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
}
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @Cd Tn O E S U1 U2 P X Y) *)
assert (H := HPerp3); destruct H as [P HP]; exists P; split; auto.
(* Goal: and (@Coplanar Tn P S U1 U2) (and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U1) (@Cong_3 Tn O E X S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U2) (@Cong_3 Tn O E Y S U2 PY)))) *)
split; try apply all_coplanar.
(* Goal: and (@ex (@Tpoint Tn) (fun PX : @Tpoint Tn => and (@Projp Tn P PX S U1) (@Cong_3 Tn O E X S U1 PX))) (@ex (@Tpoint Tn) (fun PY : @Tpoint Tn => and (@Projp Tn P PY S U2) (@Cong_3 Tn O E Y S U2 PY))) *)
split; [exists PX|exists PY]; split; Cong.
(* Goal: @Projp Tn P PY S U2 *)
(* Goal: @Projp Tn P PX S U1 *)
{
(* Goal: @Projp Tn P PX S U1 *)
assert_diffs; split; auto.
(* Goal: or (and (@Col Tn S U1 PX) (@Perp Tn S U1 P PX)) (and (@Col Tn S U1 P) (@eq (@Tpoint Tn) P PX)) *)
left; split; [apply l4_13 with O E X; Col|].
(* Goal: @Perp Tn S U1 P PX *)
unfold Perp_at in *; spliter; apply perp_col0 with PX PX'; Col.
(* Goal: not (@eq (@Tpoint Tn) P PX) *)
assert (HPYS : PY <> S) by (unfold Cong_3 in *; spliter; assert_diffs; auto).
(* Goal: not (@eq (@Tpoint Tn) P PX) *)
intro; treat_equalities; apply HPYS.
(* Goal: @eq (@Tpoint Tn) PY S *)
apply l6_21 with S U1 U2 S; Col; [destruct HCs as [H' [H'' [H''' HPer]]]; apply perp_not_col; assert_diffs; apply per_perp in HPer; Perp| |apply l4_13 with E O Y; try apply cong_3_swap; Col].
(* Goal: @Col Tn S U1 PY *)
assert (HPar : Par S U1 PY PY') by (apply l12_9_2D with P PX'; Perp).
(* Goal: @Col Tn S U1 PY *)
elim HPar; clear HPar; intro HParS; [|spliter; ColR].
(* Goal: @Col Tn S U1 PY *)
exfalso; apply HParS; exists P; split; Col.
(* Goal: @Col Tn P S U1 *)
apply l4_13 with X O E; try (apply cong_3_swap; apply cong_3_swap_2); Col.
(* BG Goal: @Projp Tn P PY S U2 *)
}
(* Goal: @Projp Tn P PY S U2 *)
{
(* Goal: @Projp Tn P PY S U2 *)
assert_diffs; split; auto.
(* Goal: or (and (@Col Tn S U2 PY) (@Perp Tn S U2 P PY)) (and (@Col Tn S U2 P) (@eq (@Tpoint Tn) P PY)) *)
left; split; [apply l4_13 with O E Y; Col|].
(* Goal: @Perp Tn S U2 P PY *)
unfold Perp_at in *; spliter; apply perp_col0 with PY PY'; Col.
(* Goal: not (@eq (@Tpoint Tn) P PY) *)
assert (HPXS : PX <> S) by (unfold Cong_3 in *; spliter; assert_diffs; auto).
(* Goal: not (@eq (@Tpoint Tn) P PY) *)
intro; treat_equalities; apply HPXS.
(* Goal: @eq (@Tpoint Tn) PX S *)
apply l6_21 with S U2 U1 S; Col; [destruct HCs as [H' [H'' [H''' HPer]]]; apply perp_not_col; assert_diffs; apply per_perp in HPer; Perp| |apply l4_13 with E O X; try apply cong_3_swap; Col].
(* Goal: @Col Tn S U2 PX *)
assert (HPar : Par S U2 PX PX') by (apply l12_9_2D with P PY'; Perp).
(* Goal: @Col Tn S U2 PX *)
elim HPar; clear HPar; intro HParS; [|spliter; ColR].
(* Goal: @Col Tn S U2 PX *)
exfalso; apply HParS; exists P; split; Col.
(* Goal: @Col Tn P S U2 *)
apply l4_13 with Y O E; try (apply cong_3_swap; apply cong_3_swap_2); Col.
Qed.
Lemma eq_points_coordinates : forall O E S U1 U2 P1 X1 Y1 P2 X2 Y2,
Cd O E S U1 U2 P1 X1 Y1 -> Cd O E S U1 U2 P2 X2 Y2 ->
(P1 = P2 <-> (X1 = X2 /\ Y1 = Y2)).
Lemma l16_9_1 : forall O E E' X Y XY XMY,
Col O E X -> Col O E Y -> Is_length O E E' X Y XY ->
LeP O E E' Y X -> Diff O E E' X Y XMY ->
XY = XMY.
Proof.
(* Goal: forall (O E E' X Y XY XMY : @Tpoint Tn) (_ : @Col Tn O E X) (_ : @Col Tn O E Y) (_ : @Is_length Tn O E E' X Y XY) (_ : @LeP Tn O E E' Y X) (_ : @Diff Tn O E E' X Y XMY), @eq (@Tpoint Tn) XY XMY *)
intros O E E' X Y XY XMY HCol1 HCol2 HXY HLe1 HXMY.
(* Goal: @eq (@Tpoint Tn) XY XMY *)
assert (HNC : ~ Col O E E') by (apply diff_ar2 in HXMY; unfold Ar2 in *; spliter; Col).
(* Goal: @eq (@Tpoint Tn) XY XMY *)
assert (HOE : O <> E) by (assert_diffs; auto).
(* Goal: @eq (@Tpoint Tn) XY XMY *)
assert (HCol3 : Col O E XMY).
(* Goal: @eq (@Tpoint Tn) XY XMY *)
(* Goal: @Col Tn O E XMY *)
{
(* Goal: @Col Tn O E XMY *)
unfold Diff, Opp, Sum, Ar2 in *; destruct HXMY as [MB [H1 [H2 [H3 H4]]]]; spliter; Col.
(* BG Goal: @eq (@Tpoint Tn) XY XMY *)
}
(* Goal: @eq (@Tpoint Tn) XY XMY *)
assert (HCong1 := HXMY); apply diff_sum in HCong1; apply l15_3 in HCong1.
(* Goal: @eq (@Tpoint Tn) XY XMY *)
elim HXY; clear HXY; intro HXY; [|spliter; intuition].
(* Goal: @eq (@Tpoint Tn) XY XMY *)
destruct HXY as [H [HCol4 [HLe2 HCong2]]].
(* Goal: @eq (@Tpoint Tn) XY XMY *)
elim (l7_20 O XY XMY); [auto|intro HMid; clear H|ColR|apply cong_transitivity with X Y; Cong].
(* Goal: @eq (@Tpoint Tn) XY XMY *)
elim HLe1; clear HLe1; intro HLt1; [clear HCong1|treat_equalities; auto].
(* Goal: @eq (@Tpoint Tn) XY XMY *)
elim HLe2; clear HLe2; intro HLt2; [clear HCong2|treat_equalities; auto].
(* Goal: @eq (@Tpoint Tn) XY XMY *)
exfalso; apply not_pos_and_neg with O E XMY; split; [apply lt_diff_ps with E' X Y; auto|].
(* Goal: @Ng Tn O E XMY *)
apply pos_opp_neg with E' XY; [apply ltP_pos with E'; auto|].
(* Goal: @Opp Tn O E E' XY XMY *)
apply midpoint_opp; repeat (Col; split).
Qed.
Lemma length_eq_or_opp : forall O E E' A B L1 L2,
Length O E E' A B L1 -> Diff O E E' A B L2 -> L1 = L2 \/ Opp O E E' L1 L2.
Proof.
(* Goal: forall (O E E' A B L1 L2 : @Tpoint Tn) (_ : @Length Tn O E E' A B L1) (_ : @Diff Tn O E E' A B L2), or (@eq (@Tpoint Tn) L1 L2) (@Opp Tn O E E' L1 L2) *)
intros O E E' A B L1 L2 HL1 HL2.
(* Goal: or (@eq (@Tpoint Tn) L1 L2) (@Opp Tn O E E' L1 L2) *)
assert (HNC : ~ Col O E E') by (apply diff_ar2 in HL2; unfold Ar2 in *; spliter; Col).
(* Goal: or (@eq (@Tpoint Tn) L1 L2) (@Opp Tn O E E' L1 L2) *)
assert (HColA : Col O E A) by (apply diff_ar2 in HL2; unfold Ar2 in *; spliter; Col).
(* Goal: or (@eq (@Tpoint Tn) L1 L2) (@Opp Tn O E E' L1 L2) *)
assert (HColB : Col O E B) by (apply diff_ar2 in HL2; unfold Ar2 in *; spliter; Col).
(* Goal: or (@eq (@Tpoint Tn) L1 L2) (@Opp Tn O E E' L1 L2) *)
elim (col_2_le_or_ge O E E' A B); auto; intro HLe; [right|left; apply l16_9_1 with O E E' A B; auto; left; auto].
(* Goal: @Opp Tn O E E' L1 L2 *)
apply diff_opp with B A; auto.
(* Goal: @Diff Tn O E E' B A L1 *)
destruct (diff_exists O E E' B A) as [D HD]; Col.
(* Goal: @Diff Tn O E E' B A L1 *)
assert (L1 = D) by (apply l16_9_1 with O E E' B A; auto; left; apply length_sym; auto).
(* Goal: @Diff Tn O E E' B A L1 *)
treat_equalities; auto.
Qed.
Lemma l16_9_2 : forall O E E' X Y XY XMY XY2 XMY2,
Col O E X -> Col O E Y -> Is_length O E E' X Y XY ->
Diff O E E' X Y XMY -> Prod O E E' XY XY XY2 -> Prod O E E' XMY XMY XMY2 ->
XY2 = XMY2.
Proof.
(* Goal: forall (O E E' X Y XY XMY XY2 XMY2 : @Tpoint Tn) (_ : @Col Tn O E X) (_ : @Col Tn O E Y) (_ : @Is_length Tn O E E' X Y XY) (_ : @Diff Tn O E E' X Y XMY) (_ : @Prod Tn O E E' XY XY XY2) (_ : @Prod Tn O E E' XMY XMY XMY2), @eq (@Tpoint Tn) XY2 XMY2 *)
intros O E E' X Y XY XMY XY2 XMY2 HCol1 HCol2 HXY HXMY HXY2 HXMY2.
(* Goal: @eq (@Tpoint Tn) XY2 XMY2 *)
assert (HNC : ~ Col O E E') by (apply diff_ar2 in HXMY; unfold Ar2 in *; spliter; Col).
(* Goal: @eq (@Tpoint Tn) XY2 XMY2 *)
assert (H:= HXY); elim H; clear H; intro HXY'; [|spliter; assert_diffs; intuition].
(* Goal: @eq (@Tpoint Tn) XY2 XMY2 *)
elim (length_eq_or_opp O E E' X Y XY XMY); auto; intro HOpp1; treat_equalities; apply prod_uniqueness with O E E' XY XY; auto.
(* Goal: @Prod Tn O E E' XY XY XMY2 *)
destruct (opp_exists O E E' HNC E) as [ME HOpp2]; Col.
(* Goal: @Prod Tn O E E' XY XY XMY2 *)
apply prod_assoc1 with XMY ME XMY; auto; [|apply prod_comm]; apply opp_prod;auto; apply opp_comm; Col.
Qed.
Lemma cong_3_2_cong_4 : forall O E I J S U X Y,
O <> E -> Col O E I -> Col O E J ->
Cong_3 O E I S U X -> Cong_3 O E J S U Y ->
Cong_4 O E I J S U X Y.
Proof.
(* Goal: forall (O E I J S U X Y : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) O E)) (_ : @Col Tn O E I) (_ : @Col Tn O E J) (_ : @Cong_3 Tn O E I S U X) (_ : @Cong_3 Tn O E J S U Y), @Cong_4 Tn O E I J S U X Y *)
intros O E I J S U X Y HOE HCol1 HCol2 HCong1 HCong4.
(* Goal: @Cong_4 Tn O E I J S U X Y *)
destruct HCong1 as [HCong1 [HCong2 HCong3]].
(* Goal: @Cong_4 Tn O E I J S U X Y *)
destruct HCong4 as [HCong4 [HCong5 HCong6]].
(* Goal: @Cong_4 Tn O E I J S U X Y *)
repeat (split; Cong).
(* Goal: @Cong Tn I J X Y *)
apply l4_16 with O E S U; Col.
(* Goal: @FSC Tn O E I J S U X Y *)
repeat (split; Cong).
Qed.
Lemma cong_3_3_cong_5: forall O E I J K S U X Y Z,
O <> E -> Col O E I -> Col O E J -> Col O E K ->
Cong_3 O E I S U X -> Cong_3 O E J S U Y -> Cong_3 O E K S U Z ->
Cong_5 O E I J K S U X Y Z.
Proof.
(* Goal: forall (O E I J K S U X Y Z : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) O E)) (_ : @Col Tn O E I) (_ : @Col Tn O E J) (_ : @Col Tn O E K) (_ : @Cong_3 Tn O E I S U X) (_ : @Cong_3 Tn O E J S U Y) (_ : @Cong_3 Tn O E K S U Z), @Cong_5 Tn O E I J K S U X Y Z *)
intros O E I J K S U X Y Z HOE HCol1 HCol2 HCol3 HCong1 HCong4 HCong7.
(* Goal: @Cong_5 Tn O E I J K S U X Y Z *)
destruct HCong1 as [HCong1 [HCong2 HCong3]].
(* Goal: @Cong_5 Tn O E I J K S U X Y Z *)
destruct HCong4 as [HCong4 [HCong5 HCong6]].
(* Goal: @Cong_5 Tn O E I J K S U X Y Z *)
destruct HCong7 as [HCong7 [HCong8 HCong9]].
(* Goal: @Cong_5 Tn O E I J K S U X Y Z *)
repeat (split; Cong); apply l4_16 with O E S U; Col; repeat (split; Cong).
Qed.
Lemma square_distance_formula_aux : forall O E E' S U1 U2 P PX PY Q QX PXQX,
Cd O E S U1 U2 P PX PY -> Cd O E S U1 U2 Q QX PY ->
P <> Q -> ~ Col O E E' -> Col O E PX -> Col O E QX -> Col O E PY ->
Cs O E S U1 U2 -> Length O E E' PX QX PXQX ->
Length O E E' Q P PXQX.
Lemma square_distance_formula :
forall O E E' S U1 U2 P Q PX PY QX QY PQ PQ2 PXMQX PYMQY PXMQX2 PYMQY2 F,
Cd O E S U1 U2 P PX PY -> Cd O E S U1 U2 Q QX QY -> Is_length O E E' P Q PQ ->
Prod O E E' PQ PQ PQ2 -> Diff O E E' PX QX PXMQX ->
Prod O E E' PXMQX PXMQX PXMQX2 -> Diff O E E' PY QY PYMQY ->
Prod O E E' PYMQY PYMQY PYMQY2 -> Sum O E E' PXMQX2 PYMQY2 F ->
PQ2 = F.
Lemma characterization_of_congruence :
forall O E E' S U1 U2
A AX AY B BX BY C CX CY D DX DY
AXMBX AXMBX2 AYMBY AYMBY2 AB2
CXMDX CXMDX2 CYMDY CYMDY2 CD2,
Cd O E S U1 U2 A AX AY -> Cd O E S U1 U2 B BX BY ->
Cd O E S U1 U2 C CX CY -> Cd O E S U1 U2 D DX DY ->
Diff O E E' AX BX AXMBX -> Prod O E E' AXMBX AXMBX AXMBX2 ->
Diff O E E' AY BY AYMBY -> Prod O E E' AYMBY AYMBY AYMBY2 ->
Sum O E E' AXMBX2 AYMBY2 AB2 ->
Diff O E E' CX DX CXMDX -> Prod O E E' CXMDX CXMDX CXMDX2 ->
Diff O E E' CY DY CYMDY -> Prod O E E' CYMDY CYMDY CYMDY2 ->
Sum O E E' CXMDX2 CYMDY2 CD2 ->
(Cong A B C D <-> AB2 = CD2).
Proof.
(* Goal: forall (O E E' S U1 U2 A AX AY B BX BY C CX CY D DX DY AXMBX AXMBX2 AYMBY AYMBY2 AB2 CXMDX CXMDX2 CYMDY CYMDY2 CD2 : @Tpoint Tn) (_ : @Cd Tn O E S U1 U2 A AX AY) (_ : @Cd Tn O E S U1 U2 B BX BY) (_ : @Cd Tn O E S U1 U2 C CX CY) (_ : @Cd Tn O E S U1 U2 D DX DY) (_ : @Diff Tn O E E' AX BX AXMBX) (_ : @Prod Tn O E E' AXMBX AXMBX AXMBX2) (_ : @Diff Tn O E E' AY BY AYMBY) (_ : @Prod Tn O E E' AYMBY AYMBY AYMBY2) (_ : @Sum Tn O E E' AXMBX2 AYMBY2 AB2) (_ : @Diff Tn O E E' CX DX CXMDX) (_ : @Prod Tn O E E' CXMDX CXMDX CXMDX2) (_ : @Diff Tn O E E' CY DY CYMDY) (_ : @Prod Tn O E E' CYMDY CYMDY CYMDY2) (_ : @Sum Tn O E E' CXMDX2 CYMDY2 CD2), iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2) *)
intros O E E' S U1 U2 A AX AY B BX BY C CX CY D DX DY.
(* Goal: forall (AXMBX AXMBX2 AYMBY AYMBY2 AB2 CXMDX CXMDX2 CYMDY CYMDY2 CD2 : @Tpoint Tn) (_ : @Cd Tn O E S U1 U2 A AX AY) (_ : @Cd Tn O E S U1 U2 B BX BY) (_ : @Cd Tn O E S U1 U2 C CX CY) (_ : @Cd Tn O E S U1 U2 D DX DY) (_ : @Diff Tn O E E' AX BX AXMBX) (_ : @Prod Tn O E E' AXMBX AXMBX AXMBX2) (_ : @Diff Tn O E E' AY BY AYMBY) (_ : @Prod Tn O E E' AYMBY AYMBY AYMBY2) (_ : @Sum Tn O E E' AXMBX2 AYMBY2 AB2) (_ : @Diff Tn O E E' CX DX CXMDX) (_ : @Prod Tn O E E' CXMDX CXMDX CXMDX2) (_ : @Diff Tn O E E' CY DY CYMDY) (_ : @Prod Tn O E E' CYMDY CYMDY CYMDY2) (_ : @Sum Tn O E E' CXMDX2 CYMDY2 CD2), iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2) *)
intros AXMBX AXMBX2 AYMBY AYMBY2 AB2' CXMDX CXMDX2 CYMDY CYMDY2 CD2'.
(* Goal: forall (_ : @Cd Tn O E S U1 U2 A AX AY) (_ : @Cd Tn O E S U1 U2 B BX BY) (_ : @Cd Tn O E S U1 U2 C CX CY) (_ : @Cd Tn O E S U1 U2 D DX DY) (_ : @Diff Tn O E E' AX BX AXMBX) (_ : @Prod Tn O E E' AXMBX AXMBX AXMBX2) (_ : @Diff Tn O E E' AY BY AYMBY) (_ : @Prod Tn O E E' AYMBY AYMBY AYMBY2) (_ : @Sum Tn O E E' AXMBX2 AYMBY2 AB2') (_ : @Diff Tn O E E' CX DX CXMDX) (_ : @Prod Tn O E E' CXMDX CXMDX CXMDX2) (_ : @Diff Tn O E E' CY DY CYMDY) (_ : @Prod Tn O E E' CYMDY CYMDY CYMDY2) (_ : @Sum Tn O E E' CXMDX2 CYMDY2 CD2'), iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
intros HCdA HCdB HCdC HCdD HAXMBX HAXMBX2 HAYMBY HAYMBY2 HAB2.
(* Goal: forall (_ : @Diff Tn O E E' CX DX CXMDX) (_ : @Prod Tn O E E' CXMDX CXMDX CXMDX2) (_ : @Diff Tn O E E' CY DY CYMDY) (_ : @Prod Tn O E E' CYMDY CYMDY CYMDY2) (_ : @Sum Tn O E E' CXMDX2 CYMDY2 CD2'), iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
intros HCXMDX HCXMDX2 HCYMDY HCYMDY2 HCD2.
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
assert (HNC : ~ Col O E E') by (apply diff_ar2 in HAXMBX; unfold Ar2 in *; spliter; Col).
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
destruct (is_length_exists O E E' A B) as [AB HLengthAB]; Col.
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
assert (HColAB : Col O E AB).
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
(* Goal: @Col Tn O E AB *)
{
(* Goal: @Col Tn O E AB *)
unfold Is_length, Length in *; induction HLengthAB; spliter; treat_equalities; Col.
(* BG Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
}
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
destruct (prod_exists O E E' HNC AB AB) as [AB2 HLengthAB2]; Col.
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
assert (AB2 = AB2').
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
(* Goal: @eq (@Tpoint Tn) AB2 AB2' *)
{
(* Goal: @eq (@Tpoint Tn) AB2 AB2' *)
apply square_distance_formula with O E E' S U1 U2 A B AX AY BX BY AB AXMBX AYMBY AXMBX2 AYMBY2; auto.
(* BG Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
}
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2' CD2') *)
treat_equalities; clear HAB2; clear HAYMBY2; clear HAYMBY; clear HAXMBX2; clear HAXMBX; clear HCdA; clear HCdB.
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
destruct (is_length_exists O E E' C D) as [CD HLengthCD]; Col.
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
assert (HColCD : Col O E CD).
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
(* Goal: @Col Tn O E CD *)
{
(* Goal: @Col Tn O E CD *)
unfold Is_length, Length in *; induction HLengthCD; spliter; treat_equalities; Col.
(* BG Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
}
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
destruct (prod_exists O E E' HNC CD CD) as [CD2 HLengthCD2]; Col.
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
assert (CD2 = CD2').
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
(* Goal: @eq (@Tpoint Tn) CD2 CD2' *)
{
(* Goal: @eq (@Tpoint Tn) CD2 CD2' *)
apply square_distance_formula with O E E' S U1 U2 C D CX CY DX DY CD CXMDX CYMDY CXMDX2 CYMDY2; auto.
(* BG Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
}
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2') *)
treat_equalities; clear HCD2; clear HCYMDY2; clear HCYMDY; clear HCXMDX2; clear HCXMDX; clear HCdC; clear HCdD.
(* Goal: iff (@Cong Tn A B C D) (@eq (@Tpoint Tn) AB2 CD2) *)
split; [intro HCong|intro; treat_equalities].
(* Goal: @Cong Tn A B C D *)
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
{
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
assert (H : Cong O AB O CD).
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
(* Goal: @Cong Tn O AB O CD *)
{
(* Goal: @Cong Tn O AB O CD *)
unfold Is_length, Length in *; induction HLengthAB; [|spliter; treat_equalities; exfalso; apply HNC; Col]; induction HLengthCD; [|spliter; treat_equalities; exfalso; apply HNC; Col].
(* Goal: @Cong Tn O AB O CD *)
spliter; apply cong_transitivity with A B; trivial.
(* Goal: @Cong Tn A B O CD *)
apply cong_transitivity with C D; Cong.
(* BG Goal: @Cong Tn A B C D *)
(* BG Goal: @eq (@Tpoint Tn) AB2 CD2 *)
}
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
clear HLengthAB; clear HLengthCD; clear HCong; rename H into HCong.
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
assert (H : Col O AB CD) by (assert_diffs; ColR).
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
elim (l7_20 O AB CD); Col; clear H; clear HCong; intro HMid; treat_equalities.
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
{
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
apply prod_uniqueness with O E E' AB AB; auto.
(* BG Goal: @Cong Tn A B C D *)
(* BG Goal: @eq (@Tpoint Tn) AB2 CD2 *)
}
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
{
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
assert (HOpp1 : Opp O E E' AB CD) by (apply midpoint_opp; unfold Ar2; auto; repeat (split; Col)).
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
clear HMid; destruct (opp_exists O E E' HNC E) as [ME HOpp2]; Col.
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
assert (Prod O E E' AB ME CD) by (apply opp_prod; auto).
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
assert (HXMY2' : Prod O E E' CD CD AB2).
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
(* Goal: @Prod Tn O E E' CD CD AB2 *)
{
(* Goal: @Prod Tn O E E' CD CD AB2 *)
apply prod_assoc1 with AB ME AB; auto.
(* Goal: @Prod Tn O E E' ME CD AB *)
apply prod_assoc2 with ME AB E; try apply prod_1_l; Col; apply prod_comm; auto.
(* Goal: @Prod Tn O E E' ME ME E *)
apply opp_prod; auto; apply opp_comm; auto.
(* BG Goal: @Cong Tn A B C D *)
(* BG Goal: @eq (@Tpoint Tn) AB2 CD2 *)
}
(* Goal: @eq (@Tpoint Tn) AB2 CD2 *)
apply prod_uniqueness with O E E' CD CD; auto.
(* BG Goal: @Cong Tn A B C D *)
}
(* BG Goal: @Cong Tn A B C D *)
}
(* Goal: @Cong Tn A B C D *)
{
(* Goal: @Cong Tn A B C D *)
elim HLengthAB; clear HLengthAB; intro HLengthAB; [|spliter; treat_equalities; exfalso; apply HNC; Col].
(* Goal: @Cong Tn A B C D *)
elim HLengthCD; clear HLengthCD; intro HLengthCD; [|spliter; treat_equalities; exfalso; apply HNC; Col].
(* Goal: @Cong Tn A B C D *)
elim (eq_squares_eq_or_opp O E E' AB CD AB2); auto; intro HOpp; treat_equalities; [apply length_eq_cong_1 with O E E' AB; auto|].
(* Goal: @Cong Tn A B C D *)
unfold Length, LeP, LtP in *; spliter; apply opp_midpoint in HOpp.
(* Goal: @Cong Tn A B C D *)
unfold Midpoint in *; spliter.
(* Goal: @Cong Tn A B C D *)
apply cong_transitivity with O CD; trivial.
(* Goal: @Cong Tn A B O CD *)
apply cong_transitivity with O AB; Cong.
Qed.
Lemma bet_betCood_aux : forall O E S U1 U2 A AX AY B BX BY C CX CY,
Cd O E S U1 U2 A AX AY -> Cd O E S U1 U2 B BX BY -> Cd O E S U1 U2 C CX CY ->
Bet A B C ->
Bet AX BX CX.
Proof.
(* Goal: forall (O E S U1 U2 A AX AY B BX BY C CX CY : @Tpoint Tn) (_ : @Cd Tn O E S U1 U2 A AX AY) (_ : @Cd Tn O E S U1 U2 B BX BY) (_ : @Cd Tn O E S U1 U2 C CX CY) (_ : @Bet Tn A B C), @Bet Tn AX BX CX *)
intros O E S U1 U2 A AX AY B BX BY C CX CY HCdA HCdB HCdC HBet.
(* Goal: @Bet Tn AX BX CX *)
destruct (parallel_existence S U1 A) as [A1 [A2 [HDiff4 [HPar HCol]]]]; try (intro; unfold Cd, Cs in *; spliter; treat_equalities; intuition).
(* Goal: @Bet Tn AX BX CX *)
assert (HAX' := HCdA).
(* Goal: @Bet Tn AX BX CX *)
destruct HAX' as [H [H' [HAX' H'']]]; clear H; clear H'; clear H''.
(* Goal: @Bet Tn AX BX CX *)
destruct HAX' as [AX' [HProjpAX' HCongAX']].
(* Goal: @Bet Tn AX BX CX *)
assert (HA : Projp AX' A A1 A2).
(* Goal: @Bet Tn AX BX CX *)
(* Goal: @Projp Tn AX' A A1 A2 *)
{
(* Goal: @Projp Tn AX' A A1 A2 *)
split; auto; induction (eq_dec_points A AX'); [treat_equalities; right|left; split]; Col.
(* Goal: @Perp Tn A1 A2 AX' A *)
apply par_perp__perp with S U1; auto.
(* Goal: @Perp Tn S U1 AX' A *)
destruct HProjpAX' as [Hclear HAX']; clear Hclear.
(* Goal: @Perp Tn S U1 AX' A *)
induction HAX'; spliter; Perp; intuition.
(* BG Goal: @Bet Tn AX BX CX *)
}
(* Goal: @Bet Tn AX BX CX *)
assert (HBX' := HCdB).
(* Goal: @Bet Tn AX BX CX *)
destruct HBX' as [H [H' [HBX' H'']]]; clear H; clear H'; clear H''.
(* Goal: @Bet Tn AX BX CX *)
destruct HBX' as [BX' [HProjpBX' HCongBX']].
(* Goal: @Bet Tn AX BX CX *)
destruct (exists_projp A1 A2 BX') as [BX'' HBX'']; auto.
(* Goal: @Bet Tn AX BX CX *)
assert (HCX' := HCdC).
(* Goal: @Bet Tn AX BX CX *)
destruct HCX' as [H [H' [HCX' H'']]]; clear H; clear H'; clear H''.
(* Goal: @Bet Tn AX BX CX *)
destruct HCX' as [CX' [HProjpCX' HCongCX']].
(* Goal: @Bet Tn AX BX CX *)
destruct (exists_projp A1 A2 CX') as [CX'' HCX'']; auto.
(* Goal: @Bet Tn AX BX CX *)
assert (HDiff : O <> E) by (unfold Cd, Cs in *; spliter; auto).
(* Goal: @Bet Tn AX BX CX *)
assert (HColAX : Col O E AX).
(* Goal: @Bet Tn AX BX CX *)
(* Goal: @Col Tn O E AX *)
{
(* Goal: @Col Tn O E AX *)
unfold Cd in *; destruct HCdA as [H [H' [[PX [HProjp HCong]] H'']]].
(* Goal: @Col Tn O E AX *)
apply projp_col in HProjp; apply l4_13 with S U1 PX; Cong.
(* BG Goal: @Bet Tn AX BX CX *)
}
(* Goal: @Bet Tn AX BX CX *)
assert (HColBX : Col O E BX).
(* Goal: @Bet Tn AX BX CX *)
(* Goal: @Col Tn O E BX *)
{
(* Goal: @Col Tn O E BX *)
unfold Cd in *; destruct HCdB as [H [H' [[PX [HProjp HCong]] H'']]].
(* Goal: @Col Tn O E BX *)
apply projp_col in HProjp; apply l4_13 with S U1 PX; Cong.
(* BG Goal: @Bet Tn AX BX CX *)
}
(* Goal: @Bet Tn AX BX CX *)
assert (HColCX : Col O E CX).
(* Goal: @Bet Tn AX BX CX *)
(* Goal: @Col Tn O E CX *)
{
(* Goal: @Col Tn O E CX *)
unfold Cd in *; destruct HCdC as [H [H' [[PX [HProjp HCong]] H'']]].
(* Goal: @Col Tn O E CX *)
apply projp_col in HProjp; apply l4_13 with S U1 PX; Cong.
(* BG Goal: @Bet Tn AX BX CX *)
}
(* Goal: @Bet Tn AX BX CX *)
apply l4_6 with AX' BX' CX'.
(* Goal: @Cong_3 Tn AX' BX' CX' AX BX CX *)
(* Goal: @Bet Tn AX' BX' CX' *)
{
(* Goal: @Bet Tn AX' BX' CX' *)
apply projp_preserves_bet with A B C S U1; auto.
(* BG Goal: @Cong_3 Tn AX' BX' CX' AX BX CX *)
}
(* Goal: @Cong_3 Tn AX' BX' CX' AX BX CX *)
{
(* Goal: @Cong_3 Tn AX' BX' CX' AX BX CX *)
assert (Cong_5 O E AX BX CX S U1 AX' BX' CX') by (apply cong_3_3_cong_5; assert_diffs; auto).
(* Goal: @Cong_3 Tn AX' BX' CX' AX BX CX *)
unfold Cong_5 in *; spliter; repeat (split; Cong).
Qed.
Lemma bet_betCood : forall O E S U1 U2 A AX AY B BX BY C CX CY,
Cd O E S U1 U2 A AX AY -> Cd O E S U1 U2 B BX BY -> Cd O E S U1 U2 C CX CY ->
Bet A B C ->
Bet AX BX CX /\ Bet AY BY CY.
Proof.
(* Goal: forall (O E S U1 U2 A AX AY B BX BY C CX CY : @Tpoint Tn) (_ : @Cd Tn O E S U1 U2 A AX AY) (_ : @Cd Tn O E S U1 U2 B BX BY) (_ : @Cd Tn O E S U1 U2 C CX CY) (_ : @Bet Tn A B C), and (@Bet Tn AX BX CX) (@Bet Tn AY BY CY) *)
intros O E S U1 U2 A AX AY B BX BY C CX CY HCdA HCdB HCdC HBet.
(* Goal: and (@Bet Tn AX BX CX) (@Bet Tn AY BY CY) *)
split; [apply bet_betCood_aux with O E S U1 U2 A AY B BY C CY|]; auto.
(* Goal: @Bet Tn AY BY CY *)
apply bet_betCood_aux with O E S U2 U1 A AX B BX C CX; auto; apply coord_exchange_axes; auto.
Qed.
Lemma characterization_of_betweenness_aux : forall O E E' S U1 U2
A AX AY B BX BY C CX CY
BXMAX CXMAX AB AC IAC T,
Cd O E S U1 U2 A AX AY -> Cd O E S U1 U2 B BX BY -> Cd O E S U1 U2 C CX CY ->
~ Col O E E' -> Col O E AX -> Col O E BX -> Col O E CX ->
Col O E BXMAX -> Col O E CXMAX -> Col O E T ->
Col O E AB -> Col O E AC -> Col O E IAC ->
Diff O E E' BX AX BXMAX -> Diff O E E' CX AX CXMAX ->
Length O E E' A B AB -> Length O E E' A C AC ->
Prod O E E' T AC AB -> Prod O E E' IAC AC E ->
Bet A B C -> A <> B -> A <> C -> B <> C ->
Prod O E E' T CXMAX BXMAX.
Unset Regular Subst Tactic.
Lemma characterization_of_betweenness :
forall O E E' S U1 U2
A AX AY B BX BY C CX CY
BXMAX BYMAY CXMAX CYMAY,
Cd O E S U1 U2 A AX AY -> Cd O E S U1 U2 B BX BY -> Cd O E S U1 U2 C CX CY ->
Diff O E E' BX AX BXMAX -> Diff O E E' BY AY BYMAY ->
Diff O E E' CX AX CXMAX -> Diff O E E' CY AY CYMAY ->
(Bet A B C <-> exists T, O <> E /\ Col O E T /\
LeP O E E' O T /\ LeP O E E' T E /\
Prod O E E' T CXMAX BXMAX /\
Prod O E E' T CYMAY BYMAY).
Lemma same_abscissa_col : forall O E S U1 U2 A AX AY B BY C CY,
Cd O E S U1 U2 A AX AY -> Cd O E S U1 U2 B AX BY -> Cd O E S U1 U2 C AX CY ->
Col A B C.
Proof.
(* Goal: forall (O E S U1 U2 A AX AY B BY C CY : @Tpoint Tn) (_ : @Cd Tn O E S U1 U2 A AX AY) (_ : @Cd Tn O E S U1 U2 B AX BY) (_ : @Cd Tn O E S U1 U2 C AX CY), @Col Tn A B C *)
intros O E S U1 U2 A AX AY B BY C CY HCdA HCdB HCdC.
(* Goal: @Col Tn A B C *)
destruct HCdA as [HCs [H [[PXA [HProjpA HCongA]] H']]]; clear H; clear H'.
(* Goal: @Col Tn A B C *)
destruct HCdB as [H [H' [[PXB [HProjpB HCongB]] H'']]]; clear H; clear H'; clear H''.
(* Goal: @Col Tn A B C *)
destruct HCdC as [H [H' [[PXC [HProjpC HCongC]] H'']]]; clear H; clear H'; clear H''.
(* Goal: @Col Tn A B C *)
assert (HDiff1 : O <> E) by (unfold Cs in *; spliter; auto).
(* Goal: @Col Tn A B C *)
assert (HColAX : Col O E AX) by (apply l4_13 with S U1 PXA; Cong; apply projp_col with A; auto).
(* Goal: @Col Tn A B C *)
eapply col_cong_3_cong_3_eq in HCongB; [| | |apply HCongA]; treat_equalities; auto.
(* Goal: @Col Tn A B C *)
eapply col_cong_3_cong_3_eq in HCongC; [| | |apply HCongA]; treat_equalities; auto.
(* Goal: @Col Tn A B C *)
clear HCongA; elim (eq_dec_points A PXA); intro HDiff2; treat_equalities; [apply projp2_col with S U1; auto|].
(* Goal: @Col Tn A B C *)
eapply projp2_col in HProjpB; [|apply HProjpA].
(* Goal: @Col Tn A B C *)
eapply projp2_col in HProjpC; [|apply HProjpA].
(* Goal: @Col Tn A B C *)
ColR.
Qed.
Lemma characterization_of_collinearity :
forall O E E' S U1 U2
A AX AY B BX BY C CX CY
AXMBX AYMBY BXMCX BYMCY XProd YProd,
Cd O E S U1 U2 A AX AY -> Cd O E S U1 U2 B BX BY -> Cd O E S U1 U2 C CX CY ->
Diff O E E' AX BX AXMBX -> Diff O E E' AY BY AYMBY ->
Diff O E E' BX CX BXMCX -> Diff O E E' BY CY BYMCY ->
Prod O E E' AXMBX BYMCY XProd -> Prod O E E' AYMBY BXMCX YProd ->
(Col A B C <-> XProd = YProd).
End T16.
|
Require Import Arith.
Require Import ZArith.
Require Import EqNat.
Require Import dec.
Require Import natZ.
Inductive list (A : Set) : Set :=
| Nil : list A
| Cons : A -> list A -> list A.
Fixpoint length (A : Set) (l : list A) {struct l} : nat :=
match l with
| Nil => 0
| Cons a r => S (length A r)
end.
Lemma length_0 : forall (A : Set) (l : list A), length A l = 0 -> l = Nil A.
Proof.
(* Goal: forall (A : Set) (l : list A) (_ : @eq nat (length A l) O), @eq (list A) l (Nil A) *)
intros A l.
(* Goal: forall _ : @eq nat (length A l) O, @eq (list A) l (Nil A) *)
case l.
(* Goal: forall (a : A) (l : list A) (_ : @eq nat (length A (Cons A a l)) O), @eq (list A) (Cons A a l) (Nil A) *)
(* Goal: forall _ : @eq nat (length A (Nil A)) O, @eq (list A) (Nil A) (Nil A) *)
reflexivity.
(* Goal: forall (a : A) (l : list A) (_ : @eq nat (length A (Cons A a l)) O), @eq (list A) (Cons A a l) (Nil A) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : @eq nat (S (length A l)) O), @eq (list A) (Cons A a l) (Nil A) *)
intros.
(* Goal: @eq (list A) (Cons A a l0) (Nil A) *)
discriminate H.
Qed.
Lemma length_S :
forall (A : Set) (l : list A) (n : nat),
length A l = S n ->
exists h : A, (exists t : list A, l = Cons A h t /\ length A t = n).
Proof.
(* Goal: forall (A : Set) (l : list A) (n : nat) (_ : @eq nat (length A l) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) l (Cons A h t)) (@eq nat (length A t) n))) *)
intros A l.
(* Goal: forall (n : nat) (_ : @eq nat (length A l) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) l (Cons A h t)) (@eq nat (length A t) n))) *)
case l.
(* Goal: forall (a : A) (l : list A) (n : nat) (_ : @eq nat (length A (Cons A a l)) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A a l) (Cons A h t)) (@eq nat (length A t) n))) *)
(* Goal: forall (n : nat) (_ : @eq nat (length A (Nil A)) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Nil A) (Cons A h t)) (@eq nat (length A t) n))) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (n : nat) (_ : @eq nat (length A (Cons A a l)) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A a l) (Cons A h t)) (@eq nat (length A t) n))) *)
(* Goal: forall (n : nat) (_ : @eq nat O (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Nil A) (Cons A h t)) (@eq nat (length A t) n))) *)
intros.
(* Goal: forall (a : A) (l : list A) (n : nat) (_ : @eq nat (length A (Cons A a l)) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A a l) (Cons A h t)) (@eq nat (length A t) n))) *)
(* Goal: @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Nil A) (Cons A h t)) (@eq nat (length A t) n))) *)
discriminate H.
(* Goal: forall (a : A) (l : list A) (n : nat) (_ : @eq nat (length A (Cons A a l)) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A a l) (Cons A h t)) (@eq nat (length A t) n))) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (n : nat) (_ : @eq nat (S (length A l)) (S n)), @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A a l) (Cons A h t)) (@eq nat (length A t) n))) *)
intros h0 t0 n H.
(* Goal: @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A h0 t0) (Cons A h t)) (@eq nat (length A t) n))) *)
injection H.
(* Goal: forall _ : @eq nat (length A t0) n, @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A h0 t0) (Cons A h t)) (@eq nat (length A t) n))) *)
intro.
(* Goal: @ex A (fun h : A => @ex (list A) (fun t : list A => and (@eq (list A) (Cons A h0 t0) (Cons A h t)) (@eq nat (length A t) n))) *)
split with h0.
(* Goal: @ex (list A) (fun t : list A => and (@eq (list A) (Cons A h0 t0) (Cons A h0 t)) (@eq nat (length A t) n)) *)
split with t0.
(* Goal: and (@eq (list A) (Cons A h0 t0) (Cons A h0 t0)) (@eq nat (length A t0) n) *)
split.
(* Goal: @eq nat (length A t0) n *)
(* Goal: @eq (list A) (Cons A h0 t0) (Cons A h0 t0) *)
reflexivity.
(* Goal: @eq nat (length A t0) n *)
assumption.
Qed.
Fixpoint map (A B : Set) (f : A -> B) (l : list A) {struct l} :
list B :=
match l with
| Nil => Nil B
| Cons a r => Cons B (f a) (map A B f r)
end.
Notation Map := (map _ _) (only parsing).
Lemma map_length :
forall (A B : Set) (f : A -> B) (l : list A),
length A l = length B (map A B f l).
Proof.
(* Goal: forall (A B : Set) (f : forall _ : A, B) (l : list A), @eq nat (length A l) (length B (map A B f l)) *)
simple induction l.
(* Goal: forall (a : A) (l : list A) (_ : @eq nat (length A l) (length B (map A B f l))), @eq nat (length A (Cons A a l)) (length B (map A B f (Cons A a l))) *)
(* Goal: @eq nat (length A (Nil A)) (length B (map A B f (Nil A))) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : @eq nat (length A l) (length B (map A B f l))), @eq nat (length A (Cons A a l)) (length B (map A B f (Cons A a l))) *)
(* Goal: @eq nat O O *)
reflexivity.
(* Goal: forall (a : A) (l : list A) (_ : @eq nat (length A l) (length B (map A B f l))), @eq nat (length A (Cons A a l)) (length B (map A B f (Cons A a l))) *)
simpl in |- *.
(* Goal: forall (_ : A) (l : list A) (_ : @eq nat (length A l) (length B (map A B f l))), @eq nat (S (length A l)) (S (length B (map A B f l))) *)
intros.
(* Goal: @eq nat (S (length A l0)) (S (length B (map A B f l0))) *)
rewrite H.
(* Goal: @eq nat (S (length B (map A B f l0))) (S (length B (map A B f l0))) *)
reflexivity.
Qed.
Fixpoint alllist (A : Set) (P : A -> Prop) (qlist : list A) {struct qlist} :
Prop :=
match qlist with
| Nil => True
| Cons m l => P m /\ alllist A P l
end.
Lemma alllist_dec :
forall (A : Set) (P : A -> Prop) (l : list A),
(forall x : A, P x \/ ~ P x) -> alllist A P l \/ ~ alllist A P l.
Proof.
(* Goal: forall (A : Set) (P : forall _ : A, Prop) (l : list A) (_ : forall x : A, or (P x) (not (P x))), or (alllist A P l) (not (alllist A P l)) *)
simple induction l.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (alllist A P l) (not (alllist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (alllist A P (Cons A a l)) (not (alllist A P (Cons A a l))) *)
(* Goal: forall _ : forall x : A, or (P x) (not (P x)), or (alllist A P (Nil A)) (not (alllist A P (Nil A))) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (alllist A P l) (not (alllist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (alllist A P (Cons A a l)) (not (alllist A P (Cons A a l))) *)
(* Goal: forall _ : forall x : A, or (P x) (not (P x)), or True (not True) *)
left.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (alllist A P l) (not (alllist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (alllist A P (Cons A a l)) (not (alllist A P (Cons A a l))) *)
(* Goal: True *)
trivial.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (alllist A P l) (not (alllist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (alllist A P (Cons A a l)) (not (alllist A P (Cons A a l))) *)
intros h t IH H.
(* Goal: or (alllist A P (Cons A h t)) (not (alllist A P (Cons A h t))) *)
simpl in |- *.
(* Goal: or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
elim IH.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall _ : alllist A P t, or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
elim (H h).
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall (_ : not (P h)) (_ : alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall (_ : P h) (_ : alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
left.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall (_ : not (P h)) (_ : alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: and (P h) (alllist A P t) *)
split.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall (_ : not (P h)) (_ : alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: alllist A P t *)
(* Goal: P h *)
assumption.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall (_ : not (P h)) (_ : alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: alllist A P t *)
assumption.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall (_ : not (P h)) (_ : alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
right.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: not (and (P h) (alllist A P t)) *)
intro.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: False *)
apply H0.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: P h *)
elim H2.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: forall (_ : P h) (_ : alllist A P t), P h *)
intros.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
(* Goal: P h *)
assumption.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : not (alllist A P t), or (and (P h) (alllist A P t)) (not (and (P h) (alllist A P t))) *)
right.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: not (and (P h) (alllist A P t)) *)
intro.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: False *)
apply H0.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: alllist A P t *)
elim H1.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall (_ : P h) (_ : alllist A P t), alllist A P t *)
intros.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: alllist A P t *)
assumption.
(* Goal: forall x : A, or (P x) (not (P x)) *)
assumption.
Qed.
Fixpoint exlist (A : Set) (P : A -> Prop) (qlist : list A) {struct qlist} :
Prop :=
match qlist with
| Nil => False
| Cons m l => P m \/ exlist A P l
end.
Lemma exlist_dec :
forall (A : Set) (P : A -> Prop) (l : list A),
(forall x : A, P x \/ ~ P x) -> exlist A P l \/ ~ exlist A P l.
Proof.
(* Goal: forall (A : Set) (P : forall _ : A, Prop) (l : list A) (_ : forall x : A, or (P x) (not (P x))), or (exlist A P l) (not (exlist A P l)) *)
simple induction l.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (exlist A P l) (not (exlist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (exlist A P (Cons A a l)) (not (exlist A P (Cons A a l))) *)
(* Goal: forall _ : forall x : A, or (P x) (not (P x)), or (exlist A P (Nil A)) (not (exlist A P (Nil A))) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (exlist A P l) (not (exlist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (exlist A P (Cons A a l)) (not (exlist A P (Cons A a l))) *)
(* Goal: forall _ : forall x : A, or (P x) (not (P x)), or False (not False) *)
right.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (exlist A P l) (not (exlist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (exlist A P (Cons A a l)) (not (exlist A P (Cons A a l))) *)
(* Goal: not False *)
intro.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (exlist A P l) (not (exlist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (exlist A P (Cons A a l)) (not (exlist A P (Cons A a l))) *)
(* Goal: False *)
assumption.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall x : A, or (P x) (not (P x)), or (exlist A P l) (not (exlist A P l))) (_ : forall x : A, or (P x) (not (P x))), or (exlist A P (Cons A a l)) (not (exlist A P (Cons A a l))) *)
intros h t IH H.
(* Goal: or (exlist A P (Cons A h t)) (not (exlist A P (Cons A h t))) *)
simpl in |- *.
(* Goal: or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
elim (H h).
(* Goal: forall _ : not (P h), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
(* Goal: forall _ : P h, or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
left.
(* Goal: forall _ : not (P h), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
(* Goal: or (P h) (exlist A P t) *)
left.
(* Goal: forall _ : not (P h), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
(* Goal: P h *)
assumption.
(* Goal: forall _ : not (P h), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
elim IH.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall (_ : not (exlist A P t)) (_ : not (P h)), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
(* Goal: forall (_ : exlist A P t) (_ : not (P h)), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
left.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall (_ : not (exlist A P t)) (_ : not (P h)), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
(* Goal: or (P h) (exlist A P t) *)
right.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall (_ : not (exlist A P t)) (_ : not (P h)), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
(* Goal: exlist A P t *)
assumption.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall (_ : not (exlist A P t)) (_ : not (P h)), or (or (P h) (exlist A P t)) (not (or (P h) (exlist A P t))) *)
right.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: not (or (P h) (exlist A P t)) *)
intro.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: False *)
elim H2.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : exlist A P t, False *)
(* Goal: forall _ : P h, False *)
assumption.
(* Goal: forall x : A, or (P x) (not (P x)) *)
(* Goal: forall _ : exlist A P t, False *)
assumption.
(* Goal: forall x : A, or (P x) (not (P x)) *)
assumption.
Qed.
Definition inlist (A : Set) (a : A) := exlist A (fun b : A => a = b).
Lemma inlist_head_eq :
forall (A : Set) (x y : A) (l : list A), x = y -> inlist A x (Cons A y l).
Proof.
(* Goal: forall (A : Set) (x y : A) (l : list A) (_ : @eq A x y), inlist A x (Cons A y l) *)
intros.
(* Goal: inlist A x (Cons A y l) *)
unfold inlist in |- *.
(* Goal: exlist A (fun b : A => @eq A x b) (Cons A y l) *)
simpl in |- *.
(* Goal: or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
left.
(* Goal: @eq A x y *)
assumption.
Qed.
Lemma inlist_head_neq :
forall (A : Set) (x y : A) (l : list A),
x <> y -> (inlist A x (Cons A y l) <-> inlist A x l).
Proof.
(* Goal: forall (A : Set) (x y : A) (l : list A) (_ : not (@eq A x y)), iff (inlist A x (Cons A y l)) (inlist A x l) *)
intros.
(* Goal: iff (inlist A x (Cons A y l)) (inlist A x l) *)
unfold inlist in |- *.
(* Goal: iff (exlist A (fun b : A => @eq A x b) (Cons A y l)) (exlist A (fun b : A => @eq A x b) l) *)
simpl in |- *.
(* Goal: iff (or (@eq A x y) (exlist A (fun b : A => @eq A x b) l)) (exlist A (fun b : A => @eq A x b) l) *)
split.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
(* Goal: forall _ : or (@eq A x y) (exlist A (fun b : A => @eq A x b) l), exlist A (fun b : A => @eq A x b) l *)
intros.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
(* Goal: exlist A (fun b : A => @eq A x b) l *)
elim H0.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, exlist A (fun b : A => @eq A x b) l *)
(* Goal: forall _ : @eq A x y, exlist A (fun b : A => @eq A x b) l *)
intro.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, exlist A (fun b : A => @eq A x b) l *)
(* Goal: exlist A (fun b : A => @eq A x b) l *)
elim H.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, exlist A (fun b : A => @eq A x b) l *)
(* Goal: @eq A x y *)
assumption.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, exlist A (fun b : A => @eq A x b) l *)
intros.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
(* Goal: exlist A (fun b : A => @eq A x b) l *)
assumption.
(* Goal: forall _ : exlist A (fun b : A => @eq A x b) l, or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
intros.
(* Goal: or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
right.
(* Goal: exlist A (fun b : A => @eq A x b) l *)
assumption.
Qed.
Lemma inlist_tail :
forall (A : Set) (x y : A) (l : list A),
inlist A x l -> inlist A x (Cons A y l).
Proof.
(* Goal: forall (A : Set) (x y : A) (l : list A) (_ : inlist A x l), inlist A x (Cons A y l) *)
intros.
(* Goal: inlist A x (Cons A y l) *)
unfold inlist in |- *.
(* Goal: exlist A (fun b : A => @eq A x b) (Cons A y l) *)
simpl in |- *.
(* Goal: or (@eq A x y) (exlist A (fun b : A => @eq A x b) l) *)
right.
(* Goal: exlist A (fun b : A => @eq A x b) l *)
assumption.
Qed.
Lemma inlist_dec :
forall (A : Set) (x : A) (l : list A),
(forall a b : A, a = b \/ a <> b) -> inlist A x l \/ ~ inlist A x l.
Proof.
(* Goal: forall (A : Set) (x : A) (l : list A) (_ : forall a b : A, or (@eq A a b) (not (@eq A a b))), or (inlist A x l) (not (inlist A x l)) *)
intros.
(* Goal: or (inlist A x l) (not (inlist A x l)) *)
unfold inlist in |- *.
(* Goal: or (exlist A (fun b : A => @eq A x b) l) (not (exlist A (fun b : A => @eq A x b) l)) *)
apply exlist_dec.
(* Goal: forall x0 : A, or (@eq A x x0) (not (@eq A x x0)) *)
exact (H x).
Qed.
Theorem alllist_ok :
forall (A : Set) (P : A -> Prop) (qlist : list A),
alllist A P qlist <-> (forall q : A, inlist A q qlist -> P q).
Proof.
(* Goal: forall (A : Set) (P : forall _ : A, Prop) (qlist : list A), iff (alllist A P qlist) (forall (q : A) (_ : inlist A q qlist), P q) *)
split.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (_ : alllist A P qlist) (q : A) (_ : inlist A q qlist), P q *)
elim qlist.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall (_ : alllist A P l) (q : A) (_ : inlist A q l), P q) (_ : alllist A P (Cons A a l)) (q : A) (_ : inlist A q (Cons A a l)), P q *)
(* Goal: forall (_ : alllist A P (Nil A)) (q : A) (_ : inlist A q (Nil A)), P q *)
unfold inlist in |- *.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall (_ : alllist A P l) (q : A) (_ : inlist A q l), P q) (_ : alllist A P (Cons A a l)) (q : A) (_ : inlist A q (Cons A a l)), P q *)
(* Goal: forall (_ : alllist A P (Nil A)) (q : A) (_ : exlist A (fun b : A => @eq A q b) (Nil A)), P q *)
simpl in |- *.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall (_ : alllist A P l) (q : A) (_ : inlist A q l), P q) (_ : alllist A P (Cons A a l)) (q : A) (_ : inlist A q (Cons A a l)), P q *)
(* Goal: forall (_ : True) (q : A) (_ : False), P q *)
intros.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall (_ : alllist A P l) (q : A) (_ : inlist A q l), P q) (_ : alllist A P (Cons A a l)) (q : A) (_ : inlist A q (Cons A a l)), P q *)
(* Goal: P q *)
elim H0.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall (_ : alllist A P l) (q : A) (_ : inlist A q l), P q) (_ : alllist A P (Cons A a l)) (q : A) (_ : inlist A q (Cons A a l)), P q *)
unfold inlist in |- *.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall (_ : alllist A P l) (q : A) (_ : exlist A (fun b : A => @eq A q b) l), P q) (_ : alllist A P (Cons A a l)) (q : A) (_ : exlist A (fun b : A => @eq A q b) (Cons A a l)), P q *)
simpl in |- *.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall (_ : alllist A P l) (q : A) (_ : exlist A (fun b : A => @eq A q b) l), P q) (_ : and (P a) (alllist A P l)) (q : A) (_ : or (@eq A q a) (exlist A (fun b : A => @eq A q b) l)), P q *)
intros q l IH H.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (q0 : A) (_ : or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)), P q0 *)
elim H.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall (_ : P q) (_ : alllist A P l) (q0 : A) (_ : or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)), P q0 *)
intros.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: P q0 *)
elim H2.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall _ : exlist A (fun b : A => @eq A q0 b) l, P q0 *)
(* Goal: forall _ : @eq A q0 q, P q0 *)
intro.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall _ : exlist A (fun b : A => @eq A q0 b) l, P q0 *)
(* Goal: P q0 *)
rewrite H3.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall _ : exlist A (fun b : A => @eq A q0 b) l, P q0 *)
(* Goal: P q *)
assumption.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: forall _ : exlist A (fun b : A => @eq A q0 b) l, P q0 *)
intro.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: P q0 *)
apply IH.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: exlist A (fun b : A => @eq A q0 b) l *)
(* Goal: alllist A P l *)
assumption.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
(* Goal: exlist A (fun b : A => @eq A q0 b) l *)
assumption.
(* Goal: forall _ : forall (q : A) (_ : inlist A q qlist), P q, alllist A P qlist *)
elim qlist.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall (q : A) (_ : inlist A q l), P q, alllist A P l) (_ : forall (q : A) (_ : inlist A q (Cons A a l)), P q), alllist A P (Cons A a l) *)
(* Goal: forall _ : forall (q : A) (_ : inlist A q (Nil A)), P q, alllist A P (Nil A) *)
unfold inlist in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall (q : A) (_ : inlist A q l), P q, alllist A P l) (_ : forall (q : A) (_ : inlist A q (Cons A a l)), P q), alllist A P (Cons A a l) *)
(* Goal: forall _ : forall (q : A) (_ : exlist A (fun b : A => @eq A q b) (Nil A)), P q, alllist A P (Nil A) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall (q : A) (_ : inlist A q l), P q, alllist A P l) (_ : forall (q : A) (_ : inlist A q (Cons A a l)), P q), alllist A P (Cons A a l) *)
(* Goal: forall _ : forall (q : A) (_ : False), P q, True *)
intros.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall (q : A) (_ : inlist A q l), P q, alllist A P l) (_ : forall (q : A) (_ : inlist A q (Cons A a l)), P q), alllist A P (Cons A a l) *)
(* Goal: True *)
trivial.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall (q : A) (_ : inlist A q l), P q, alllist A P l) (_ : forall (q : A) (_ : inlist A q (Cons A a l)), P q), alllist A P (Cons A a l) *)
unfold inlist in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall (q : A) (_ : exlist A (fun b : A => @eq A q b) l), P q, alllist A P l) (_ : forall (q : A) (_ : exlist A (fun b : A => @eq A q b) (Cons A a l)), P q), alllist A P (Cons A a l) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : forall (q : A) (_ : exlist A (fun b : A => @eq A q b) l), P q, alllist A P l) (_ : forall (q : A) (_ : or (@eq A q a) (exlist A (fun b : A => @eq A q b) l)), P q), and (P a) (alllist A P l) *)
intros q l IH H.
(* Goal: and (P q) (alllist A P l) *)
split.
(* Goal: alllist A P l *)
(* Goal: P q *)
apply H.
(* Goal: alllist A P l *)
(* Goal: or (@eq A q q) (exlist A (fun b : A => @eq A q b) l) *)
left.
(* Goal: alllist A P l *)
(* Goal: @eq A q q *)
reflexivity.
(* Goal: alllist A P l *)
apply IH.
(* Goal: forall (q : A) (_ : exlist A (fun b : A => @eq A q b) l), P q *)
intros.
(* Goal: P q0 *)
apply H.
(* Goal: or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l) *)
right.
(* Goal: exlist A (fun b : A => @eq A q0 b) l *)
assumption.
Qed.
Theorem exlist_ok :
forall (A : Set) (P : A -> Prop) (qlist : list A),
exlist A P qlist <-> (exists q : A, inlist A q qlist /\ P q).
Proof.
(* Goal: forall (A : Set) (P : forall _ : A, Prop) (qlist : list A), iff (exlist A P qlist) (@ex A (fun q : A => and (inlist A q qlist) (P q))) *)
split.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P qlist, @ex A (fun q : A => and (inlist A q qlist) (P q)) *)
elim qlist.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall _ : exlist A P l, @ex A (fun q : A => and (inlist A q l) (P q))) (_ : exlist A P (Cons A a l)), @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q)) *)
(* Goal: forall _ : exlist A P (Nil A), @ex A (fun q : A => and (inlist A q (Nil A)) (P q)) *)
unfold inlist in |- *.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall _ : exlist A P l, @ex A (fun q : A => and (inlist A q l) (P q))) (_ : exlist A P (Cons A a l)), @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q)) *)
(* Goal: forall _ : exlist A P (Nil A), @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) (Nil A)) (P q)) *)
simpl in |- *.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall _ : exlist A P l, @ex A (fun q : A => and (inlist A q l) (P q))) (_ : exlist A P (Cons A a l)), @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q)) *)
(* Goal: forall _ : False, @ex A (fun q : A => and False (P q)) *)
intros.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall _ : exlist A P l, @ex A (fun q : A => and (inlist A q l) (P q))) (_ : exlist A P (Cons A a l)), @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q)) *)
(* Goal: @ex A (fun q : A => and False (P q)) *)
elim H.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall _ : exlist A P l, @ex A (fun q : A => and (inlist A q l) (P q))) (_ : exlist A P (Cons A a l)), @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q)) *)
unfold inlist in |- *.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall _ : exlist A P l, @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) l) (P q))) (_ : exlist A P (Cons A a l)), @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) (Cons A a l)) (P q)) *)
simpl in |- *.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall (a : A) (l : list A) (_ : forall _ : exlist A P l, @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) l) (P q))) (_ : or (P a) (exlist A P l)), @ex A (fun q : A => and (or (@eq A q a) (exlist A (fun b : A => @eq A q b) l)) (P q)) *)
intros q l IH H.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
elim H.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P l, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
(* Goal: forall _ : P q, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
intro.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P l, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
(* Goal: @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
split with q.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P l, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
(* Goal: and (or (@eq A q q) (exlist A (fun b : A => @eq A q b) l)) (P q) *)
split.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P l, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
(* Goal: P q *)
(* Goal: or (@eq A q q) (exlist A (fun b : A => @eq A q b) l) *)
left.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P l, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
(* Goal: P q *)
(* Goal: @eq A q q *)
reflexivity.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P l, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
(* Goal: P q *)
assumption.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: forall _ : exlist A P l, @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
intro.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
elim IH.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: forall (x : A) (_ : and (exlist A (fun b : A => @eq A x b) l) (P x)), @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
intros q1 Hq1.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
elim Hq1.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: forall (_ : exlist A (fun b : A => @eq A q1 b) l) (_ : P q1), @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
intros.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: @ex A (fun q0 : A => and (or (@eq A q0 q) (exlist A (fun b : A => @eq A q0 b) l)) (P q0)) *)
split with q1.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: and (or (@eq A q1 q) (exlist A (fun b : A => @eq A q1 b) l)) (P q1) *)
split.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: P q1 *)
(* Goal: or (@eq A q1 q) (exlist A (fun b : A => @eq A q1 b) l) *)
right.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: P q1 *)
(* Goal: exlist A (fun b : A => @eq A q1 b) l *)
assumption.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
(* Goal: P q1 *)
assumption.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
(* Goal: exlist A P l *)
assumption.
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q qlist) (P q)), exlist A P qlist *)
elim qlist.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: forall _ : @ex A (fun q : A => and (inlist A q (Nil A)) (P q)), exlist A P (Nil A) *)
unfold inlist in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: forall _ : @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) (Nil A)) (P q)), exlist A P (Nil A) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: forall _ : @ex A (fun q : A => and False (P q)), False *)
intros.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: False *)
elim H.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: forall (x : A) (_ : and False (P x)), False *)
intros.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: False *)
elim H0.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: forall (_ : False) (_ : P x), False *)
intros.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
(* Goal: False *)
elim H1.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (inlist A q l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (inlist A q (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
unfold inlist in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) (Cons A a l)) (P q))), exlist A P (Cons A a l) *)
simpl in |- *.
(* Goal: forall (a : A) (l : list A) (_ : forall _ : @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) l) (P q)), exlist A P l) (_ : @ex A (fun q : A => and (or (@eq A q a) (exlist A (fun b : A => @eq A q b) l)) (P q))), or (P a) (exlist A P l) *)
intros q l IH H.
(* Goal: or (P q) (exlist A P l) *)
elim H.
(* Goal: forall (x : A) (_ : and (or (@eq A x q) (exlist A (fun b : A => @eq A x b) l)) (P x)), or (P q) (exlist A P l) *)
intros q1 Hq1.
(* Goal: or (P q) (exlist A P l) *)
elim Hq1.
(* Goal: forall (_ : or (@eq A q1 q) (exlist A (fun b : A => @eq A q1 b) l)) (_ : P q1), or (P q) (exlist A P l) *)
intros.
(* Goal: or (P q) (exlist A P l) *)
elim H0.
(* Goal: forall _ : exlist A (fun b : A => @eq A q1 b) l, or (P q) (exlist A P l) *)
(* Goal: forall _ : @eq A q1 q, or (P q) (exlist A P l) *)
intro.
(* Goal: forall _ : exlist A (fun b : A => @eq A q1 b) l, or (P q) (exlist A P l) *)
(* Goal: or (P q) (exlist A P l) *)
left.
(* Goal: forall _ : exlist A (fun b : A => @eq A q1 b) l, or (P q) (exlist A P l) *)
(* Goal: P q *)
rewrite <- H2.
(* Goal: forall _ : exlist A (fun b : A => @eq A q1 b) l, or (P q) (exlist A P l) *)
(* Goal: P q1 *)
assumption.
(* Goal: forall _ : exlist A (fun b : A => @eq A q1 b) l, or (P q) (exlist A P l) *)
intro.
(* Goal: or (P q) (exlist A P l) *)
right.
(* Goal: exlist A P l *)
apply IH.
(* Goal: @ex A (fun q : A => and (exlist A (fun b : A => @eq A q b) l) (P q)) *)
split with q1.
(* Goal: and (exlist A (fun b : A => @eq A q1 b) l) (P q1) *)
split.
(* Goal: P q1 *)
(* Goal: exlist A (fun b : A => @eq A q1 b) l *)
assumption.
(* Goal: P q1 *)
assumption.
Qed.
Definition natlist := list nat.
Fixpoint product (qlist : natlist) : nat :=
match qlist with
| Nil => 1
| Cons m l => m * product l
end.
Fixpoint drop (q : nat) (qlist : natlist) {struct qlist} : natlist :=
match qlist with
| Nil => Nil nat
| Cons q' l => if beq_nat q q' then l else Cons nat q' (drop q l)
end.
Definition multDrop (q : nat) (l : natlist) := product (drop q l).
Lemma multdrop_cons_eq :
forall (q : nat) (l : natlist), multDrop q (Cons nat q l) = product l.
Proof.
(* Goal: forall (q : nat) (l : natlist), @eq nat (multDrop q (Cons nat q l)) (product l) *)
unfold multDrop in |- *.
(* Goal: forall (q : nat) (l : natlist), @eq nat (product (drop q (Cons nat q l))) (product l) *)
simpl in |- *.
(* Goal: forall (q : nat) (l : natlist), @eq nat (product (if Nat.eqb q q then l else Cons nat q (drop q l))) (product l) *)
intros.
(* Goal: @eq nat (product (if Nat.eqb q q then l else Cons nat q (drop q l))) (product l) *)
elim (beq_nat_eq q q).
(* Goal: forall (_ : forall _ : @eq nat q q, @eq bool (Nat.eqb q q) true) (_ : forall _ : @eq bool (Nat.eqb q q) true, @eq nat q q), @eq nat (product (if Nat.eqb q q then l else Cons nat q (drop q l))) (product l) *)
intros.
(* Goal: @eq nat (product (if Nat.eqb q q then l else Cons nat q (drop q l))) (product l) *)
rewrite H.
(* Goal: @eq nat q q *)
(* Goal: @eq nat (product l) (product l) *)
reflexivity.
(* Goal: @eq nat q q *)
reflexivity.
Qed.
Lemma multdrop_cons_neq :
forall (p q : nat) (l : natlist),
p <> q -> multDrop p (Cons nat q l) = q * multDrop p l.
Proof.
(* Goal: forall (p q : nat) (l : natlist) (_ : not (@eq nat p q)), @eq nat (multDrop p (Cons nat q l)) (Init.Nat.mul q (multDrop p l)) *)
unfold multDrop in |- *.
(* Goal: forall (p q : nat) (l : natlist) (_ : not (@eq nat p q)), @eq nat (product (drop p (Cons nat q l))) (Init.Nat.mul q (product (drop p l))) *)
simpl in |- *.
(* Goal: forall (p q : nat) (l : natlist) (_ : not (@eq nat p q)), @eq nat (product (if Nat.eqb p q then l else Cons nat q (drop p l))) (Init.Nat.mul q (product (drop p l))) *)
intros.
(* Goal: @eq nat (product (if Nat.eqb p q then l else Cons nat q (drop p l))) (Init.Nat.mul q (product (drop p l))) *)
elim (beq_nat_neq p q).
(* Goal: forall (_ : forall _ : not (@eq nat p q), @eq bool (Nat.eqb p q) false) (_ : forall _ : @eq bool (Nat.eqb p q) false, not (@eq nat p q)), @eq nat (product (if Nat.eqb p q then l else Cons nat q (drop p l))) (Init.Nat.mul q (product (drop p l))) *)
intros.
(* Goal: @eq nat (product (if Nat.eqb p q then l else Cons nat q (drop p l))) (Init.Nat.mul q (product (drop p l))) *)
rewrite H0.
(* Goal: not (@eq nat p q) *)
(* Goal: @eq nat (product (Cons nat q (drop p l))) (Init.Nat.mul q (product (drop p l))) *)
simpl in |- *.
(* Goal: not (@eq nat p q) *)
(* Goal: @eq nat (Init.Nat.mul q (product (drop p l))) (Init.Nat.mul q (product (drop p l))) *)
reflexivity.
(* Goal: not (@eq nat p q) *)
assumption.
Qed.
Lemma multdrop_mult :
forall (qlist : natlist) (q : nat),
inlist nat q qlist -> q * multDrop q qlist = product qlist.
Proof.
(* Goal: forall (qlist : natlist) (q : nat) (_ : inlist nat q qlist), @eq nat (Init.Nat.mul q (multDrop q qlist)) (product qlist) *)
simple induction qlist.
(* Goal: forall (a : nat) (l : list nat) (_ : forall (q : nat) (_ : inlist nat q l), @eq nat (Init.Nat.mul q (multDrop q l)) (product l)) (q : nat) (_ : inlist nat q (Cons nat a l)), @eq nat (Init.Nat.mul q (multDrop q (Cons nat a l))) (product (Cons nat a l)) *)
(* Goal: forall (q : nat) (_ : inlist nat q (Nil nat)), @eq nat (Init.Nat.mul q (multDrop q (Nil nat))) (product (Nil nat)) *)
simpl in |- *.
(* Goal: forall (a : nat) (l : list nat) (_ : forall (q : nat) (_ : inlist nat q l), @eq nat (Init.Nat.mul q (multDrop q l)) (product l)) (q : nat) (_ : inlist nat q (Cons nat a l)), @eq nat (Init.Nat.mul q (multDrop q (Cons nat a l))) (product (Cons nat a l)) *)
(* Goal: forall (q : nat) (_ : inlist nat q (Nil nat)), @eq nat (Init.Nat.mul q (multDrop q (Nil nat))) (S O) *)
intros.
(* Goal: forall (a : nat) (l : list nat) (_ : forall (q : nat) (_ : inlist nat q l), @eq nat (Init.Nat.mul q (multDrop q l)) (product l)) (q : nat) (_ : inlist nat q (Cons nat a l)), @eq nat (Init.Nat.mul q (multDrop q (Cons nat a l))) (product (Cons nat a l)) *)
(* Goal: @eq nat (Init.Nat.mul q (multDrop q (Nil nat))) (S O) *)
elim H.
(* Goal: forall (a : nat) (l : list nat) (_ : forall (q : nat) (_ : inlist nat q l), @eq nat (Init.Nat.mul q (multDrop q l)) (product l)) (q : nat) (_ : inlist nat q (Cons nat a l)), @eq nat (Init.Nat.mul q (multDrop q (Cons nat a l))) (product (Cons nat a l)) *)
simpl in |- *.
(* Goal: forall (a : nat) (l : list nat) (_ : forall (q : nat) (_ : inlist nat q l), @eq nat (Init.Nat.mul q (multDrop q l)) (product l)) (q : nat) (_ : inlist nat q (Cons nat a l)), @eq nat (Init.Nat.mul q (multDrop q (Cons nat a l))) (Init.Nat.mul a (product l)) *)
intros q1 l IH.
(* Goal: forall (q : nat) (_ : inlist nat q (Cons nat q1 l)), @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
intros.
(* Goal: @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
elim (eqdec q q1).
(* Goal: forall _ : not (@eq nat q q1), @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
(* Goal: forall _ : @eq nat q q1, @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
intro.
(* Goal: forall _ : not (@eq nat q q1), @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
(* Goal: @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
rewrite H0.
(* Goal: forall _ : not (@eq nat q q1), @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
(* Goal: @eq nat (Init.Nat.mul q1 (multDrop q1 (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
rewrite multdrop_cons_eq.
(* Goal: forall _ : not (@eq nat q q1), @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
(* Goal: @eq nat (Init.Nat.mul q1 (product l)) (Init.Nat.mul q1 (product l)) *)
reflexivity.
(* Goal: forall _ : not (@eq nat q q1), @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
intro.
(* Goal: @eq nat (Init.Nat.mul q (multDrop q (Cons nat q1 l))) (Init.Nat.mul q1 (product l)) *)
rewrite multdrop_cons_neq.
(* Goal: not (@eq nat q q1) *)
(* Goal: @eq nat (Init.Nat.mul q (Init.Nat.mul q1 (multDrop q l))) (Init.Nat.mul q1 (product l)) *)
rewrite <- (IH q).
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
(* Goal: @eq nat (Init.Nat.mul q (Init.Nat.mul q1 (multDrop q l))) (Init.Nat.mul q1 (Init.Nat.mul q (multDrop q l))) *)
rewrite mult_assoc.
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
(* Goal: @eq nat (Nat.mul (Nat.mul q q1) (multDrop q l)) (Init.Nat.mul q1 (Init.Nat.mul q (multDrop q l))) *)
rewrite (mult_comm q q1).
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
(* Goal: @eq nat (Nat.mul (Nat.mul q1 q) (multDrop q l)) (Init.Nat.mul q1 (Init.Nat.mul q (multDrop q l))) *)
rewrite mult_assoc.
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
(* Goal: @eq nat (Nat.mul (Nat.mul q1 q) (multDrop q l)) (Nat.mul (Nat.mul q1 q) (multDrop q l)) *)
reflexivity.
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
unfold inlist in H.
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
simpl in H.
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
elim H.
(* Goal: not (@eq nat q q1) *)
(* Goal: forall _ : exlist nat (fun b : nat => @eq nat q b) l, inlist nat q l *)
(* Goal: forall _ : @eq nat q q1, inlist nat q l *)
intro.
(* Goal: not (@eq nat q q1) *)
(* Goal: forall _ : exlist nat (fun b : nat => @eq nat q b) l, inlist nat q l *)
(* Goal: inlist nat q l *)
elim H0.
(* Goal: not (@eq nat q q1) *)
(* Goal: forall _ : exlist nat (fun b : nat => @eq nat q b) l, inlist nat q l *)
(* Goal: @eq nat q q1 *)
assumption.
(* Goal: not (@eq nat q q1) *)
(* Goal: forall _ : exlist nat (fun b : nat => @eq nat q b) l, inlist nat q l *)
intro.
(* Goal: not (@eq nat q q1) *)
(* Goal: inlist nat q l *)
assumption.
(* Goal: not (@eq nat q q1) *)
assumption.
Qed.
Definition Zlist := list Z.
Definition allPos : Zlist -> Prop := alllist Z (fun x : Z => (x >= 0)%Z).
Fixpoint zproduct (l : Zlist) : Z :=
match l with
| Nil => 1%Z
| Cons x t => (x * zproduct t)%Z
end.
Lemma productzproduct :
forall l : natlist, Z_of_nat (product l) = zproduct (map nat Z Z_of_nat l).
Proof.
(* Goal: forall l : natlist, @eq Z (Z.of_nat (product l)) (zproduct (map nat Z Z.of_nat l)) *)
simple induction l.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq Z (Z.of_nat (product l)) (zproduct (map nat Z Z.of_nat l))), @eq Z (Z.of_nat (product (Cons nat a l))) (zproduct (map nat Z Z.of_nat (Cons nat a l))) *)
(* Goal: @eq Z (Z.of_nat (product (Nil nat))) (zproduct (map nat Z Z.of_nat (Nil nat))) *)
simpl in |- *.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq Z (Z.of_nat (product l)) (zproduct (map nat Z Z.of_nat l))), @eq Z (Z.of_nat (product (Cons nat a l))) (zproduct (map nat Z Z.of_nat (Cons nat a l))) *)
(* Goal: @eq Z (Zpos xH) (Zpos xH) *)
reflexivity.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq Z (Z.of_nat (product l)) (zproduct (map nat Z Z.of_nat l))), @eq Z (Z.of_nat (product (Cons nat a l))) (zproduct (map nat Z Z.of_nat (Cons nat a l))) *)
intros h t IH.
(* Goal: @eq Z (Z.of_nat (product (Cons nat h t))) (zproduct (map nat Z Z.of_nat (Cons nat h t))) *)
simpl in |- *.
(* Goal: @eq Z (Z.of_nat (Init.Nat.mul h (product t))) (Z.mul (Z.of_nat h) (zproduct (map nat Z Z.of_nat t))) *)
rewrite <- IH.
(* Goal: @eq Z (Z.of_nat (Init.Nat.mul h (product t))) (Z.mul (Z.of_nat h) (Z.of_nat (product t))) *)
rewrite Znat.inj_mult.
(* Goal: @eq Z (Z.mul (Z.of_nat h) (Z.of_nat (product t))) (Z.mul (Z.of_nat h) (Z.of_nat (product t))) *)
reflexivity.
Qed.
Lemma zproductproduct :
forall l : Zlist, Zabs_nat (zproduct l) = product (map Z nat Zabs_nat l).
Proof.
(* Goal: forall l : Zlist, @eq nat (Z.abs_nat (zproduct l)) (product (map Z nat Z.abs_nat l)) *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : @eq nat (Z.abs_nat (zproduct l)) (product (map Z nat Z.abs_nat l))), @eq nat (Z.abs_nat (zproduct (Cons Z a l))) (product (map Z nat Z.abs_nat (Cons Z a l))) *)
(* Goal: @eq nat (Z.abs_nat (zproduct (Nil Z))) (product (map Z nat Z.abs_nat (Nil Z))) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : @eq nat (Z.abs_nat (zproduct l)) (product (map Z nat Z.abs_nat l))), @eq nat (Z.abs_nat (zproduct (Cons Z a l))) (product (map Z nat Z.abs_nat (Cons Z a l))) *)
(* Goal: @eq nat (Pos.to_nat xH) (S O) *)
reflexivity.
(* Goal: forall (a : Z) (l : list Z) (_ : @eq nat (Z.abs_nat (zproduct l)) (product (map Z nat Z.abs_nat l))), @eq nat (Z.abs_nat (zproduct (Cons Z a l))) (product (map Z nat Z.abs_nat (Cons Z a l))) *)
intros h t IH.
(* Goal: @eq nat (Z.abs_nat (zproduct (Cons Z h t))) (product (map Z nat Z.abs_nat (Cons Z h t))) *)
simpl in |- *.
(* Goal: @eq nat (Z.abs_nat (Z.mul h (zproduct t))) (Init.Nat.mul (Z.abs_nat h) (product (map Z nat Z.abs_nat t))) *)
rewrite abs_mult.
(* Goal: @eq nat (Init.Nat.mul (Z.abs_nat h) (Z.abs_nat (zproduct t))) (Init.Nat.mul (Z.abs_nat h) (product (map Z nat Z.abs_nat t))) *)
rewrite IH.
(* Goal: @eq nat (Init.Nat.mul (Z.abs_nat h) (product (map Z nat Z.abs_nat t))) (Init.Nat.mul (Z.abs_nat h) (product (map Z nat Z.abs_nat t))) *)
reflexivity.
Qed.
Fixpoint zdrop (x : Z) (l : Zlist) {struct l} : Zlist :=
match l with
| Nil => Nil Z
| Cons h t => if Zeq_bool x h then t else Cons Z h (zdrop x t)
end.
Lemma zdrop_head_eq :
forall (x y : Z) (l : Zlist), x = y -> zdrop x (Cons Z y l) = l.
Proof.
(* Goal: forall (x y : Z) (l : Zlist) (_ : @eq Z x y), @eq Zlist (zdrop x (Cons Z y l)) l *)
simpl in |- *.
(* Goal: forall (x y : Z) (l : Zlist) (_ : @eq Z x y), @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) l *)
intros.
(* Goal: @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) l *)
elim (zeq_bool_eq x y).
(* Goal: forall (_ : forall _ : @eq Z x y, @eq bool (Zeq_bool x y) true) (_ : forall _ : @eq bool (Zeq_bool x y) true, @eq Z x y), @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) l *)
intros.
(* Goal: @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) l *)
rewrite H0.
(* Goal: @eq Z x y *)
(* Goal: @eq Zlist l l *)
reflexivity.
(* Goal: @eq Z x y *)
assumption.
Qed.
Lemma zdrop_head_neq :
forall (x y : Z) (l : Zlist),
x <> y -> zdrop x (Cons Z y l) = Cons Z y (zdrop x l).
Proof.
(* Goal: forall (x y : Z) (l : Zlist) (_ : not (@eq Z x y)), @eq Zlist (zdrop x (Cons Z y l)) (Cons Z y (zdrop x l)) *)
simpl in |- *.
(* Goal: forall (x y : Z) (l : Zlist) (_ : not (@eq Z x y)), @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) (Cons Z y (zdrop x l)) *)
intros.
(* Goal: @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) (Cons Z y (zdrop x l)) *)
elim (zeq_bool_neq x y).
(* Goal: forall (_ : forall _ : not (@eq Z x y), @eq bool (Zeq_bool x y) false) (_ : forall _ : @eq bool (Zeq_bool x y) false, not (@eq Z x y)), @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) (Cons Z y (zdrop x l)) *)
intros.
(* Goal: @eq Zlist (if Zeq_bool x y then l else Cons Z y (zdrop x l)) (Cons Z y (zdrop x l)) *)
rewrite H0.
(* Goal: not (@eq Z x y) *)
(* Goal: @eq Zlist (Cons Z y (zdrop x l)) (Cons Z y (zdrop x l)) *)
reflexivity.
(* Goal: not (@eq Z x y) *)
assumption.
Qed.
Lemma zdrop_length :
forall (x : Z) (l : Zlist),
inlist Z x l -> S (length Z (zdrop x l)) = length Z l.
Proof.
(* Goal: forall (x : Z) (l : Zlist) (_ : inlist Z x l), @eq nat (S (length Z (zdrop x l))) (length Z l) *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq nat (S (length Z (zdrop x l))) (length Z l)) (_ : inlist Z x (Cons Z a l)), @eq nat (S (length Z (zdrop x (Cons Z a l)))) (length Z (Cons Z a l)) *)
(* Goal: forall _ : inlist Z x (Nil Z), @eq nat (S (length Z (zdrop x (Nil Z)))) (length Z (Nil Z)) *)
unfold inlist in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq nat (S (length Z (zdrop x l))) (length Z l)) (_ : inlist Z x (Cons Z a l)), @eq nat (S (length Z (zdrop x (Cons Z a l)))) (length Z (Cons Z a l)) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) (Nil Z), @eq nat (S (length Z (zdrop x (Nil Z)))) (length Z (Nil Z)) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq nat (S (length Z (zdrop x l))) (length Z l)) (_ : inlist Z x (Cons Z a l)), @eq nat (S (length Z (zdrop x (Cons Z a l)))) (length Z (Cons Z a l)) *)
(* Goal: forall _ : False, @eq nat (S O) O *)
intros.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq nat (S (length Z (zdrop x l))) (length Z l)) (_ : inlist Z x (Cons Z a l)), @eq nat (S (length Z (zdrop x (Cons Z a l)))) (length Z (Cons Z a l)) *)
(* Goal: @eq nat (S O) O *)
elim H.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq nat (S (length Z (zdrop x l))) (length Z l)) (_ : inlist Z x (Cons Z a l)), @eq nat (S (length Z (zdrop x (Cons Z a l)))) (length Z (Cons Z a l)) *)
intros h t IH.
(* Goal: forall _ : inlist Z x (Cons Z h t), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
intros.
(* Goal: @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
elim (zeqdec x h).
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
(* Goal: forall _ : @eq Z x h, @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
intro.
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
(* Goal: @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
simpl in |- *.
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
(* Goal: @eq nat (S (length Z (if Zeq_bool x h then t else Cons Z h (zdrop x t)))) (S (length Z t)) *)
elim (zeq_bool_eq x h).
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
(* Goal: forall (_ : forall _ : @eq Z x h, @eq bool (Zeq_bool x h) true) (_ : forall _ : @eq bool (Zeq_bool x h) true, @eq Z x h), @eq nat (S (length Z (if Zeq_bool x h then t else Cons Z h (zdrop x t)))) (S (length Z t)) *)
intros.
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
(* Goal: @eq nat (S (length Z (if Zeq_bool x h then t else Cons Z h (zdrop x t)))) (S (length Z t)) *)
rewrite H1.
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
(* Goal: @eq Z x h *)
(* Goal: @eq nat (S (length Z t)) (S (length Z t)) *)
reflexivity.
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: forall _ : not (@eq Z x h), @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
intro.
(* Goal: @eq nat (S (length Z (zdrop x (Cons Z h t)))) (length Z (Cons Z h t)) *)
simpl in |- *.
(* Goal: @eq nat (S (length Z (if Zeq_bool x h then t else Cons Z h (zdrop x t)))) (S (length Z t)) *)
elim (zeq_bool_neq x h).
(* Goal: forall (_ : forall _ : not (@eq Z x h), @eq bool (Zeq_bool x h) false) (_ : forall _ : @eq bool (Zeq_bool x h) false, not (@eq Z x h)), @eq nat (S (length Z (if Zeq_bool x h then t else Cons Z h (zdrop x t)))) (S (length Z t)) *)
intros.
(* Goal: @eq nat (S (length Z (if Zeq_bool x h then t else Cons Z h (zdrop x t)))) (S (length Z t)) *)
rewrite H1.
(* Goal: not (@eq Z x h) *)
(* Goal: @eq nat (S (length Z (Cons Z h (zdrop x t)))) (S (length Z t)) *)
simpl in |- *.
(* Goal: not (@eq Z x h) *)
(* Goal: @eq nat (S (S (length Z (zdrop x t)))) (S (length Z t)) *)
rewrite IH.
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
(* Goal: @eq nat (S (length Z t)) (S (length Z t)) *)
reflexivity.
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
elim H.
(* Goal: not (@eq Z x h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, inlist Z x t *)
(* Goal: forall _ : @eq Z x h, inlist Z x t *)
intros.
(* Goal: not (@eq Z x h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, inlist Z x t *)
(* Goal: inlist Z x t *)
elim H0.
(* Goal: not (@eq Z x h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, inlist Z x t *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: not (@eq Z x h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, inlist Z x t *)
intros.
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
assumption.
(* Goal: not (@eq Z x h) *)
assumption.
Qed.
Lemma zdrop_neq_inlist :
forall (x y : Z) (l : Zlist),
x <> y -> inlist Z x l -> inlist Z x (zdrop y l).
Proof.
(* Goal: forall (x y : Z) (l : Zlist) (_ : not (@eq Z x y)) (_ : inlist Z x l), inlist Z x (zdrop y l) *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : not (@eq Z x y)) (_ : inlist Z x l), inlist Z x (zdrop y l)) (_ : not (@eq Z x y)) (_ : inlist Z x (Cons Z a l)), inlist Z x (zdrop y (Cons Z a l)) *)
(* Goal: forall (_ : not (@eq Z x y)) (_ : inlist Z x (Nil Z)), inlist Z x (zdrop y (Nil Z)) *)
intros.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : not (@eq Z x y)) (_ : inlist Z x l), inlist Z x (zdrop y l)) (_ : not (@eq Z x y)) (_ : inlist Z x (Cons Z a l)), inlist Z x (zdrop y (Cons Z a l)) *)
(* Goal: inlist Z x (zdrop y (Nil Z)) *)
elim H0.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : not (@eq Z x y)) (_ : inlist Z x l), inlist Z x (zdrop y l)) (_ : not (@eq Z x y)) (_ : inlist Z x (Cons Z a l)), inlist Z x (zdrop y (Cons Z a l)) *)
intros h t IH.
(* Goal: forall (_ : not (@eq Z x y)) (_ : inlist Z x (Cons Z h t)), inlist Z x (zdrop y (Cons Z h t)) *)
intros.
(* Goal: inlist Z x (zdrop y (Cons Z h t)) *)
elim (zeqdec x h).
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: forall _ : @eq Z x h, inlist Z x (zdrop y (Cons Z h t)) *)
intro.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: inlist Z x (zdrop y (Cons Z h t)) *)
rewrite zdrop_head_neq.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (Cons Z h (zdrop y t)) *)
apply inlist_head_eq.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
rewrite <- H1.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: not (@eq Z y x) *)
intro.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: False *)
apply H.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z x y *)
symmetry in |- *.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z y x *)
assumption.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (zdrop y (Cons Z h t)) *)
intro.
(* Goal: inlist Z x (zdrop y (Cons Z h t)) *)
elim (zeqdec y h).
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: forall _ : @eq Z y h, inlist Z x (zdrop y (Cons Z h t)) *)
intro.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: inlist Z x (zdrop y (Cons Z h t)) *)
rewrite zdrop_head_eq.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: inlist Z x t *)
elim (inlist_head_neq Z x h t).
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: forall (_ : forall _ : inlist Z x (Cons Z h t), inlist Z x t) (_ : forall _ : inlist Z x t, inlist Z x (Cons Z h t)), inlist Z x t *)
intros.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
apply H3.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x (Cons Z h t) *)
assumption.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
(* Goal: @eq Z y h *)
assumption.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (zdrop y (Cons Z h t)) *)
intro.
(* Goal: inlist Z x (zdrop y (Cons Z h t)) *)
rewrite zdrop_head_neq.
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (Cons Z h (zdrop y t)) *)
elim (inlist_head_neq Z x h (zdrop y t)).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: forall (_ : forall _ : inlist Z x (Cons Z h (zdrop y t)), inlist Z x (zdrop y t)) (_ : forall _ : inlist Z x (zdrop y t), inlist Z x (Cons Z h (zdrop y t))), inlist Z x (Cons Z h (zdrop y t)) *)
intros.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x (Cons Z h (zdrop y t)) *)
apply H4.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x (zdrop y t) *)
apply IH.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
(* Goal: not (@eq Z x y) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
elim (inlist_head_neq Z x h t).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: forall (_ : forall _ : inlist Z x (Cons Z h t), inlist Z x t) (_ : forall _ : inlist Z x t, inlist Z x (Cons Z h t)), inlist Z x t *)
intros.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
apply H5.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x (Cons Z h t) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: not (@eq Z y h) *)
assumption.
Qed.
Lemma zdrop_inlist_weak :
forall (x y : Z) (l : Zlist), inlist Z x (zdrop y l) -> inlist Z x l.
Proof.
(* Goal: forall (x y : Z) (l : Zlist) (_ : inlist Z x (zdrop y l)), inlist Z x l *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x (zdrop y l), inlist Z x l) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z x (Cons Z a l) *)
(* Goal: forall _ : inlist Z x (zdrop y (Nil Z)), inlist Z x (Nil Z) *)
unfold inlist in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x (zdrop y l), inlist Z x l) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z x (Cons Z a l) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) (zdrop y (Nil Z)), exlist Z (fun b : Z => @eq Z x b) (Nil Z) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x (zdrop y l), inlist Z x l) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z x (Cons Z a l) *)
(* Goal: forall _ : False, False *)
intro.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x (zdrop y l), inlist Z x l) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z x (Cons Z a l) *)
(* Goal: False *)
assumption.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x (zdrop y l), inlist Z x l) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z x (Cons Z a l) *)
intros h t IH.
(* Goal: forall _ : inlist Z x (zdrop y (Cons Z h t)), inlist Z x (Cons Z h t) *)
intros.
(* Goal: inlist Z x (Cons Z h t) *)
elim (zeqdec x h).
(* Goal: forall _ : not (@eq Z x h), inlist Z x (Cons Z h t) *)
(* Goal: forall _ : @eq Z x h, inlist Z x (Cons Z h t) *)
intro.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (Cons Z h t) *)
(* Goal: inlist Z x (Cons Z h t) *)
rewrite H0.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (Cons Z h t) *)
(* Goal: inlist Z h (Cons Z h t) *)
unfold inlist in |- *.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (Cons Z h t) *)
(* Goal: exlist Z (fun b : Z => @eq Z h b) (Cons Z h t) *)
simpl in |- *.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (Cons Z h t) *)
(* Goal: or (@eq Z h h) (exlist Z (fun b : Z => @eq Z h b) t) *)
left.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (Cons Z h t) *)
(* Goal: @eq Z h h *)
reflexivity.
(* Goal: forall _ : not (@eq Z x h), inlist Z x (Cons Z h t) *)
intro.
(* Goal: inlist Z x (Cons Z h t) *)
elim (zeqdec y h).
(* Goal: forall _ : not (@eq Z y h), inlist Z x (Cons Z h t) *)
(* Goal: forall _ : @eq Z y h, inlist Z x (Cons Z h t) *)
intro.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (Cons Z h t) *)
(* Goal: inlist Z x (Cons Z h t) *)
rewrite H1 in H.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (Cons Z h t) *)
(* Goal: inlist Z x (Cons Z h t) *)
rewrite zdrop_head_eq in H.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (Cons Z h t) *)
(* Goal: @eq Z h h *)
(* Goal: inlist Z x (Cons Z h t) *)
apply inlist_tail.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (Cons Z h t) *)
(* Goal: @eq Z h h *)
(* Goal: inlist Z x t *)
assumption.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (Cons Z h t) *)
(* Goal: @eq Z h h *)
reflexivity.
(* Goal: forall _ : not (@eq Z y h), inlist Z x (Cons Z h t) *)
intro.
(* Goal: inlist Z x (Cons Z h t) *)
rewrite zdrop_head_neq in H.
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (Cons Z h t) *)
unfold inlist in H.
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (Cons Z h t) *)
simpl in H.
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (Cons Z h t) *)
elim H.
(* Goal: not (@eq Z y h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) (zdrop y t), inlist Z x (Cons Z h t) *)
(* Goal: forall _ : @eq Z x h, inlist Z x (Cons Z h t) *)
intro.
(* Goal: not (@eq Z y h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) (zdrop y t), inlist Z x (Cons Z h t) *)
(* Goal: inlist Z x (Cons Z h t) *)
elim H0.
(* Goal: not (@eq Z y h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) (zdrop y t), inlist Z x (Cons Z h t) *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) (zdrop y t), inlist Z x (Cons Z h t) *)
intros.
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (Cons Z h t) *)
apply inlist_tail.
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x t *)
apply IH.
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (zdrop y t) *)
assumption.
(* Goal: not (@eq Z y h) *)
assumption.
Qed.
Lemma zdrop_swap :
forall (x y : Z) (l : Zlist), zdrop x (zdrop y l) = zdrop y (zdrop x l).
Proof.
(* Goal: forall (x y : Z) (l : Zlist), @eq Zlist (zdrop x (zdrop y l)) (zdrop y (zdrop x l)) *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : @eq Zlist (zdrop x (zdrop y l)) (zdrop y (zdrop x l))), @eq Zlist (zdrop x (zdrop y (Cons Z a l))) (zdrop y (zdrop x (Cons Z a l))) *)
(* Goal: @eq Zlist (zdrop x (zdrop y (Nil Z))) (zdrop y (zdrop x (Nil Z))) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : @eq Zlist (zdrop x (zdrop y l)) (zdrop y (zdrop x l))), @eq Zlist (zdrop x (zdrop y (Cons Z a l))) (zdrop y (zdrop x (Cons Z a l))) *)
(* Goal: @eq Zlist (Nil Z) (Nil Z) *)
reflexivity.
(* Goal: forall (a : Z) (l : list Z) (_ : @eq Zlist (zdrop x (zdrop y l)) (zdrop y (zdrop x l))), @eq Zlist (zdrop x (zdrop y (Cons Z a l))) (zdrop y (zdrop x (Cons Z a l))) *)
intros h t IH.
(* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
elim (zeqdec x h).
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall _ : @eq Z x h, @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
elim (zeqdec y h).
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall (_ : @eq Z y h) (_ : @eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
intros.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
rewrite H.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Zlist (zdrop x (zdrop h (Cons Z h t))) (zdrop h (zdrop x (Cons Z h t))) *)
rewrite H0.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Zlist (zdrop h (zdrop h (Cons Z h t))) (zdrop h (zdrop h (Cons Z h t))) *)
reflexivity.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
intros.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
rewrite (zdrop_head_eq x h t).
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z x h *)
(* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y t) *)
rewrite (zdrop_head_neq y h t).
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Zlist (zdrop x (Cons Z h (zdrop y t))) (zdrop y t) *)
rewrite zdrop_head_eq.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
(* Goal: @eq Zlist (zdrop y t) (zdrop y t) *)
reflexivity.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
assumption.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: forall _ : not (@eq Z x h), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
elim (zeqdec y h).
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: forall (_ : @eq Z y h) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
intros.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
rewrite (zdrop_head_eq y h).
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z y h *)
(* Goal: @eq Zlist (zdrop x t) (zdrop y (zdrop x (Cons Z h t))) *)
rewrite (zdrop_head_neq x h).
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Zlist (zdrop x t) (zdrop y (Cons Z h (zdrop x t))) *)
rewrite zdrop_head_eq.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z y h *)
(* Goal: @eq Zlist (zdrop x t) (zdrop x t) *)
reflexivity.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z y h *)
assumption.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
(* Goal: @eq Z y h *)
assumption.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)), @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
intros.
(* Goal: @eq Zlist (zdrop x (zdrop y (Cons Z h t))) (zdrop y (zdrop x (Cons Z h t))) *)
rewrite (zdrop_head_neq y h).
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Zlist (zdrop x (Cons Z h (zdrop y t))) (zdrop y (zdrop x (Cons Z h t))) *)
rewrite (zdrop_head_neq x h).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (zdrop y (zdrop x (Cons Z h t))) *)
rewrite (zdrop_head_neq x h).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (zdrop y (Cons Z h (zdrop x t))) *)
rewrite (zdrop_head_neq y h).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Zlist (Cons Z h (zdrop x (zdrop y t))) (Cons Z h (zdrop y (zdrop x t))) *)
rewrite IH.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Zlist (Cons Z h (zdrop y (zdrop x t))) (Cons Z h (zdrop y (zdrop x t))) *)
reflexivity.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: not (@eq Z y h) *)
assumption.
Qed.
Lemma zdrop_inlist_swap :
forall (x y : Z) (l : Zlist),
inlist Z y l -> inlist Z x (zdrop y l) -> inlist Z y (zdrop x l).
Proof.
(* Goal: forall (x y : Z) (l : Zlist) (_ : inlist Z y l) (_ : inlist Z x (zdrop y l)), inlist Z y (zdrop x l) *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : inlist Z y l) (_ : inlist Z x (zdrop y l)), inlist Z y (zdrop x l)) (_ : inlist Z y (Cons Z a l)) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z y (zdrop x (Cons Z a l)) *)
(* Goal: forall (_ : inlist Z y (Nil Z)) (_ : inlist Z x (zdrop y (Nil Z))), inlist Z y (zdrop x (Nil Z)) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : inlist Z y l) (_ : inlist Z x (zdrop y l)), inlist Z y (zdrop x l)) (_ : inlist Z y (Cons Z a l)) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z y (zdrop x (Cons Z a l)) *)
(* Goal: forall (_ : inlist Z y (Nil Z)) (_ : inlist Z x (Nil Z)), inlist Z y (Nil Z) *)
intro H.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : inlist Z y l) (_ : inlist Z x (zdrop y l)), inlist Z y (zdrop x l)) (_ : inlist Z y (Cons Z a l)) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z y (zdrop x (Cons Z a l)) *)
(* Goal: forall _ : inlist Z x (Nil Z), inlist Z y (Nil Z) *)
elim H.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : inlist Z y l) (_ : inlist Z x (zdrop y l)), inlist Z y (zdrop x l)) (_ : inlist Z y (Cons Z a l)) (_ : inlist Z x (zdrop y (Cons Z a l))), inlist Z y (zdrop x (Cons Z a l)) *)
intros h t IH.
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
elim (zeqdec x h).
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
elim (zeqdec y h).
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : @eq Z y h) (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
intros Hyh Hxh.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
rewrite Hyh.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : inlist Z h (Cons Z h t)) (_ : inlist Z x (zdrop h (Cons Z h t))), inlist Z h (zdrop x (Cons Z h t)) *)
rewrite Hxh.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : inlist Z h (Cons Z h t)) (_ : inlist Z h (zdrop h (Cons Z h t))), inlist Z h (zdrop h (Cons Z h t)) *)
intros.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: inlist Z h (zdrop h (Cons Z h t)) *)
assumption.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : not (@eq Z y h)) (_ : @eq Z x h) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
intros Hyh Hxh.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
rewrite (zdrop_head_neq y).
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (Cons Z h (zdrop y t))), inlist Z y (zdrop x (Cons Z h t)) *)
rewrite (zdrop_head_eq x).
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (Cons Z h (zdrop y t))), inlist Z y t *)
intros.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
(* Goal: inlist Z y t *)
elim (inlist_head_neq Z y h t).
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
(* Goal: forall (_ : forall _ : inlist Z y (Cons Z h t), inlist Z y t) (_ : forall _ : inlist Z y t, inlist Z y (Cons Z h t)), inlist Z y t *)
intros.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z y t *)
apply H1.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z y (Cons Z h t) *)
assumption.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
(* Goal: not (@eq Z y h) *)
assumption.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: not (@eq Z y h) *)
assumption.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
elim (zeqdec y h).
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : @eq Z y h) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
intros Hyh Hxh.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
rewrite (zdrop_head_eq y).
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x t), inlist Z y (zdrop x (Cons Z h t)) *)
rewrite (zdrop_head_neq x).
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x t), inlist Z y (Cons Z h (zdrop x t)) *)
intros.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z y (Cons Z h (zdrop x t)) *)
apply inlist_head_eq.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z y h *)
assumption.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: @eq Z y h *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
(* Goal: @eq Z y h *)
assumption.
(* Goal: forall (_ : not (@eq Z y h)) (_ : not (@eq Z x h)) (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
intros Hyh Hxh.
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (zdrop y (Cons Z h t))), inlist Z y (zdrop x (Cons Z h t)) *)
rewrite (zdrop_head_neq y).
(* Goal: not (@eq Z y h) *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (Cons Z h (zdrop y t))), inlist Z y (zdrop x (Cons Z h t)) *)
rewrite (zdrop_head_neq x).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: forall (_ : inlist Z y (Cons Z h t)) (_ : inlist Z x (Cons Z h (zdrop y t))), inlist Z y (Cons Z h (zdrop x t)) *)
intros.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z y (Cons Z h (zdrop x t)) *)
elim (inlist_head_neq Z y h (zdrop x t)).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: forall (_ : forall _ : inlist Z y (Cons Z h (zdrop x t)), inlist Z y (zdrop x t)) (_ : forall _ : inlist Z y (zdrop x t), inlist Z y (Cons Z h (zdrop x t))), inlist Z y (Cons Z h (zdrop x t)) *)
intros.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z y (Cons Z h (zdrop x t)) *)
apply H2.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z y (zdrop x t) *)
apply IH.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (zdrop y t) *)
(* Goal: inlist Z y t *)
elim (inlist_head_neq Z y h t).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (zdrop y t) *)
(* Goal: not (@eq Z y h) *)
(* Goal: forall (_ : forall _ : inlist Z y (Cons Z h t), inlist Z y t) (_ : forall _ : inlist Z y t, inlist Z y (Cons Z h t)), inlist Z y t *)
intros.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (zdrop y t) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z y t *)
apply H3.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (zdrop y t) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z y (Cons Z h t) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (zdrop y t) *)
(* Goal: not (@eq Z y h) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: inlist Z x (zdrop y t) *)
elim (inlist_head_neq Z x h (zdrop y t)).
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: forall (_ : forall _ : inlist Z x (Cons Z h (zdrop y t)), inlist Z x (zdrop y t)) (_ : forall _ : inlist Z x (zdrop y t), inlist Z x (Cons Z h (zdrop y t))), inlist Z x (zdrop y t) *)
intros.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x (zdrop y t) *)
apply H3.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x (Cons Z h (zdrop y t)) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z y h) *)
assumption.
(* Goal: not (@eq Z y h) *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: not (@eq Z y h) *)
assumption.
Qed.
Lemma zdrop_product :
forall (x : Z) (l : Zlist),
inlist Z x l -> (x * zproduct (zdrop x l))%Z = zproduct l.
Proof.
(* Goal: forall (x : Z) (l : Zlist) (_ : inlist Z x l), @eq Z (Z.mul x (zproduct (zdrop x l))) (zproduct l) *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq Z (Z.mul x (zproduct (zdrop x l))) (zproduct l)) (_ : inlist Z x (Cons Z a l)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z a l)))) (zproduct (Cons Z a l)) *)
(* Goal: forall _ : inlist Z x (Nil Z), @eq Z (Z.mul x (zproduct (zdrop x (Nil Z)))) (zproduct (Nil Z)) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq Z (Z.mul x (zproduct (zdrop x l))) (zproduct l)) (_ : inlist Z x (Cons Z a l)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z a l)))) (zproduct (Cons Z a l)) *)
(* Goal: forall _ : inlist Z x (Nil Z), @eq Z (Z.mul x (Zpos xH)) (Zpos xH) *)
intro.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq Z (Z.mul x (zproduct (zdrop x l))) (zproduct l)) (_ : inlist Z x (Cons Z a l)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z a l)))) (zproduct (Cons Z a l)) *)
(* Goal: @eq Z (Z.mul x (Zpos xH)) (Zpos xH) *)
elim H.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : inlist Z x l, @eq Z (Z.mul x (zproduct (zdrop x l))) (zproduct l)) (_ : inlist Z x (Cons Z a l)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z a l)))) (zproduct (Cons Z a l)) *)
intros h t IH.
(* Goal: forall _ : inlist Z x (Cons Z h t), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
elim (zeqdec x h).
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z x (Cons Z h t)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
(* Goal: forall (_ : @eq Z x h) (_ : inlist Z x (Cons Z h t)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
intros.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z x (Cons Z h t)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
(* Goal: @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
rewrite zdrop_head_eq.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z x (Cons Z h t)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
(* Goal: @eq Z x h *)
(* Goal: @eq Z (Z.mul x (zproduct t)) (zproduct (Cons Z h t)) *)
rewrite H.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z x (Cons Z h t)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
(* Goal: @eq Z x h *)
(* Goal: @eq Z (Z.mul h (zproduct t)) (zproduct (Cons Z h t)) *)
reflexivity.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z x (Cons Z h t)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
(* Goal: @eq Z x h *)
assumption.
(* Goal: forall (_ : not (@eq Z x h)) (_ : inlist Z x (Cons Z h t)), @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
intros.
(* Goal: @eq Z (Z.mul x (zproduct (zdrop x (Cons Z h t)))) (zproduct (Cons Z h t)) *)
rewrite zdrop_head_neq.
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z (Z.mul x (zproduct (Cons Z h (zdrop x t)))) (zproduct (Cons Z h t)) *)
simpl in |- *.
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z (Z.mul x (Z.mul h (zproduct (zdrop x t)))) (Z.mul h (zproduct t)) *)
rewrite Zmult_assoc.
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z (Z.mul (Z.mul x h) (zproduct (zdrop x t))) (Z.mul h (zproduct t)) *)
rewrite Zmult_comm with x h.
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z (Z.mul (Z.mul h x) (zproduct (zdrop x t))) (Z.mul h (zproduct t)) *)
rewrite Zmult_assoc_reverse.
(* Goal: not (@eq Z x h) *)
(* Goal: @eq Z (Z.mul h (Z.mul x (zproduct (zdrop x t)))) (Z.mul h (zproduct t)) *)
rewrite IH.
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
(* Goal: @eq Z (Z.mul h (zproduct t)) (Z.mul h (zproduct t)) *)
reflexivity.
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
elim inlist_head_neq with Z x h t.
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: forall (_ : forall _ : inlist Z x (Cons Z h t), inlist Z x t) (_ : forall _ : inlist Z x t, inlist Z x (Cons Z h t)), inlist Z x t *)
intros.
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x t *)
apply H1.
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
(* Goal: inlist Z x (Cons Z h t) *)
assumption.
(* Goal: not (@eq Z x h) *)
(* Goal: not (@eq Z x h) *)
assumption.
(* Goal: not (@eq Z x h) *)
assumption.
Qed.
Definition zmultDrop (x : Z) (l : Zlist) := zproduct (zdrop x l).
Lemma zmultdrop_cons_eq :
forall (q : Z) (l : Zlist), zmultDrop q (Cons Z q l) = zproduct l.
Proof.
(* Goal: forall (q : Z) (l : Zlist), @eq Z (zmultDrop q (Cons Z q l)) (zproduct l) *)
unfold zmultDrop in |- *.
(* Goal: forall (q : Z) (l : Zlist), @eq Z (zproduct (zdrop q (Cons Z q l))) (zproduct l) *)
simpl in |- *.
(* Goal: forall (q : Z) (l : Zlist), @eq Z (zproduct (if Zeq_bool q q then l else Cons Z q (zdrop q l))) (zproduct l) *)
intros.
(* Goal: @eq Z (zproduct (if Zeq_bool q q then l else Cons Z q (zdrop q l))) (zproduct l) *)
elim (zeq_bool_eq q q).
(* Goal: forall (_ : forall _ : @eq Z q q, @eq bool (Zeq_bool q q) true) (_ : forall _ : @eq bool (Zeq_bool q q) true, @eq Z q q), @eq Z (zproduct (if Zeq_bool q q then l else Cons Z q (zdrop q l))) (zproduct l) *)
intros.
(* Goal: @eq Z (zproduct (if Zeq_bool q q then l else Cons Z q (zdrop q l))) (zproduct l) *)
rewrite H.
(* Goal: @eq Z q q *)
(* Goal: @eq Z (zproduct l) (zproduct l) *)
reflexivity.
(* Goal: @eq Z q q *)
reflexivity.
Qed.
Lemma zmultdrop_cons_neq :
forall (p q : Z) (l : Zlist),
p <> q -> zmultDrop p (Cons Z q l) = (q * zmultDrop p l)%Z.
Proof.
(* Goal: forall (p q : Z) (l : Zlist) (_ : not (@eq Z p q)), @eq Z (zmultDrop p (Cons Z q l)) (Z.mul q (zmultDrop p l)) *)
unfold zmultDrop in |- *.
(* Goal: forall (p q : Z) (l : Zlist) (_ : not (@eq Z p q)), @eq Z (zproduct (zdrop p (Cons Z q l))) (Z.mul q (zproduct (zdrop p l))) *)
simpl in |- *.
(* Goal: forall (p q : Z) (l : Zlist) (_ : not (@eq Z p q)), @eq Z (zproduct (if Zeq_bool p q then l else Cons Z q (zdrop p l))) (Z.mul q (zproduct (zdrop p l))) *)
intros.
(* Goal: @eq Z (zproduct (if Zeq_bool p q then l else Cons Z q (zdrop p l))) (Z.mul q (zproduct (zdrop p l))) *)
elim (zeq_bool_neq p q).
(* Goal: forall (_ : forall _ : not (@eq Z p q), @eq bool (Zeq_bool p q) false) (_ : forall _ : @eq bool (Zeq_bool p q) false, not (@eq Z p q)), @eq Z (zproduct (if Zeq_bool p q then l else Cons Z q (zdrop p l))) (Z.mul q (zproduct (zdrop p l))) *)
intros.
(* Goal: @eq Z (zproduct (if Zeq_bool p q then l else Cons Z q (zdrop p l))) (Z.mul q (zproduct (zdrop p l))) *)
rewrite H0.
(* Goal: not (@eq Z p q) *)
(* Goal: @eq Z (zproduct (Cons Z q (zdrop p l))) (Z.mul q (zproduct (zdrop p l))) *)
simpl in |- *.
(* Goal: not (@eq Z p q) *)
(* Goal: @eq Z (Z.mul q (zproduct (zdrop p l))) (Z.mul q (zproduct (zdrop p l))) *)
reflexivity.
(* Goal: not (@eq Z p q) *)
assumption.
Qed.
Lemma zmultdrop_mult :
forall (qlist : Zlist) (q : Z),
inlist Z q qlist -> (q * zmultDrop q qlist)%Z = zproduct qlist.
Proof.
(* Goal: forall (qlist : Zlist) (q : Z) (_ : inlist Z q qlist), @eq Z (Z.mul q (zmultDrop q qlist)) (zproduct qlist) *)
simple induction qlist.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (q : Z) (_ : inlist Z q l), @eq Z (Z.mul q (zmultDrop q l)) (zproduct l)) (q : Z) (_ : inlist Z q (Cons Z a l)), @eq Z (Z.mul q (zmultDrop q (Cons Z a l))) (zproduct (Cons Z a l)) *)
(* Goal: forall (q : Z) (_ : inlist Z q (Nil Z)), @eq Z (Z.mul q (zmultDrop q (Nil Z))) (zproduct (Nil Z)) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (q : Z) (_ : inlist Z q l), @eq Z (Z.mul q (zmultDrop q l)) (zproduct l)) (q : Z) (_ : inlist Z q (Cons Z a l)), @eq Z (Z.mul q (zmultDrop q (Cons Z a l))) (zproduct (Cons Z a l)) *)
(* Goal: forall (q : Z) (_ : inlist Z q (Nil Z)), @eq Z (Z.mul q (zmultDrop q (Nil Z))) (Zpos xH) *)
intros.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (q : Z) (_ : inlist Z q l), @eq Z (Z.mul q (zmultDrop q l)) (zproduct l)) (q : Z) (_ : inlist Z q (Cons Z a l)), @eq Z (Z.mul q (zmultDrop q (Cons Z a l))) (zproduct (Cons Z a l)) *)
(* Goal: @eq Z (Z.mul q (zmultDrop q (Nil Z))) (Zpos xH) *)
elim H.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (q : Z) (_ : inlist Z q l), @eq Z (Z.mul q (zmultDrop q l)) (zproduct l)) (q : Z) (_ : inlist Z q (Cons Z a l)), @eq Z (Z.mul q (zmultDrop q (Cons Z a l))) (zproduct (Cons Z a l)) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (q : Z) (_ : inlist Z q l), @eq Z (Z.mul q (zmultDrop q l)) (zproduct l)) (q : Z) (_ : inlist Z q (Cons Z a l)), @eq Z (Z.mul q (zmultDrop q (Cons Z a l))) (Z.mul a (zproduct l)) *)
intros q1 l IH.
(* Goal: forall (q : Z) (_ : inlist Z q (Cons Z q1 l)), @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
intros.
(* Goal: @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
elim (zeqdec q q1).
(* Goal: forall _ : not (@eq Z q q1), @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
(* Goal: forall _ : @eq Z q q1, @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
intro.
(* Goal: forall _ : not (@eq Z q q1), @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
(* Goal: @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
rewrite H0.
(* Goal: forall _ : not (@eq Z q q1), @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
(* Goal: @eq Z (Z.mul q1 (zmultDrop q1 (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
rewrite zmultdrop_cons_eq.
(* Goal: forall _ : not (@eq Z q q1), @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
(* Goal: @eq Z (Z.mul q1 (zproduct l)) (Z.mul q1 (zproduct l)) *)
reflexivity.
(* Goal: forall _ : not (@eq Z q q1), @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
intro.
(* Goal: @eq Z (Z.mul q (zmultDrop q (Cons Z q1 l))) (Z.mul q1 (zproduct l)) *)
rewrite zmultdrop_cons_neq.
(* Goal: not (@eq Z q q1) *)
(* Goal: @eq Z (Z.mul q (Z.mul q1 (zmultDrop q l))) (Z.mul q1 (zproduct l)) *)
rewrite <- (IH q).
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
(* Goal: @eq Z (Z.mul q (Z.mul q1 (zmultDrop q l))) (Z.mul q1 (Z.mul q (zmultDrop q l))) *)
rewrite Zmult_assoc.
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
(* Goal: @eq Z (Z.mul (Z.mul q q1) (zmultDrop q l)) (Z.mul q1 (Z.mul q (zmultDrop q l))) *)
rewrite (Zmult_comm q q1).
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
(* Goal: @eq Z (Z.mul (Z.mul q1 q) (zmultDrop q l)) (Z.mul q1 (Z.mul q (zmultDrop q l))) *)
rewrite Zmult_assoc.
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
(* Goal: @eq Z (Z.mul (Z.mul q1 q) (zmultDrop q l)) (Z.mul (Z.mul q1 q) (zmultDrop q l)) *)
reflexivity.
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
unfold inlist in H.
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
simpl in H.
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
elim H.
(* Goal: not (@eq Z q q1) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z q b) l, inlist Z q l *)
(* Goal: forall _ : @eq Z q q1, inlist Z q l *)
intro.
(* Goal: not (@eq Z q q1) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z q b) l, inlist Z q l *)
(* Goal: inlist Z q l *)
elim H0.
(* Goal: not (@eq Z q q1) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z q b) l, inlist Z q l *)
(* Goal: @eq Z q q1 *)
assumption.
(* Goal: not (@eq Z q q1) *)
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z q b) l, inlist Z q l *)
intro.
(* Goal: not (@eq Z q q1) *)
(* Goal: inlist Z q l *)
assumption.
(* Goal: not (@eq Z q q1) *)
assumption.
Qed.
Lemma multdropzmultdrop :
forall (q : nat) (qlist : natlist),
Z_of_nat (multDrop q qlist) =
zmultDrop (Z_of_nat q) (map nat Z Z_of_nat qlist).
Proof.
(* Goal: forall (q : nat) (qlist : natlist), @eq Z (Z.of_nat (multDrop q qlist)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat qlist)) *)
simple induction qlist.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq Z (Z.of_nat (multDrop q l)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat l))), @eq Z (Z.of_nat (multDrop q (Cons nat a l))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat a l))) *)
(* Goal: @eq Z (Z.of_nat (multDrop q (Nil nat))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Nil nat))) *)
simpl in |- *.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq Z (Z.of_nat (multDrop q l)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat l))), @eq Z (Z.of_nat (multDrop q (Cons nat a l))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat a l))) *)
(* Goal: @eq Z (Zpos xH) (zmultDrop (Z.of_nat q) (Nil Z)) *)
reflexivity.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq Z (Z.of_nat (multDrop q l)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat l))), @eq Z (Z.of_nat (multDrop q (Cons nat a l))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat a l))) *)
intros h t.
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
elim (eqdec q h).
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: forall (_ : @eq nat q h) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
intro H.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
rewrite H.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop h (Cons nat h t))) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat (Cons nat h t))) *)
simpl in |- *.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop h (Cons nat h t))) (zmultDrop (Z.of_nat h) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *)
rewrite multdrop_cons_eq.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (product t)) (zmultDrop (Z.of_nat h) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *)
rewrite zmultdrop_cons_eq.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (product t)) (zproduct (map nat Z Z.of_nat t)) *)
rewrite productzproduct.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop h t)) (zmultDrop (Z.of_nat h) (map nat Z Z.of_nat t)), @eq Z (zproduct (map nat Z Z.of_nat t)) (zproduct (map nat Z Z.of_nat t)) *)
intro IH.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
(* Goal: @eq Z (zproduct (map nat Z Z.of_nat t)) (zproduct (map nat Z Z.of_nat t)) *)
reflexivity.
(* Goal: forall (_ : not (@eq nat q h)) (_ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
intro H.
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat (Cons nat h t))) *)
simpl in |- *.
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (multDrop q (Cons nat h t))) (zmultDrop (Z.of_nat q) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *)
rewrite multdrop_cons_neq.
(* Goal: not (@eq nat q h) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (Init.Nat.mul h (multDrop q t))) (zmultDrop (Z.of_nat q) (Cons Z (Z.of_nat h) (map nat Z Z.of_nat t))) *)
rewrite zmultdrop_cons_neq.
(* Goal: not (@eq nat q h) *)
(* Goal: not (@eq Z (Z.of_nat q) (Z.of_nat h)) *)
(* Goal: forall _ : @eq Z (Z.of_nat (multDrop q t)) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t)), @eq Z (Z.of_nat (Init.Nat.mul h (multDrop q t))) (Z.mul (Z.of_nat h) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))) *)
intro IH.
(* Goal: not (@eq nat q h) *)
(* Goal: not (@eq Z (Z.of_nat q) (Z.of_nat h)) *)
(* Goal: @eq Z (Z.of_nat (Init.Nat.mul h (multDrop q t))) (Z.mul (Z.of_nat h) (zmultDrop (Z.of_nat q) (map nat Z Z.of_nat t))) *)
rewrite <- IH.
(* Goal: not (@eq nat q h) *)
(* Goal: not (@eq Z (Z.of_nat q) (Z.of_nat h)) *)
(* Goal: @eq Z (Z.of_nat (Init.Nat.mul h (multDrop q t))) (Z.mul (Z.of_nat h) (Z.of_nat (multDrop q t))) *)
rewrite Znat.inj_mult.
(* Goal: not (@eq nat q h) *)
(* Goal: not (@eq Z (Z.of_nat q) (Z.of_nat h)) *)
(* Goal: @eq Z (Z.mul (Z.of_nat h) (Z.of_nat (multDrop q t))) (Z.mul (Z.of_nat h) (Z.of_nat (multDrop q t))) *)
reflexivity.
(* Goal: not (@eq nat q h) *)
(* Goal: not (@eq Z (Z.of_nat q) (Z.of_nat h)) *)
intro.
(* Goal: not (@eq nat q h) *)
(* Goal: False *)
apply H.
(* Goal: not (@eq nat q h) *)
(* Goal: @eq nat q h *)
rewrite <- (abs_inj q).
(* Goal: not (@eq nat q h) *)
(* Goal: @eq nat (Z.abs_nat (Z.of_nat q)) h *)
rewrite <- (abs_inj h).
(* Goal: not (@eq nat q h) *)
(* Goal: @eq nat (Z.abs_nat (Z.of_nat q)) (Z.abs_nat (Z.of_nat h)) *)
rewrite H0.
(* Goal: not (@eq nat q h) *)
(* Goal: @eq nat (Z.abs_nat (Z.of_nat h)) (Z.abs_nat (Z.of_nat h)) *)
reflexivity.
(* Goal: not (@eq nat q h) *)
assumption.
Qed.
Definition mapmult (a : Z) (l : Zlist) := map Z Z (fun x : Z => (a * x)%Z) l.
Lemma mapmult_image :
forall (a : Z) (l : Zlist) (x : Z),
inlist Z x l -> inlist Z (a * x)%Z (mapmult a l).
Proof.
(* Goal: forall (a : Z) (l : Zlist) (x : Z) (_ : inlist Z x l), inlist Z (Z.mul a x) (mapmult a l) *)
unfold mapmult in |- *.
(* Goal: forall (a : Z) (l : Zlist) (x : Z) (_ : inlist Z x l), inlist Z (Z.mul a x) (map Z Z (fun x0 : Z => Z.mul a x0) l) *)
unfold inlist in |- *.
(* Goal: forall (a : Z) (l : Zlist) (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) l), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) l) *)
simple induction l.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) l), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) l)) (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) (Cons Z a0 l)) *)
(* Goal: forall (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) (Nil Z)), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) (Nil Z)) *)
simpl in |- *.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) l), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) l)) (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) (Cons Z a0 l)) *)
(* Goal: forall (_ : Z) (_ : False), False *)
intros.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) l), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) l)) (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) (Cons Z a0 l)) *)
(* Goal: False *)
assumption.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) l), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) l)) (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) (Cons Z a0 l)) *)
simpl in |- *.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (x : Z) (_ : exlist Z (fun b : Z => @eq Z x b) l), exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) l)) (x : Z) (_ : or (@eq Z x a0) (exlist Z (fun b : Z => @eq Z x b) l)), or (@eq Z (Z.mul a x) (Z.mul a a0)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) l)) *)
intros h t IH.
(* Goal: forall (x : Z) (_ : or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)), or (@eq Z (Z.mul a x) (Z.mul a h)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x0 : Z => Z.mul a x0) t)) *)
intros.
(* Goal: or (@eq Z (Z.mul a x) (Z.mul a h)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x : Z => Z.mul a x) t)) *)
elim H.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, or (@eq Z (Z.mul a x) (Z.mul a h)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x : Z => Z.mul a x) t)) *)
(* Goal: forall _ : @eq Z x h, or (@eq Z (Z.mul a x) (Z.mul a h)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x : Z => Z.mul a x) t)) *)
left.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, or (@eq Z (Z.mul a x) (Z.mul a h)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x : Z => Z.mul a x) t)) *)
(* Goal: @eq Z (Z.mul a x) (Z.mul a h) *)
rewrite H0.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, or (@eq Z (Z.mul a x) (Z.mul a h)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x : Z => Z.mul a x) t)) *)
(* Goal: @eq Z (Z.mul a h) (Z.mul a h) *)
reflexivity.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z x b) t, or (@eq Z (Z.mul a x) (Z.mul a h)) (exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x : Z => Z.mul a x) t)) *)
right.
(* Goal: exlist Z (fun b : Z => @eq Z (Z.mul a x) b) (map Z Z (fun x : Z => Z.mul a x) t) *)
apply IH.
(* Goal: exlist Z (fun b : Z => @eq Z x b) t *)
assumption.
Qed.
Lemma mapmult_orig :
forall (a : Z) (l : Zlist) (y : Z),
inlist Z y (mapmult a l) -> exists x : Z, inlist Z x l /\ y = (a * x)%Z.
Proof.
(* Goal: forall (a : Z) (l : Zlist) (y : Z) (_ : inlist Z y (mapmult a l)), @ex Z (fun x : Z => and (inlist Z x l) (@eq Z y (Z.mul a x))) *)
unfold mapmult in |- *.
(* Goal: forall (a : Z) (l : Zlist) (y : Z) (_ : inlist Z y (map Z Z (fun x : Z => Z.mul a x) l)), @ex Z (fun x : Z => and (inlist Z x l) (@eq Z y (Z.mul a x))) *)
unfold inlist in |- *.
(* Goal: forall (a : Z) (l : Zlist) (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) l)), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) l) (@eq Z y (Z.mul a x))) *)
simple induction l.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) l)), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) l) (@eq Z y (Z.mul a x)))) (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) (Cons Z a0 l))), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)) (@eq Z y (Z.mul a x))) *)
(* Goal: forall (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) (Nil Z))), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) (Nil Z)) (@eq Z y (Z.mul a x))) *)
simpl in |- *.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) l)), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) l) (@eq Z y (Z.mul a x)))) (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) (Cons Z a0 l))), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)) (@eq Z y (Z.mul a x))) *)
(* Goal: forall (y : Z) (_ : False), @ex Z (fun x : Z => and False (@eq Z y (Z.mul a x))) *)
intros.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) l)), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) l) (@eq Z y (Z.mul a x)))) (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) (Cons Z a0 l))), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)) (@eq Z y (Z.mul a x))) *)
(* Goal: @ex Z (fun x : Z => and False (@eq Z y (Z.mul a x))) *)
elim H.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) l)), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) l) (@eq Z y (Z.mul a x)))) (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) (Cons Z a0 l))), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) (Cons Z a0 l)) (@eq Z y (Z.mul a x))) *)
simpl in |- *.
(* Goal: forall (a0 : Z) (l : list Z) (_ : forall (y : Z) (_ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) l)), @ex Z (fun x : Z => and (exlist Z (fun b : Z => @eq Z x b) l) (@eq Z y (Z.mul a x)))) (y : Z) (_ : or (@eq Z y (Z.mul a a0)) (exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) l))), @ex Z (fun x : Z => and (or (@eq Z x a0) (exlist Z (fun b : Z => @eq Z x b) l)) (@eq Z y (Z.mul a x))) *)
intros h t IH.
(* Goal: forall (y : Z) (_ : or (@eq Z y (Z.mul a h)) (exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t))), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
intros.
(* Goal: @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
elim H.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
(* Goal: forall _ : @eq Z y (Z.mul a h), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
intro.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
(* Goal: @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
split with h.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
(* Goal: and (or (@eq Z h h) (exlist Z (fun b : Z => @eq Z h b) t)) (@eq Z y (Z.mul a h)) *)
split.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
(* Goal: @eq Z y (Z.mul a h) *)
(* Goal: or (@eq Z h h) (exlist Z (fun b : Z => @eq Z h b) t) *)
left.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
(* Goal: @eq Z y (Z.mul a h) *)
(* Goal: @eq Z h h *)
reflexivity.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
(* Goal: @eq Z y (Z.mul a h) *)
assumption.
(* Goal: forall _ : exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
intro.
(* Goal: @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
elim (IH y).
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: forall (x : Z) (_ : and (exlist Z (fun b : Z => @eq Z x b) t) (@eq Z y (Z.mul a x))), @ex Z (fun x0 : Z => and (or (@eq Z x0 h) (exlist Z (fun b : Z => @eq Z x0 b) t)) (@eq Z y (Z.mul a x0))) *)
intros.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
elim H1.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: forall (_ : exlist Z (fun b : Z => @eq Z x b) t) (_ : @eq Z y (Z.mul a x)), @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
intros.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: @ex Z (fun x : Z => and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x))) *)
split with x.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: and (or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t)) (@eq Z y (Z.mul a x)) *)
split.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: @eq Z y (Z.mul a x) *)
(* Goal: or (@eq Z x h) (exlist Z (fun b : Z => @eq Z x b) t) *)
right.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: @eq Z y (Z.mul a x) *)
(* Goal: exlist Z (fun b : Z => @eq Z x b) t *)
assumption.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
(* Goal: @eq Z y (Z.mul a x) *)
assumption.
(* Goal: exlist Z (fun b : Z => @eq Z y b) (map Z Z (fun x : Z => Z.mul a x) t) *)
assumption.
Qed.
Lemma abs_inj_list :
forall l : natlist, map _ _ Zabs_nat (map _ _ Z_of_nat l) = l.
Proof.
(* Goal: forall l : natlist, @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l *)
simple induction l.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat (Cons nat a l))) (Cons nat a l) *)
(* Goal: @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat (Nil nat))) (Nil nat) *)
simpl in |- *.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat (Cons nat a l))) (Cons nat a l) *)
(* Goal: @eq (list nat) (Nil nat) (Nil nat) *)
reflexivity.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat (Cons nat a l))) (Cons nat a l) *)
simpl in |- *.
(* Goal: forall (a : nat) (l : list nat) (_ : @eq (list nat) (map Z nat Z.abs_nat (map nat Z Z.of_nat l)) l), @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat a)) (map Z nat Z.abs_nat (map nat Z Z.of_nat l))) (Cons nat a l) *)
intros h t IH.
(* Goal: @eq (list nat) (Cons nat (Z.abs_nat (Z.of_nat h)) (map Z nat Z.abs_nat (map nat Z Z.of_nat t))) (Cons nat h t) *)
rewrite abs_inj.
(* Goal: @eq (list nat) (Cons nat h (map Z nat Z.abs_nat (map nat Z Z.of_nat t))) (Cons nat h t) *)
rewrite IH.
(* Goal: @eq (list nat) (Cons nat h t) (Cons nat h t) *)
reflexivity.
Qed.
Lemma inj_abs_pos_list :
forall l : Zlist, allPos l -> map _ _ Z_of_nat (map _ _ Zabs_nat l) = l.
Proof.
(* Goal: forall (l : Zlist) (_ : allPos l), @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat l)) l *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : allPos l, @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat l)) l) (_ : allPos (Cons Z a l)), @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat (Cons Z a l))) (Cons Z a l) *)
(* Goal: forall _ : allPos (Nil Z), @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat (Nil Z))) (Nil Z) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : allPos l, @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat l)) l) (_ : allPos (Cons Z a l)), @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat (Cons Z a l))) (Cons Z a l) *)
(* Goal: forall _ : allPos (Nil Z), @eq (list Z) (Nil Z) (Nil Z) *)
intros.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : allPos l, @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat l)) l) (_ : allPos (Cons Z a l)), @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat (Cons Z a l))) (Cons Z a l) *)
(* Goal: @eq (list Z) (Nil Z) (Nil Z) *)
reflexivity.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : allPos l, @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat l)) l) (_ : allPos (Cons Z a l)), @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat (Cons Z a l))) (Cons Z a l) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall _ : allPos l, @eq (list Z) (map nat Z Z.of_nat (map Z nat Z.abs_nat l)) l) (_ : allPos (Cons Z a l)), @eq (list Z) (Cons Z (Z.of_nat (Z.abs_nat a)) (map nat Z Z.of_nat (map Z nat Z.abs_nat l))) (Cons Z a l) *)
intros h t IH H.
(* Goal: @eq (list Z) (Cons Z (Z.of_nat (Z.abs_nat h)) (map nat Z Z.of_nat (map Z nat Z.abs_nat t))) (Cons Z h t) *)
elim H.
(* Goal: forall (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), @eq (list Z) (Cons Z (Z.of_nat (Z.abs_nat h)) (map nat Z Z.of_nat (map Z nat Z.abs_nat t))) (Cons Z h t) *)
intros.
(* Goal: @eq (list Z) (Cons Z (Z.of_nat (Z.abs_nat h)) (map nat Z Z.of_nat (map Z nat Z.abs_nat t))) (Cons Z h t) *)
rewrite inj_abs_pos.
(* Goal: Z.ge h Z0 *)
(* Goal: @eq (list Z) (Cons Z h (map nat Z Z.of_nat (map Z nat Z.abs_nat t))) (Cons Z h t) *)
rewrite IH.
(* Goal: Z.ge h Z0 *)
(* Goal: allPos t *)
(* Goal: @eq (list Z) (Cons Z h t) (Cons Z h t) *)
reflexivity.
(* Goal: Z.ge h Z0 *)
(* Goal: allPos t *)
assumption.
(* Goal: Z.ge h Z0 *)
assumption.
Qed.
Lemma inlist_inj_abs_pos_list :
forall (q : nat) (l : Zlist),
allPos l -> inlist nat q (map Z nat Zabs_nat l) -> inlist Z (Z_of_nat q) l.
Proof.
(* Goal: forall (q : nat) (l : Zlist) (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l *)
simple induction l.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l) (_ : allPos (Cons Z a l)) (_ : inlist nat q (map Z nat Z.abs_nat (Cons Z a l))), inlist Z (Z.of_nat q) (Cons Z a l) *)
(* Goal: forall (_ : allPos (Nil Z)) (_ : inlist nat q (map Z nat Z.abs_nat (Nil Z))), inlist Z (Z.of_nat q) (Nil Z) *)
unfold inlist in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l) (_ : allPos (Cons Z a l)) (_ : inlist nat q (map Z nat Z.abs_nat (Cons Z a l))), inlist Z (Z.of_nat q) (Cons Z a l) *)
(* Goal: forall (_ : allPos (Nil Z)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Nil Z))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Nil Z) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l) (_ : allPos (Cons Z a l)) (_ : inlist nat q (map Z nat Z.abs_nat (Cons Z a l))), inlist Z (Z.of_nat q) (Cons Z a l) *)
(* Goal: forall (_ : allPos (Nil Z)) (_ : False), False *)
intros.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l) (_ : allPos (Cons Z a l)) (_ : inlist nat q (map Z nat Z.abs_nat (Cons Z a l))), inlist Z (Z.of_nat q) (Cons Z a l) *)
(* Goal: False *)
assumption.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : allPos l) (_ : inlist nat q (map Z nat Z.abs_nat l)), inlist Z (Z.of_nat q) l) (_ : allPos (Cons Z a l)) (_ : inlist nat q (map Z nat Z.abs_nat (Cons Z a l))), inlist Z (Z.of_nat q) (Cons Z a l) *)
unfold inlist in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : allPos l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : allPos (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *)
unfold allPos in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : alllist Z (fun x : Z => Z.ge x Z0) (Cons Z a l)) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat (Cons Z a l))), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) (Cons Z a l) *)
simpl in |- *.
(* Goal: forall (a : Z) (l : list Z) (_ : forall (_ : alllist Z (fun x : Z => Z.ge x Z0) l) (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l)), exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) (_ : and (Z.ge a Z0) (alllist Z (fun x : Z => Z.ge x Z0) l)) (_ : or (@eq nat q (Z.abs_nat a)) (exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat l))), or (@eq Z (Z.of_nat q) a) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) l) *)
intros h t IH Hp H.
(* Goal: or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
elim Hp.
(* Goal: forall (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
elim H.
(* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
(* Goal: forall (_ : @eq nat q (Z.abs_nat h)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
left.
(* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
(* Goal: @eq Z (Z.of_nat q) h *)
rewrite H0.
(* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
(* Goal: @eq Z (Z.of_nat (Z.abs_nat h)) h *)
rewrite inj_abs_pos.
(* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
(* Goal: Z.ge h Z0 *)
(* Goal: @eq Z h h *)
reflexivity.
(* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
(* Goal: Z.ge h Z0 *)
intros.
(* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
(* Goal: Z.ge h Z0 *)
assumption.
(* Goal: forall (_ : exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t)) (_ : Z.ge h Z0) (_ : alllist Z (fun x : Z => Z.ge x Z0) t), or (@eq Z (Z.of_nat q) h) (exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t) *)
right.
(* Goal: exlist Z (fun b : Z => @eq Z (Z.of_nat q) b) t *)
apply IH.
(* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *)
(* Goal: alllist Z (fun x : Z => Z.ge x Z0) t *)
assumption.
(* Goal: exlist nat (fun b : nat => @eq nat q b) (map Z nat Z.abs_nat t) *)
assumption.
Qed.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Group_kernel.
Require Export Free_group.
Section Generated_group_def.
Variable G : GROUP.
Variable A : part_set G.
Definition generated_group : subgroup G := coKer (FG_lift (inj_part A)).
End Generated_group_def.
Lemma generated_group_minimal :
forall (G : GROUP) (A : part_set G) (H : subgroup G),
included A H -> included (generated_group A) H.
Proof.
(* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))) (H : subgroup G) (_ : @included (sgroup_set (monoid_sgroup (group_monoid G))) A (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @included (sgroup_set (monoid_sgroup (group_monoid G))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
unfold included in |- *.
(* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))) (H : subgroup G) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x A), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
simpl in |- *.
(* Goal: forall (G : group) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid G)))) (H : subgroup G) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x A), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros G A H H' x H'0; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
elim H'0; intros x0; clear H'0.
(* Goal: forall _ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0)), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
generalize x; clear x.
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
elim x0.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (c : Carrier (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) c)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros c; try assumption.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) c)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
elim c.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (subtype_elt : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (subtype_prf : @Pred_fun (sgroup_set (monoid_sgroup (group_monoid G))) A subtype_elt) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A subtype_elt subtype_prf))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
simpl in |- *.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (subtype_elt : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Pred_fun (sgroup_set (monoid_sgroup (group_monoid G))) A subtype_elt) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x subtype_elt)), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros y subtype_prf x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with y; auto with algebra.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (f0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f0))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Law (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f f0)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros f H'0 f0 H'1 x H'2; elim H'2; intros H'3 H'4; try exact H'4; clear H'2.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
simpl in H'4.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (FG_lift_fun (inj_part A) f) (FG_lift_fun (inj_part A) f0)); auto with algebra.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (Unit (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
simpl in |- *.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros x H'0; elim H'0; intros H'1 H'2; try exact H'2; clear H'0.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (monoid_unit G); auto with algebra.
(* Goal: forall (f : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (_ : forall (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) f))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Inv (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) f)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros f H'0 x H'1; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
elim H'1; intros H'2 H'3; simpl in H'3; clear H'1.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (group_inverse G (FG_lift_fun (inj_part A) f)); auto with algebra.
Qed.
Lemma generated_group_prop_included :
forall (G : GROUP) (A : part_set G), included A (generated_group A).
Proof.
(* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))), @included (sgroup_set (monoid_sgroup (group_monoid G))) A (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *)
unfold included in |- *.
(* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x A), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *)
simpl in |- *.
(* Goal: forall (G : group) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid G)))) (x : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) x A), @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0))) *)
intros G A x H'; try assumption.
(* Goal: @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x0 : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x0))) *)
exists (Var (V:=A) (Build_subtype (E:=G) (P:=A) (subtype_elt:=x) H')); split; [ idtac | try assumption ].
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A x H'))) *)
(* Goal: True *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) (@Var (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) (@Build_subtype (sgroup_set (monoid_sgroup (group_monoid G))) A x H'))) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x x *)
auto with algebra.
Qed.
Lemma generated_group_prop :
forall (G : GROUP) (A : part_set G) (y : G),
in_part y (generated_group A) ->
exists x : FG A, Equal y (FG_lift (inj_part A) x).
Proof.
(* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A))))), @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) (group_monoid G) (@FG_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) x)) *)
simpl in |- *; auto with algebra.
(* Goal: forall (G : group) (A : Predicate (sgroup_set (monoid_sgroup (group_monoid G)))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x)))), @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x)) *)
intros G A y H'; try assumption.
(* Goal: @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x)) *)
elim H'; intros x E; elim E; intros H'0 H'1; try exact H'1; clear E H'.
(* Goal: @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x)) *)
exists x; try assumption.
Qed.
Lemma generated_group_prop_rev :
forall (G : GROUP) (A : part_set G) (y : G),
(exists x : FG A, Equal y (FG_lift (inj_part A) x)) ->
in_part y (generated_group A).
Proof.
(* Goal: forall (G : Ob GROUP) (A : Carrier (part_set (sgroup_set (monoid_sgroup (group_monoid G))))) (y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@Ap (sgroup_set (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))))) (sgroup_set (monoid_sgroup (group_monoid G))) (@sgroup_map (monoid_sgroup (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))))) (monoid_sgroup (group_monoid G)) (@monoid_sgroup_hom (group_monoid (FreeGroup (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) (group_monoid G) (@FG_lift (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A)))) x))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *)
intros G A y H'; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *)
elim H'; intros x E; try exact E; clear H'.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) y (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G (@generated_group G A)))) *)
simpl in |- *; auto with algebra.
(* Goal: @ex (FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A))) (fun x : FG (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) => and True (@Equal (sgroup_set (monoid_sgroup (group_monoid G))) y (@FG_lift_fun (@set_of_subtype_image (sgroup_set (monoid_sgroup (group_monoid G))) (@part (sgroup_set (monoid_sgroup (group_monoid G))) A)) G (@inj_part (sgroup_set (monoid_sgroup (group_monoid G))) A) x))) *)
exists x; split; [ idtac | try assumption ].
(* Goal: True *)
auto with algebra.
Qed.
Hint Resolve generated_group_minimal generated_group_prop_included
generated_group_prop_rev: algebra.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrfun ssrbool eqtype ssrnat choice seq fintype.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Reserved Notation "\pi_ Q" (at level 0, format "\pi_ Q").
Reserved Notation "\pi" (at level 0, format "\pi").
Reserved Notation "{pi_ Q a }"
(at level 0, Q at next level, format "{pi_ Q a }").
Reserved Notation "{pi a }" (at level 0, format "{pi a }").
Reserved Notation "x == y %[mod_eq e ]" (at level 70, y at next level,
no associativity, format "'[hv ' x '/' == y '/' %[mod_eq e ] ']'").
Reserved Notation "x = y %[mod_eq e ]" (at level 70, y at next level,
no associativity, format "'[hv ' x '/' = y '/' %[mod_eq e ] ']'").
Reserved Notation "x != y %[mod_eq e ]" (at level 70, y at next level,
no associativity, format "'[hv ' x '/' != y '/' %[mod_eq e ] ']'").
Reserved Notation "x <> y %[mod_eq e ]" (at level 70, y at next level,
no associativity, format "'[hv ' x '/' <> y '/' %[mod_eq e ] ']'").
Reserved Notation "{eq_quot e }" (at level 0, e at level 0,
format "{eq_quot e }", only parsing).
Delimit Scope quotient_scope with qT.
Local Open Scope quotient_scope.
Section QuotientDef.
Variable T : Type.
Record quot_mixin_of qT := QuotClass {
quot_repr : qT -> T;
quot_pi : T -> qT;
_ : cancel quot_repr quot_pi
}.
Notation quot_class_of := quot_mixin_of.
Record quotType := QuotTypePack {
quot_sort :> Type;
quot_class : quot_class_of quot_sort
}.
Variable qT : quotType.
Definition pi_phant of phant qT := quot_pi (quot_class qT).
Local Notation "\pi" := (pi_phant (Phant qT)).
Definition repr_of := quot_repr (quot_class qT).
Lemma repr_ofK : cancel repr_of \pi.
Proof.
(* Goal: @cancel T (quot_sort qT) repr_of (pi_phant (Phant (quot_sort qT))) *)
by rewrite /pi_phant /repr_of /=; case: qT=> [? []].
Qed.
Definition QuotType_clone (Q : Type) qT cT
of phant_id (quot_class qT) cT := @QuotTypePack Q cT.
End QuotientDef.
Arguments repr_ofK {T qT}.
Module Type PiSig.
Parameter f : forall (T : Type) (qT : quotType T), phant qT -> T -> qT.
Axiom E : f = pi_phant.
End PiSig.
Module Pi : PiSig.
Definition f := pi_phant.
Definition E := erefl f.
End Pi.
Module MPi : PiSig.
Definition f := pi_phant.
Definition E := erefl f.
End MPi.
Module Type ReprSig.
Parameter f : forall (T : Type) (qT : quotType T), qT -> T.
Axiom E : f = repr_of.
End ReprSig.
Module Repr : ReprSig.
Definition f := repr_of.
Definition E := erefl f.
End Repr.
Notation repr := Repr.f.
Notation "\pi_ Q" := (@Pi.f _ _ (Phant Q)) : quotient_scope.
Notation "\pi" := (@Pi.f _ _ (Phant _)) (only parsing) : quotient_scope.
Notation "x == y %[mod Q ]" := (\pi_Q x == \pi_Q y) : quotient_scope.
Notation "x = y %[mod Q ]" := (\pi_Q x = \pi_Q y) : quotient_scope.
Notation "x != y %[mod Q ]" := (\pi_Q x != \pi_Q y) : quotient_scope.
Notation "x <> y %[mod Q ]" := (\pi_Q x <> \pi_Q y) : quotient_scope.
Local Notation "\mpi" := (@MPi.f _ _ (Phant _)).
Canonical mpi_unlock := Unlockable MPi.E.
Canonical pi_unlock := Unlockable Pi.E.
Canonical repr_unlock := Unlockable Repr.E.
Notation quot_class_of := quot_mixin_of.
Notation QuotType Q m := (@QuotTypePack _ Q m).
Notation "[ 'quotType' 'of' Q ]" := (@QuotType_clone _ Q _ _ id)
(at level 0, format "[ 'quotType' 'of' Q ]") : form_scope.
Arguments repr {T qT} x.
Section QuotTypeTheory.
Variable T : Type.
Variable qT : quotType T.
Lemma reprK : cancel repr \pi_qT.
Proof.
(* Goal: @cancel T (@quot_sort T qT) (@Repr.f T qT) (@Pi.f T qT (Phant (@quot_sort T qT))) *)
by move=> x; rewrite !unlock repr_ofK.
Qed.
Variant pi_spec (x : T) : T -> Type :=
PiSpec y of x = y %[mod qT] : pi_spec x y.
Lemma piP (x : T) : pi_spec x (repr (\pi_qT x)).
Proof.
(* Goal: pi_spec x (@Repr.f T qT (@Pi.f T qT (Phant (@quot_sort T qT)) x)) *)
by constructor; rewrite reprK.
Qed.
Lemma mpiE : \mpi =1 \pi_qT.
Proof.
(* Goal: @eqfun (@quot_sort T qT) T (@MPi.f T qT (Phant (@quot_sort T qT))) (@Pi.f T qT (Phant (@quot_sort T qT))) *)
by move=> x; rewrite !unlock.
Qed.
Lemma quotW P : (forall y : T, P (\pi_qT y)) -> forall x : qT, P x.
Proof.
(* Goal: forall (_ : forall y : T, P (@Pi.f T qT (Phant (@quot_sort T qT)) y)) (x : @quot_sort T qT), P x *)
by move=> Py x; rewrite -[x]reprK; apply: Py.
Qed.
Lemma quotP P : (forall y : T, repr (\pi_qT y) = y -> P (\pi_qT y))
-> forall x : qT, P x.
Proof.
(* Goal: forall (_ : forall (y : T) (_ : @eq T (@Repr.f T qT (@Pi.f T qT (Phant (@quot_sort T qT)) y)) y), P (@Pi.f T qT (Phant (@quot_sort T qT)) y)) (x : @quot_sort T qT), P x *)
by move=> Py x; rewrite -[x]reprK; apply: Py; rewrite reprK.
Qed.
End QuotTypeTheory.
Arguments reprK {T qT} x.
Structure equal_to T (x : T) := EqualTo {
equal_val : T;
_ : x = equal_val
}.
Lemma equal_toE (T : Type) (x : T) (m : equal_to x) : equal_val m = x.
Proof.
(* Goal: @eq T (@equal_val T x m) x *)
by case: m.
Qed.
Lemma pi_morph2 : \pi (g a b) = gq (equal_val x) (equal_val y). Proof. by rewrite !piE. Qed.
Proof.
(* Goal: @eq (@quot_sort T qT) (@Pi.f T qT (Phant (@quot_sort T qT)) (g a b)) (gq (@equal_val (@quot_sort T qT) (@Pi.f T qT (Phant (@quot_sort T qT)) a) x) (@equal_val (@quot_sort T qT) (@Pi.f T qT (Phant (@quot_sort T qT)) b) y)) *)
by rewrite !piE.
Qed.
Lemma pi_mono2 : r a b = rq (equal_val x) (equal_val y). Proof. by rewrite !piE. Qed.
Proof.
(* Goal: @eq U (r a b) (rq (@equal_val (@quot_sort T qT) (@Pi.f T qT (Phant (@quot_sort T qT)) a) x) (@equal_val (@quot_sort T qT) (@Pi.f T qT (Phant (@quot_sort T qT)) b) y)) *)
by rewrite !piE.
Qed.
End Morphism.
Arguments pi_morph1 {T qT f fq}.
Arguments pi_morph2 {T qT g gq}.
Arguments pi_mono1 {T U qT p pq}.
Arguments pi_mono2 {T U qT r rq}.
Arguments pi_morph11 {T U qT qU h hq}.
Notation "{pi_ Q a }" := (equal_to (\pi_Q a)) : quotient_scope.
Notation "{pi a }" := (equal_to (\pi a)) : quotient_scope.
Notation PiMorph pi_x := (EqualTo pi_x).
Notation PiMorph1 pi_f :=
(fun a (x : {pi a}) => EqualTo (pi_morph1 pi_f a x)).
Notation PiMorph2 pi_g :=
(fun a b (x : {pi a}) (y : {pi b}) => EqualTo (pi_morph2 pi_g a b x y)).
Notation PiMono1 pi_p :=
(fun a (x : {pi a}) => EqualTo (pi_mono1 pi_p a x)).
Notation PiMono2 pi_r :=
(fun a b (x : {pi a}) (y : {pi b}) => EqualTo (pi_mono2 pi_r a b x y)).
Notation PiMorph11 pi_f :=
(fun a (x : {pi a}) => EqualTo (pi_morph11 pi_f a x)).
Notation lift_op1 Q f := (locked (fun x : Q => \pi_Q (f (repr x)) : Q)).
Notation lift_op2 Q g :=
(locked (fun x y : Q => \pi_Q (g (repr x) (repr y)) : Q)).
Notation lift_fun1 Q f := (locked (fun x : Q => f (repr x))).
Notation lift_fun2 Q g := (locked (fun x y : Q => g (repr x) (repr y))).
Notation lift_op11 Q Q' f := (locked (fun x : Q => \pi_Q' (f (repr x)) : Q')).
Notation lift_cst Q x := (locked (\pi_Q x : Q)).
Notation PiConst a := (@EqualTo _ _ a (lock _)).
Notation lift_embed qT e := (locked (fun x => \pi_qT (e x) : qT)).
Lemma eq_lock T T' e : e =1 (@locked (T -> T') (fun x : T => e x)).
Proof.
(* Goal: @eqfun T' T e (@locked (forall _ : T, T') (fun x : T => e x)) *)
by rewrite -lock.
Qed.
Prenex Implicits eq_lock.
Notation PiEmbed e :=
(fun x => @EqualTo _ _ (e x) (eq_lock (fun _ => \pi _) _)).
Section EqQuotTypeStructure.
Variable T : Type.
Variable eq_quot_op : rel T.
Definition eq_quot_mixin_of (Q : Type) (qc : quot_class_of T Q)
(ec : Equality.class_of Q) :=
{mono \pi_(QuotTypePack qc) : x y /
eq_quot_op x y >-> @eq_op (Equality.Pack ec) x y}.
Record eq_quot_class_of (Q : Type) : Type := EqQuotClass {
eq_quot_quot_class :> quot_class_of T Q;
eq_quot_eq_mixin :> Equality.class_of Q;
pi_eq_quot_mixin :> eq_quot_mixin_of eq_quot_quot_class eq_quot_eq_mixin
}.
Record eqQuotType : Type := EqQuotTypePack {
eq_quot_sort :> Type;
_ : eq_quot_class_of eq_quot_sort;
}.
Implicit Type eqT : eqQuotType.
Definition eq_quot_class eqT : eq_quot_class_of eqT :=
let: EqQuotTypePack _ cT as qT' := eqT return eq_quot_class_of qT' in cT.
Canonical eqQuotType_eqType eqT := EqType eqT (eq_quot_class eqT).
Canonical eqQuotType_quotType eqT := QuotType eqT (eq_quot_class eqT).
Coercion eqQuotType_eqType : eqQuotType >-> eqType.
Coercion eqQuotType_quotType : eqQuotType >-> quotType.
Definition EqQuotType_pack Q :=
fun (qT : quotType T) (eT : eqType) qc ec
of phant_id (quot_class qT) qc & phant_id (Equality.class eT) ec =>
fun m => EqQuotTypePack (@EqQuotClass Q qc ec m).
Definition EqQuotType_clone (Q : Type) eqT cT
of phant_id (eq_quot_class eqT) cT := @EqQuotTypePack Q cT.
Lemma pi_eq_quot eqT : {mono \pi_eqT : x y / eq_quot_op x y >-> x == y}.
Proof.
(* Goal: @monomorphism_2 T (@quot_sort T (eqQuotType_quotType eqT)) bool (@Pi.f T (eqQuotType_quotType eqT) (Phant (eq_quot_sort eqT))) (fun x y : T => eq_quot_op x y) (fun x y : @quot_sort T (eqQuotType_quotType eqT) => @eq_op (eqQuotType_eqType eqT) x y) *)
by case: eqT => [] ? [].
Qed.
Canonical pi_eq_quot_mono eqT := PiMono2 (pi_eq_quot eqT).
End EqQuotTypeStructure.
Notation EqQuotType e Q m := (@EqQuotType_pack _ e Q _ _ _ _ id id m).
Notation "[ 'eqQuotType' e 'of' Q ]" := (@EqQuotType_clone _ e Q _ _ id)
(at level 0, format "[ 'eqQuotType' e 'of' Q ]") : form_scope.
Module QuotSubType.
Section SubTypeMixin.
Variable T : eqType.
Variable qT : quotType T.
Definition Sub x (px : repr (\pi_qT x) == x) := \pi_qT x.
Lemma qreprK x Px : repr (@Sub x Px) = x.
Proof.
(* Goal: @eq (Equality.sort T) (@Repr.f (Equality.sort T) qT (@Sub x Px)) x *)
by rewrite /Sub (eqP Px).
Qed.
Lemma sortPx (x : qT) : repr (\pi_qT (repr x)) == repr x.
Proof.
(* Goal: is_true (@eq_op T (@Repr.f (Equality.sort T) qT (@Pi.f (Equality.sort T) qT (Phant (@quot_sort (Equality.sort T) qT)) (@Repr.f (Equality.sort T) qT x))) (@Repr.f (Equality.sort T) qT x)) *)
by rewrite !reprK eqxx.
Qed.
Lemma sort_Sub (x : qT) : x = Sub (sortPx x).
Proof.
(* Goal: @eq (@quot_sort (Equality.sort T) qT) x (@Sub (@Repr.f (Equality.sort T) qT x) (sortPx x)) *)
by rewrite /Sub reprK.
Qed.
Lemma reprP K (PK : forall x Px, K (@Sub x Px)) u : K u.
Proof.
(* Goal: K u *)
by rewrite (sort_Sub u); apply: PK.
Qed.
Canonical subType := SubType _ _ _ reprP qreprK.
Definition eqMixin := Eval hnf in [eqMixin of qT by <:].
Proof.
(* Goal: Equality.mixin_of (type_of (Phantom (rel D) (@enc_mod_rel D (Choice.sort C) CD DC (@equiv D eD) encD))) *)
exact: CanEqMixin ereprK.
Qed.
Canonical eqType := EqType qT eqMixin.
End SubTypeMixin.
Definition choiceMixin (T : choiceType) (qT : quotType T) :=
Eval hnf in [choiceMixin of qT by <:].
Canonical choiceType (T : choiceType) (qT : quotType T) :=
ChoiceType qT (@choiceMixin T qT).
Definition countMixin (T : countType) (qT : quotType T) :=
Eval hnf in [countMixin of qT by <:].
Canonical countType (T : countType) (qT : quotType T) :=
CountType qT (@countMixin T qT).
Section finType.
Variables (T : finType) (qT : quotType T).
Canonical subCountType := [subCountType of qT].
Definition finMixin := Eval hnf in [finMixin of qT by <:].
End finType.
End QuotSubType.
Notation "[ 'subType' Q 'of' T 'by' %/ ]" :=
(@SubType T _ Q _ _ (@QuotSubType.reprP _ _) (@QuotSubType.qreprK _ _))
(at level 0, format "[ 'subType' Q 'of' T 'by' %/ ]") : form_scope.
Notation "[ 'eqMixin' 'of' Q 'by' <:%/ ]" :=
(@QuotSubType.eqMixin _ _: Equality.class_of Q)
(at level 0, format "[ 'eqMixin' 'of' Q 'by' <:%/ ]") : form_scope.
Notation "[ 'choiceMixin' 'of' Q 'by' <:%/ ]" :=
(@QuotSubType.choiceMixin _ _: Choice.mixin_of Q)
(at level 0, format "[ 'choiceMixin' 'of' Q 'by' <:%/ ]") : form_scope.
Notation "[ 'countMixin' 'of' Q 'by' <:%/ ]" :=
(@QuotSubType.countMixin _ _: Countable.mixin_of Q)
(at level 0, format "[ 'countMixin' 'of' Q 'by' <:%/ ]") : form_scope.
Notation "[ 'finMixin' 'of' Q 'by' <:%/ ]" :=
(@QuotSubType.finMixin _ _: Finite.mixin_of Q)
(at level 0, format "[ 'finMixin' 'of' Q 'by' <:%/ ]") : form_scope.
Section EquivRel.
Variable T : Type.
Lemma left_trans (e : rel T) :
symmetric e -> transitive e -> left_transitive e.
Proof.
(* Goal: forall (_ : @symmetric T e) (_ : @transitive T e), @left_transitive T e *)
by move=> s t ? * ?; apply/idP/idP; apply: t; rewrite // s.
Qed.
Lemma right_trans (e : rel T) :
symmetric e -> transitive e -> right_transitive e.
Proof.
(* Goal: forall (_ : @symmetric T e) (_ : @transitive T e), @right_transitive T e *)
by move=> s t ? * x; rewrite ![e x _]s; apply: left_trans.
Qed.
Variant equiv_class_of (equiv : rel T) :=
EquivClass of reflexive equiv & symmetric equiv & transitive equiv.
Record equiv_rel := EquivRelPack {
equiv :> rel T;
_ : equiv_class_of equiv
}.
Variable e : equiv_rel.
Definition equiv_class :=
let: EquivRelPack _ ce as e' := e return equiv_class_of e' in ce.
Definition equiv_pack (r : rel T) ce of phant_id ce equiv_class :=
@EquivRelPack r ce.
Lemma equiv_sym : symmetric e. Proof. by case: e => [] ? []. Qed.
Proof.
(* Goal: @symmetric T (equiv e) *)
by case: e => [] ? [].
Qed.
Lemma eq_op_trans (T' : eqType) : transitive (@eq_op T').
Proof.
(* Goal: @transitive (Equality.sort T') (@eq_op T') *)
by move=> x y z; move/eqP->; move/eqP->.
Qed.
Lemma equiv_ltrans: left_transitive e.
Proof.
(* Goal: @left_transitive T (equiv e) *)
by apply: left_trans; [apply: equiv_sym|apply: equiv_trans].
Qed.
Lemma equiv_rtrans: right_transitive e.
Proof.
(* Goal: @right_transitive T (equiv e) *)
by apply: right_trans; [apply: equiv_sym|apply: equiv_trans].
Qed.
End EquivRel.
Hint Resolve equiv_refl : core.
Notation EquivRel r er es et := (@EquivRelPack _ r (EquivClass er es et)).
Notation "[ 'equiv_rel' 'of' e ]" := (@equiv_pack _ _ e _ id)
(at level 0, format "[ 'equiv_rel' 'of' e ]") : form_scope.
Section EncodingModuloRel.
Variables (D E : Type) (ED : E -> D) (DE : D -> E) (e : rel D).
Variant encModRel_class_of (r : rel D) :=
EncModRelClassPack of (forall x, r x x -> r (ED (DE x)) x) & (r =2 e).
Record encModRel := EncModRelPack {
enc_mod_rel :> rel D;
_ : encModRel_class_of enc_mod_rel
}.
Variable r : encModRel.
Definition encModRelClass :=
let: EncModRelPack _ c as r' := r return encModRel_class_of r' in c.
Definition encModRelP (x : D) : r x x -> r (ED (DE x)) x.
Proof.
(* Goal: forall _ : is_true (enc_mod_rel r x x), is_true (enc_mod_rel r (ED (DE x)) x) *)
by case: r => [] ? [] /= he _ /he.
Qed.
Definition encoded_equiv : rel E := [rel x y | r (ED x) (ED y)].
End EncodingModuloRel.
Notation EncModRelClass m :=
(EncModRelClassPack (fun x _ => m x) (fun _ _ => erefl _)).
Notation EncModRel r m := (@EncModRelPack _ _ _ _ _ r (EncModRelClass m)).
Section EncodingModuloEquiv.
Variables (D E : Type) (ED : E -> D) (DE : D -> E) (e : equiv_rel D).
Variable (r : encModRel ED DE e).
Lemma enc_mod_rel_is_equiv : equiv_class_of (enc_mod_rel r).
Proof.
(* Goal: @equiv_class_of D (@enc_mod_rel D E ED DE (@equiv D e) r) *)
split => [x|x y|y x z]; rewrite !encModRelE //; first by rewrite equiv_sym.
(* Goal: forall (_ : is_true (@equiv D e x y)) (_ : is_true (@equiv D e y z)), is_true (@equiv D e x z) *)
by move=> exy /(equiv_trans exy).
Qed.
Definition enc_mod_rel_equiv_rel := EquivRelPack enc_mod_rel_is_equiv.
Definition encModEquivP (x : D) : r (ED (DE x)) x.
Proof.
(* Goal: is_true (@enc_mod_rel D E ED DE (@equiv D e) r (ED (DE x)) x) *)
by rewrite encModRelP ?encModRelE.
Qed.
Local Notation e' := (encoded_equiv r).
Lemma encoded_equivE : e' =2 [rel x y | e (ED x) (ED y)].
Proof.
(* Goal: @eqrel bool E E (@encoded_equiv D E ED DE (@equiv D e) r) (@rel_of_simpl_rel E (@SimplRel E (fun x y : E => @equiv D e (ED x) (ED y)))) *)
by move=> x y; rewrite /encoded_equiv /= encModRelE.
Qed.
Local Notation e'E := encoded_equivE.
Lemma encoded_equiv_is_equiv : equiv_class_of e'.
Proof.
(* Goal: @equiv_class_of E (@encoded_equiv D E ED DE (@equiv D e) r) *)
split => [x|x y|y x z]; rewrite !e'E //=; first by rewrite equiv_sym.
(* Goal: forall (_ : is_true (@equiv D e (ED x) (ED y))) (_ : is_true (@equiv D e (ED y) (ED z))), is_true (@equiv D e (ED x) (ED z)) *)
by move=> exy /(equiv_trans exy).
Qed.
Canonical encoded_equiv_equiv_rel := EquivRelPack encoded_equiv_is_equiv.
Lemma encoded_equivP x : e' (DE (ED x)) x.
Proof.
(* Goal: is_true (@encoded_equiv D E ED DE (@equiv D e) r (DE (ED x)) x) *)
by rewrite /encoded_equiv /= encModEquivP.
Qed.
End EncodingModuloEquiv.
Module EquivQuot.
Section EquivQuot.
Variables (D : Type) (C : choiceType) (CD : C -> D) (DC : D -> C).
Variables (eD : equiv_rel D) (encD : encModRel CD DC eD).
Notation eC := (encoded_equiv encD).
Definition canon x := choose (eC x) (x).
Record equivQuotient := EquivQuotient {
erepr : C;
_ : (frel canon) erepr erepr
}.
Definition type_of of (phantom (rel _) encD) := equivQuotient.
Lemma canon_id : forall x, (invariant canon canon) x.
Proof.
(* Goal: forall x : Choice.sort C, is_true (@pred_of_simpl (Choice.sort C) (@invariant (Choice.sort C) (Choice.eqType C) canon canon) x) *)
move=> x /=; rewrite /canon (@eq_choose _ _ (eC x)).
(* Goal: @eqfun bool (Choice.sort C) (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x)) (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) *)
(* Goal: is_true (@eq_op (Choice.eqType C) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x)) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x)) *)
by rewrite (@choose_id _ (eC x) _ x) ?chooseP ?equiv_refl.
(* Goal: @eqfun bool (Choice.sort C) (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x)) (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) *)
by move=> y; apply: equiv_ltrans; rewrite equiv_sym /= chooseP.
Qed.
Definition pi := locked (fun x => EquivQuotient (canon_id x)).
Lemma ereprK : cancel erepr pi.
Proof.
(* Goal: @cancel (Choice.sort C) equivQuotient erepr pi *)
unlock pi; case=> x hx; move/eqP:(hx)=> hx'.
(* Goal: @eq equivQuotient (@EquivQuotient (canon (erepr (@EquivQuotient x hx))) (canon_id (erepr (@EquivQuotient x hx)))) (@EquivQuotient x hx) *)
exact: (@val_inj _ _ [subType for erepr]).
Qed.
Local Notation encDE := (encModRelE encD).
Local Notation encDP := (encModEquivP encD).
Canonical encD_equiv_rel := EquivRelPack (enc_mod_rel_is_equiv encD).
Lemma pi_CD (x y : C) : reflect (pi x = pi y) (eC x y).
Proof.
(* Goal: Bool.reflect (@eq equivQuotient (pi x) (pi y)) (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x y) *)
apply: (iffP idP) => hxy.
(* Goal: is_true (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x y) *)
(* Goal: @eq equivQuotient (pi x) (pi y) *)
apply: (can_inj ereprK); unlock pi canon => /=.
(* Goal: is_true (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x y) *)
(* Goal: @eq (Choice.sort C) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD y) y) *)
rewrite -(@eq_choose _ (eC x) (eC y)); last first.
(* Goal: is_true (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x y) *)
(* Goal: @eq (Choice.sort C) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) y) *)
(* Goal: @eqfun bool (Choice.sort C) (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD y) *)
by move=> z; rewrite /eC /=; apply: equiv_ltrans.
(* Goal: is_true (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x y) *)
(* Goal: @eq (Choice.sort C) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x) (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) y) *)
by apply: choose_id; rewrite ?equiv_refl //.
(* Goal: is_true (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x y) *)
rewrite (equiv_trans (chooseP (equiv_refl _ _))) //=.
(* Goal: is_true (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD x) x) y) *)
move: hxy => /(f_equal erepr) /=; unlock pi canon => /= ->.
(* Goal: is_true (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD (@choose C (@encoded_equiv D (Choice.sort C) CD DC (@equiv D eD) encD y) y) y) *)
by rewrite equiv_sym /= chooseP.
Qed.
Lemma pi_DC (x y : D) :
reflect (pi (DC x) = pi (DC y)) (eD x y).
Proof.
(* Goal: Bool.reflect (@eq equivQuotient (pi (DC x)) (pi (DC y))) (@equiv D eD x y) *)
apply: (iffP idP)=> hxy.
(* Goal: is_true (@equiv D eD x y) *)
(* Goal: @eq equivQuotient (pi (DC x)) (pi (DC y)) *)
apply/pi_CD; rewrite /eC /=.
(* Goal: is_true (@equiv D eD x y) *)
(* Goal: is_true (@enc_mod_rel D (Choice.sort C) CD DC (@equiv D eD) encD (CD (DC x)) (CD (DC y))) *)
by rewrite (equiv_ltrans (encDP _)) (equiv_rtrans (encDP _)) /= encDE.
(* Goal: is_true (@equiv D eD x y) *)
rewrite -encDE -(equiv_ltrans (encDP _)) -(equiv_rtrans (encDP _)) /=.
(* Goal: is_true (@enc_mod_rel D (Choice.sort C) CD DC (@equiv D eD) encD (CD (DC x)) (CD (DC y))) *)
exact/pi_CD.
Qed.
Lemma equivQTP : cancel (CD \o erepr) (pi \o DC).
Proof.
(* Goal: @cancel D equivQuotient (@funcomp D (Choice.sort C) equivQuotient tt CD erepr) (@funcomp equivQuotient (Choice.sort C) D tt pi DC) *)
by move=> x; rewrite /= (pi_CD _ (erepr x) _) ?ereprK /eC /= ?encDP.
Qed.
Local Notation qT := (type_of (Phantom (rel D) encD)).
Definition quotClass := QuotClass equivQTP.
Canonical quotType := QuotType qT quotClass.
Lemma eqmodP x y : reflect (x = y %[mod qT]) (eD x y).
Proof.
(* Goal: Bool.reflect (@eq (@quot_sort D quotType) (@Pi.f D quotType (Phant (type_of (Phantom (rel D) (@enc_mod_rel D (Choice.sort C) CD DC (@equiv D eD) encD)))) x) (@Pi.f D quotType (Phant (type_of (Phantom (rel D) (@enc_mod_rel D (Choice.sort C) CD DC (@equiv D eD) encD)))) y)) (@equiv D eD x y) *)
by apply: (iffP (pi_DC _ _)); rewrite !unlock.
Qed.
Canonical eqType := EqType qT eqMixin.
Definition choiceMixin := CanChoiceMixin ereprK.
Canonical choiceType := ChoiceType qT choiceMixin.
Lemma eqmodE x y : x == y %[mod qT] = eD x y.
Proof.
(* Goal: @eq bool (@eq_op eqType (@Pi.f D quotType (Phant (type_of (Phantom (rel D) (@enc_mod_rel D (Choice.sort C) CD DC (@equiv D eD) encD)))) x) (@Pi.f D quotType (Phant (type_of (Phantom (rel D) (@enc_mod_rel D (Choice.sort C) CD DC (@equiv D eD) encD)))) y)) (@equiv D eD x y) *)
exact: sameP eqP (@eqmodP _ _).
Qed.
Canonical eqQuotType := EqQuotType eD qT eqmodE.
End EquivQuot.
End EquivQuot.
Canonical EquivQuot.quotType.
Canonical EquivQuot.eqType.
Canonical EquivQuot.choiceType.
Canonical EquivQuot.eqQuotType.
Arguments EquivQuot.ereprK {D C CD DC eD encD}.
Notation "{eq_quot e }" :=
(@EquivQuot.type_of _ _ _ _ _ _ (Phantom (rel _) e)) : quotient_scope.
Notation "x == y %[mod_eq r ]" := (x == y %[mod {eq_quot r}]) : quotient_scope.
Notation "x = y %[mod_eq r ]" := (x = y %[mod {eq_quot r}]) : quotient_scope.
Notation "x != y %[mod_eq r ]" := (x != y %[mod {eq_quot r}]) : quotient_scope.
Notation "x <> y %[mod_eq r ]" := (x <> y %[mod {eq_quot r}]) : quotient_scope.
Section DefaultEncodingModuloRel.
Variables (D : choiceType) (r : rel D).
Definition defaultEncModRelClass :=
@EncModRelClassPack D D id id r r (fun _ rxx => rxx) (fun _ _ => erefl _).
Canonical defaultEncModRel := EncModRelPack defaultEncModRelClass.
End DefaultEncodingModuloRel.
Section CountEncodingModuloRel.
Variables (D : Type) (C : countType) (CD : C -> D) (DC : D -> C).
Variables (eD : equiv_rel D) (encD : encModRel CD DC eD).
Notation eC := (encoded_equiv encD).
Fact eq_quot_countMixin : Countable.mixin_of {eq_quot encD}.
Proof.
(* Goal: Countable.mixin_of (@EquivQuot.type_of D (Countable.choiceType C) CD DC eD encD (Phantom (rel D) (@enc_mod_rel D (Countable.sort C) CD DC (@equiv D eD) encD))) *)
exact: CanCountMixin EquivQuot.ereprK.
Qed.
Canonical eq_quot_countType := CountType {eq_quot encD} eq_quot_countMixin.
End CountEncodingModuloRel.
Section EquivQuotTheory.
Variables (T : choiceType) (e : equiv_rel T) (Q : eqQuotType e).
Lemma eqmodE x y : x == y %[mod_eq e] = e x y.
Lemma eqmodP x y : reflect (x = y %[mod_eq e]) (e x y).
End EquivQuotTheory.
Prenex Implicits eqmodE eqmodP.
Section EqQuotTheory.
Variables (T : Type) (e : rel T) (Q : eqQuotType e).
Lemma eqquotE x y : x == y %[mod Q] = e x y.
Proof.
(* Goal: @eq bool (@eq_op (@eqQuotType_eqType T e Q) (@Pi.f T (@eqQuotType_quotType T e Q) (Phant (@eq_quot_sort T e Q)) x) (@Pi.f T (@eqQuotType_quotType T e Q) (Phant (@eq_quot_sort T e Q)) y)) (e x y) *)
by rewrite pi_eq_quot.
Qed.
Lemma eqquotP x y : reflect (x = y %[mod Q]) (e x y).
Proof.
(* Goal: Bool.reflect (@eq (@quot_sort T (@eqQuotType_quotType T e Q)) (@Pi.f T (@eqQuotType_quotType T e Q) (Phant (@eq_quot_sort T e Q)) x) (@Pi.f T (@eqQuotType_quotType T e Q) (Phant (@eq_quot_sort T e Q)) y)) (e x y) *)
by rewrite -eqquotE; apply/eqP.
Qed.
End EqQuotTheory.
Prenex Implicits eqquotE eqquotP.
|
Require Import TS.
Require Import sur_les_relations.
Inductive e_beta_par : forall b : wsort, TS b -> TS b -> Prop :=
| var_bpar : forall n : nat, e_beta_par wt (var n) (var n)
| id_bpar : e_beta_par ws id id
| shift_bpar : e_beta_par ws shift shift
| app_bpar :
forall M N M' N' : terms,
e_beta_par wt M M' ->
e_beta_par wt N N' -> e_beta_par wt (app M N) (app M' N')
| lambda_bpar :
forall M M' : terms,
e_beta_par wt M M' -> e_beta_par wt (lambda M) (lambda M')
| env_bpar :
forall (M M' : terms) (s s' : sub_explicits),
e_beta_par wt M M' ->
e_beta_par ws s s' -> e_beta_par wt (env M s) (env M' s')
| beta_bpar :
forall M N M' N' : terms,
e_beta_par wt M M' ->
e_beta_par wt N N' ->
e_beta_par wt (app (lambda M) N) (env M' (cons N' id))
| cons_bpar :
forall (M M' : terms) (s s' : sub_explicits),
e_beta_par wt M M' ->
e_beta_par ws s s' -> e_beta_par ws (cons M s) (cons M' s')
| lift_bpar :
forall s s' : sub_explicits,
e_beta_par ws s s' -> e_beta_par ws (lift s) (lift s')
| comp_bpar :
forall s s' t t' : sub_explicits,
e_beta_par ws s s' ->
e_beta_par ws t t' -> e_beta_par ws (comp s t) (comp s' t')
| metaX_bpar : forall n : nat, e_beta_par wt (meta_X n) (meta_X n)
| metax_bpar : forall n : nat, e_beta_par ws (meta_x n) (meta_x n).
Hint Resolve var_bpar id_bpar shift_bpar app_bpar lambda_bpar env_bpar
beta_bpar cons_bpar lift_bpar comp_bpar metaX_bpar metax_bpar.
Notation beta_par := (e_beta_par _) (only parsing).
Goal forall (b : wsort) (M : TS b), e_beta_par _ M M.
simple induction M; auto.
Save refl_betapar.
Hint Resolve refl_betapar.
Definition e_betapar_inv (b : wsort) (M N : TS b) :=
match M in (TS b) return Prop with
| var n =>
match N in (TS b) return Prop with
| var m =>
n = m
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| app M1 M2 =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2
| lambda N1 => False
| env N1 N2 =>
exists M3 : terms,
(exists N3 : terms,
M1 = lambda M3 /\
e_beta_par _ M3 N1 /\ N2 = cons N3 id /\ e_beta_par _ M2 N3)
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| lambda M1 =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => e_beta_par _ M1 N1
| env N1 N2 => False
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| env M1 M2 =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| id =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => True
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| shift =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => False
| shift => True
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| cons M1 M2 =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => False
| shift => False
| cons N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2
| comp N1 N2 => False
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| comp M1 M2 =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => e_beta_par _ M1 N1 /\ e_beta_par _ M2 N2
| lift N1 => False
| meta_X n => False
| meta_x n => False
end
| lift M1 =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => e_beta_par _ M1 N1
| meta_X n => False
| meta_x n => False
end
| meta_X n =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X m => n = m
| meta_x m => False
end
| meta_x n =>
match N in (TS b) return Prop with
| var n =>
False
| app N1 N2 => False
| lambda N1 => False
| env N1 N2 => False
| id => False
| shift => False
| cons N1 N2 => False
| comp N1 N2 => False
| lift N1 => False
| meta_X m => False
| meta_x m => n = m
end
end.
Notation betapar_inv := (e_betapar_inv _) (only parsing).
Goal
forall (b : wsort) (M N : TS b), e_beta_par _ M N -> e_betapar_inv _ M N.
simple induction 1; intros; simpl in |- *; auto.
exists M0; exists N'; auto.
Save lemma1_inv_betapar.
Hint Resolve lemma1_inv_betapar.
Goal
forall (P : terms -> Prop) (n : nat),
P (var n) -> forall M : terms, e_beta_par _ (var n) M -> P M.
intros P n H M H0; cut (e_betapar_inv _ (var n) M).
2: auto.
pattern M in |- *; apply terms_ind.
simple induction 1; assumption.
simple induction 3.
simple induction 2.
simple induction 2.
simple induction 1.
Save case_bvar.
Goal
forall (P : terms -> Prop) (a b : terms),
(forall a' b' : terms,
e_beta_par _ a a' -> e_beta_par _ b b' -> P (app a' b')) ->
(forall a1 a1' b' : terms,
a = lambda a1 ->
e_beta_par _ a1 a1' -> e_beta_par _ b b' -> P (env a1' (cons b' id))) ->
forall M : terms, e_beta_par _ (app a b) M -> P M.
intros P a b H H0 M H1; cut (e_betapar_inv _ (app a b) M).
2: auto.
pattern M in |- *; apply terms_ind.
simple induction 1.
unfold e_betapar_inv at 3 in |- *; intros a' b' H2 H3 H4.
elim H4; intros H5 H6.
apply H; assumption.
simple induction 2.
unfold e_betapar_inv at 2 in |- *; intros a1' H2 s H3.
elim H3; intros a1 H4; elim H4; intros b' H5.
elim H5; intros H6 H7; elim H7; intros H8 H9; elim H9; intros H10 H11.
try rewrite H6; try rewrite H10; apply (H0 a1); assumption.
simple induction 1.
Save case_bapp.
Goal
forall (P : terms -> Prop) (a : terms),
(forall a' : terms, e_beta_par _ a a' -> P (lambda a')) ->
forall M : terms, e_beta_par _ (lambda a) M -> P M.
intros P a H M H0; cut (e_betapar_inv _ (lambda a) M).
2: auto.
pattern M in |- *; apply terms_ind.
simple induction 1.
simple induction 3.
unfold e_betapar_inv at 2 in |- *; intros a' H1 H2.
apply H; assumption.
simple induction 2.
simple induction 1.
Save case_blambda.
Goal
forall (P : terms -> Prop) (a : terms) (s : sub_explicits),
(forall (a' : terms) (s' : sub_explicits),
e_beta_par _ a a' -> e_beta_par _ s s' -> P (env a' s')) ->
forall M : terms, e_beta_par _ (env a s) M -> P M.
intros P a s H M H0; cut (e_betapar_inv _ (env a s) M).
2: auto.
pattern M in |- *; apply terms_ind.
simple induction 1.
simple induction 3.
simple induction 2.
unfold e_betapar_inv at 2 in |- *; intros a' H1 s' H2.
elim H2; intros; apply H; assumption.
simple induction 1.
Save case_benv.
Goal
forall P : sub_explicits -> Prop,
P id -> forall M : sub_explicits, e_beta_par _ id M -> P M.
intros P H M H0; cut (e_betapar_inv _ id M).
2: auto.
pattern M in |- *; apply sub_explicits_ind.
intro; assumption.
simple induction 1.
simple induction 2.
simple induction 3.
simple induction 2.
simple induction 1.
Save case_bid.
Goal
forall P : sub_explicits -> Prop,
P shift -> forall M : sub_explicits, e_beta_par _ shift M -> P M.
intros P H M H0; cut (e_betapar_inv _ shift M).
2: auto.
pattern M in |- *; apply sub_explicits_ind.
simple induction 1.
intro; assumption.
simple induction 2.
simple induction 3.
simple induction 2.
simple induction 1.
Save case_bshift.
Goal
forall (P : sub_explicits -> Prop) (a : terms) (s : sub_explicits),
(forall (a' : terms) (s' : sub_explicits),
e_beta_par _ a a' -> e_beta_par _ s s' -> P (cons a' s')) ->
forall M : sub_explicits, e_beta_par _ (cons a s) M -> P M.
intros P a s H M H0; cut (e_betapar_inv _ (cons a s) M).
2: auto.
pattern M in |- *; apply sub_explicits_ind.
simple induction 1.
simple induction 1.
unfold e_betapar_inv at 2 in |- *; intros s' H1 a' H2.
elim H2; intros.
apply H; assumption.
simple induction 3.
simple induction 2.
simple induction 1.
Save case_bcons.
Goal
forall (P : sub_explicits -> Prop) (s t : sub_explicits),
(forall s' t' : sub_explicits,
e_beta_par _ s s' -> e_beta_par _ t t' -> P (comp s' t')) ->
forall M : sub_explicits, e_beta_par _ (comp s t) M -> P M.
intros P s t H M H0; cut (e_betapar_inv _ (comp s t) M).
2: auto.
pattern M in |- *; apply sub_explicits_ind.
simple induction 1.
simple induction 1.
simple induction 2.
unfold e_betapar_inv at 3 in |- *.
intros s' t' H1 H2 H3; elim H3; intros; apply H; assumption.
simple induction 2.
simple induction 1.
Save case_bcomp.
Goal
forall (P : sub_explicits -> Prop) (s : sub_explicits),
(forall s' : sub_explicits, e_beta_par _ s s' -> P (lift s')) ->
forall M : sub_explicits, e_beta_par _ (lift s) M -> P M.
intros P s H M H0; cut (e_betapar_inv _ (lift s) M).
2: auto.
pattern M in |- *; apply sub_explicits_ind.
simple induction 1.
simple induction 1.
simple induction 2.
simple induction 3.
unfold e_betapar_inv at 2 in |- *.
intros s' H1 H2; apply H; assumption.
simple induction 1.
Save case_blift.
Goal
forall (P : terms -> Prop) (n : nat),
P (meta_X n) -> forall M : terms, e_beta_par _ (meta_X n) M -> P M.
intros P n H M H0; cut (e_betapar_inv _ (meta_X n) M).
2: auto.
pattern M in |- *; apply terms_ind.
simple induction 1.
simple induction 3.
simple induction 2.
simple induction 2.
simple induction 1; assumption.
Save case_bmetaX.
Goal
forall (P : sub_explicits -> Prop) (n : nat),
P (meta_x n) -> forall M : sub_explicits, e_beta_par _ (meta_x n) M -> P M.
intros P n H M H0; cut (e_betapar_inv _ (meta_x n) M).
2: auto.
pattern M in |- *; apply sub_explicits_ind.
simple induction 1.
simple induction 1.
simple induction 2.
simple induction 3.
simple induction 2.
simple induction 1; assumption.
Save case_bmetax.
|
Require Import syntax.
Require Import freevars.
Inductive rename : vari -> vari -> tm -> tm -> Prop :=
| ren_o : forall nv v : vari, rename nv v o o
| ren_ttt : forall nv v : vari, rename nv v ttt ttt
| ren_fff : forall nv v : vari, rename nv v fff fff
| ren_abs1 :
forall (nv v : vari) (t : ty) (e : tm),
rename nv v (abs v t e) (abs v t e)
| ren_abs2 :
forall (nv v x nx : vari) (t : ty) (e1 e2 e3 : tm),
nv = x ->
~ FV nx e1 ->
nx <> v ->
nx <> nv ->
rename nx x e1 e2 ->
rename nv v e2 e3 -> rename nv v (abs x t e1) (abs nx t e3)
| ren_abs3 :
forall (nv v x : vari) (t : ty) (e ne : tm),
v <> x ->
nv <> x -> rename nv v e ne -> rename nv v (abs x t e) (abs x t ne)
| ren_appl :
forall (nv v : vari) (e1 e2 ne1 ne2 : tm),
rename nv v e1 ne1 ->
rename nv v e2 ne2 -> rename nv v (appl e1 e2) (appl ne1 ne2)
| ren_cond :
forall (nv v : vari) (e1 ne1 e2 ne2 e3 ne3 : tm),
rename nv v e1 ne1 ->
rename nv v e2 ne2 ->
rename nv v e3 ne3 -> rename nv v (cond e1 e2 e3) (cond ne1 ne2 ne3)
| ren_var_eq : forall nv v : vari, rename nv v (var v) (var nv)
| ren_var_not_eq :
forall nv v x : vari, v <> x -> rename nv v (var x) (var x)
| ren_succ :
forall (nv v : vari) (e ne : tm),
rename nv v e ne -> rename nv v (succ e) (succ ne)
| ren_prd :
forall (nv v : vari) (e ne : tm),
rename nv v e ne -> rename nv v (prd e) (prd ne)
| ren_is_o :
forall (nv v : vari) (e ne : tm),
rename nv v e ne -> rename nv v (is_o e) (is_o ne)
| ren_fix1 :
forall (nv v : vari) (t : ty) (e : tm),
rename nv v (Fix v t e) (Fix v t e)
| ren_fix2 :
forall (nv v x nx : vari) (t : ty) (e1 e2 e3 : tm),
nv = x ->
~ FV nx e1 ->
nx <> v ->
nx <> nv ->
rename nx x e1 e2 ->
rename nv v e2 e3 -> rename nv v (Fix x t e1) (Fix nx t e3)
| ren_fix3 :
forall (nv v x : vari) (t : ty) (e ne : tm),
v <> x ->
nv <> x -> rename nv v e ne -> rename nv v (Fix x t e) (Fix x t ne)
| ren_clos1 :
forall (nv v : vari) (t : ty) (e a na : tm),
rename nv v a na -> rename nv v (clos e v t a) (clos e v t na)
| ren_clos2 :
forall (nv v x nx : vari) (t : ty) (e e' ne a na : tm),
nv = x ->
~ FV nx e ->
nx <> v ->
nx <> nv ->
rename nx x e e' ->
rename nv v e' ne ->
rename nv v a na -> rename nv v (clos e x t a) (clos ne nx t na)
| ren_clos3 :
forall (nv v x : vari) (t : ty) (e ne a na : tm),
v <> x ->
nv <> x ->
rename nv v e ne ->
rename nv v a na -> rename nv v (clos e x t a) (clos ne x t na).
Goal
forall (nx x : vari) (e ne : tm), rename nx x e ne -> nx <> x -> ~ FV x ne.
simple induction 1; simpl in |- *; intros.
apply inv_FV_o.
apply inv_FV_ttt.
apply inv_FV_fff.
red in |- *; intro F; specialize inv_FV_abs with (1 := F);
simple induction 1; intros Fe N.
apply N; reflexivity.
red in |- *; intro F; specialize inv_FV_abs with (1 := F).
simple induction 1; intros Fe3 N.
red in H7; apply H7; assumption.
red in |- *; intro F; specialize inv_FV_abs with (1 := F).
simple induction 1; intros Fe N.
red in H3; apply H3; assumption.
red in |- *; intro F; specialize inv_FV_appl with (1 := F);
simple induction 1.
apply H1; assumption.
apply H3; assumption.
red in |- *; intro F; specialize inv_FV_cond with (1 := F);
simple induction 1. apply H1; assumption.
simple induction 1.
apply H3; assumption.
apply H5; assumption.
red in |- *; intro F; specialize inv_FV_var with (1 := F).
intro; apply H0; symmetry in |- *; assumption.
red in |- *; intro F; specialize inv_FV_var with (1 := F). assumption.
red in |- *; intro F; specialize inv_FV_succ with (1 := F).
apply H1; assumption.
red in |- *; intro F; specialize inv_FV_prd with (1 := F); apply H1;
assumption.
red in |- *; intro F; specialize inv_FV_is_o with (1 := F); apply H1;
assumption.
red in |- *; intro F; specialize inv_FV_fix with (1 := F);
simple induction 1; intros Fe N.
apply N; reflexivity.
red in |- *; intro F; specialize inv_FV_fix with (1 := F).
simple induction 1; intros Fe3 N.
red in H7; apply H7; assumption.
red in |- *; intro F; specialize inv_FV_fix with (1 := F).
simple induction 1; intros Fe N.
red in H3; apply H3; assumption.
red in |- *; intro F; specialize inv_FV_clos with (1 := F).
simple induction 1. apply H1; assumption.
simple induction 1; intros Fe N.
apply N; reflexivity.
red in |- *; intro F; specialize inv_FV_clos with (1 := F).
simple induction 1. apply H9; assumption.
simple induction 1; intros Fe3 N.
red in H7; apply H7; assumption.
red in |- *; intro F; specialize inv_FV_clos with (1 := F).
simple induction 1. apply H5; assumption.
simple induction 1; intros Fe N.
red in H3; apply H3; assumption.
Save RenNotFree.
|
Require Import Arith Div2 List.
Require Import BellantoniCook.Lib BellantoniCook.Bitstring BellantoniCook.Cobham BellantoniCook.CobhamLib.
Opaque bs2nat.
Opaque Cond.
Lemma bs2nat_smash' : forall u v n,
bs2nat v = power 2 n ->
bs2nat (smash' u v) = power 2 (length u + n).
Proof.
(* Goal: forall (u v : list bool) (n : nat) (_ : @eq nat (bs2nat v) (power (S (S O)) n)), @eq nat (bs2nat (smash' u v)) (power (S (S O)) (Init.Nat.add (@length bool u) n)) *)
induction u; simpl; intros; auto.
(* Goal: @eq nat (bs2nat (@cons bool false (smash' u v))) (Init.Nat.add (power (S (S O)) (Init.Nat.add (@length bool u) n)) (Init.Nat.add (power (S (S O)) (Init.Nat.add (@length bool u) n)) O)) *)
rewrite bs2nat_false, (IHu v n); trivial.
Qed.
Lemma bs2nat_smash_bs : forall u v,
bs2nat (smash_bs u v) = power 2 (length u * length v).
Proof.
(* Goal: forall u v : list bool, @eq nat (bs2nat (smash_bs u v)) (power (S (S O)) (Init.Nat.mul (@length bool u) (@length bool v))) *)
induction u; simpl; intros; auto.
(* Goal: @eq nat (bs2nat (smash' v (smash_bs u v))) (power (S (S O)) (Init.Nat.add (@length bool v) (Init.Nat.mul (@length bool u) (@length bool v)))) *)
rewrite bs2nat_smash' with (n := length u * length v); trivial.
Qed.
Lemma Smash_correct : forall l,
bs2nat (Sem Smash l) = power 2 (length (hd nil l) * length (hd nil (tl l))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Smash l)) (power (S (S O)) (Init.Nat.mul (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
intros [ | u [ | v l] ]; trivial; simpl.
(* Goal: @eq nat (bs2nat (smash_bs u v)) (power (S (S O)) (Init.Nat.mul (@length bool u) (@length bool v))) *)
(* Goal: @eq nat (bs2nat (smash_bs u (@nil bool))) (power (S (S O)) (Init.Nat.mul (@length bool u) O)) *)
rewrite mult_0_r; simpl.
(* Goal: @eq nat (bs2nat (smash_bs u v)) (power (S (S O)) (Init.Nat.mul (@length bool u) (@length bool v))) *)
(* Goal: @eq nat (bs2nat (smash_bs u (@nil bool))) (S O) *)
induction u as [ | [ | ] u IH]; trivial.
(* Goal: @eq nat (bs2nat (smash_bs u v)) (power (S (S O)) (Init.Nat.mul (@length bool u) (@length bool v))) *)
apply bs2nat_smash_bs.
Qed.
Lemma Zero_correct_bs n l:
Sem (Zero_e n) l = nil.
Proof.
(* Goal: @eq (list bool) (Sem (Zero_e n) l) (@nil bool) *)
trivial.
Qed.
Lemma Zero_correct n l:
bs2nat (Sem (Zero_e n) l) = 0.
Proof.
(* Goal: @eq nat (bs2nat (Sem (Zero_e n) l)) O *)
trivial.
Qed.
Definition False_e n :=
Comp n (Succ false) [Zero_e n].
Lemma arity_False: forall n : nat, arity (False_e n) = ok_arity n.
Proof.
(* Goal: forall n : nat, @eq Arity (arity (False_e n)) (ok_arity n) *)
simpl; simpl.
(* Goal: forall n : nat, @eq Arity (if andb (Nat.eqb n n) true then ok_arity n else error_Comp (ok_arity (S O)) (@cons Arity (ok_arity n) (@nil Arity))) (ok_arity n) *)
intros.
(* Goal: @eq Arity (if andb (Nat.eqb n n) true then ok_arity n else error_Comp (ok_arity (S O)) (@cons Arity (ok_arity n) (@nil Arity))) (ok_arity n) *)
rewrite <- beq_nat_refl.
(* Goal: @eq Arity (if andb true true then ok_arity n else error_Comp (ok_arity (S O)) (@cons Arity (ok_arity n) (@nil Arity))) (ok_arity n) *)
simpl.
(* Goal: @eq Arity (ok_arity n) (ok_arity n) *)
trivial.
Qed.
Lemma rec_bounded_False: forall n : nat, rec_bounded (False_e n).
Proof.
(* Goal: forall n : nat, rec_bounded (False_e n) *)
intros; simpl; intuition.
Qed.
Lemma False_correct: forall (n : nat) (l : list bs), bs2nat (Sem (False_e n) l) = 0.
Proof.
(* Goal: forall (n : nat) (l : list (list bool)), @eq nat (bs2nat (Sem (False_e n) l)) O *)
intros; simpl; auto.
Qed.
Lemma False_correct_bs: forall (n : nat) (l : list bs), Sem (False_e n) l = [false].
Proof.
(* Goal: forall (n : nat) (l : list (list bool)), @eq (list bool) (Sem (False_e n) l) (@cons bool false (@nil bool)) *)
intros; simpl; auto.
Qed.
Lemma One_correct n l:
bs2nat (Sem (One_e n) l) = 1.
Proof.
(* Goal: @eq nat (bs2nat (Sem (One_e n) l)) (S O) *)
trivial.
Qed.
Lemma One_correct_bs n l:
Sem (One_e n) l = [true].
Proof.
(* Goal: @eq (list bool) (Sem (One_e n) l) (@cons bool true (@nil bool)) *)
trivial.
Qed.
Opaque Zero_e One_e False_e Rev_e RemoveLSZ_e.
Definition Normalize_e : Cobham :=
Comp 1 Rev_e [Comp 1 RemoveLSZ_e [Rev_e]].
Lemma arity_Normalize :
arity Normalize_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity Normalize_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma rec_bounded_Normalize :
rec_bounded Normalize_e.
Proof.
(* Goal: rec_bounded Normalize_e *)
simpl; intuition.
(* Goal: rec_bounded Rev_e *)
(* Goal: rec_bounded RemoveLSZ_e *)
(* Goal: rec_bounded Rev_e *)
apply rec_bounded_Rev.
(* Goal: rec_bounded Rev_e *)
(* Goal: rec_bounded RemoveLSZ_e *)
apply rec_bounded_RemoveLSZ.
(* Goal: rec_bounded Rev_e *)
apply rec_bounded_Rev.
Qed.
Lemma Normalize_correct : forall l,
bs2nat (Sem Normalize_e l) = bs2nat (Sem (Proj 1 0) l).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Normalize_e l)) (bs2nat (Sem (Proj (S O) O) l)) *)
destruct l as [ | v l]; trivial;simpl.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) v l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat v) *)
induction v as [ | [ | ] v IH]; trivial.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool true v) l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat (@cons bool true v)) *)
rewrite bs2nat_true.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool true v) l)) (@nil (list bool)))) (@nil (list bool))))) (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v))) *)
do 2 rewrite Rev_correct in *; simpl in *.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@app bool (@rev bool v) (@cons bool true (@nil bool))) (@nil (list bool)))))) (S (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O))) *)
rewrite RemoveLSZ_app, <- IH.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (@rev bool match Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool))) with | nil => Sem RemoveLSZ_e (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))) | cons b l => @app bool (@cons bool b l) (@cons bool true (@nil bool)) end)) (S (Init.Nat.add (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool)))))) (Init.Nat.add (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool)))))) O))) *)
destruct (Sem RemoveLSZ_e [rev v]); trivial; simpl.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (@app bool (@rev bool (@app bool l0 (@cons bool true (@nil bool)))) (@cons bool b (@nil bool)))) (S (Init.Nat.add (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool)))) (Init.Nat.add (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool)))) O))) *)
rewrite rev_unit; trivial.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) (bs2nat (@cons bool false v)) *)
rewrite bs2nat_false.
(* Goal: @eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) (Init.Nat.mul (S (S O)) (bs2nat v)) *)
do 2 rewrite Rev_correct in *; simpl in *.
(* Goal: @eq nat (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@app bool (@rev bool v) (@cons bool false (@nil bool))) (@nil (list bool)))))) (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)) *)
rewrite RemoveLSZ_app, <- IH.
(* Goal: @eq nat (bs2nat (@rev bool match Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool))) with | nil => Sem RemoveLSZ_e (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))) | cons b l => @app bool (@cons bool b l) (@cons bool false (@nil bool)) end)) (Init.Nat.add (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool)))))) (Init.Nat.add (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool)))))) O)) *)
destruct (Sem RemoveLSZ_e [rev v]); trivial; simpl.
(* Goal: @eq nat (bs2nat (@app bool (@rev bool (@app bool l0 (@cons bool false (@nil bool)))) (@cons bool b (@nil bool)))) (Init.Nat.add (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool)))) (Init.Nat.add (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool)))) O)) *)
rewrite rev_unit; trivial.
Qed.
Lemma Normalize_normal : forall l,
Sem Normalize_e l = nil \/ bs2nat (Sem Normalize_e l) <> 0.
Proof.
(* Goal: forall l : list (list bool), or (@eq (list bool) (Sem Normalize_e l) (@nil bool)) (not (@eq nat (bs2nat (Sem Normalize_e l)) O)) *)
destruct l as [ | v l].
(* Goal: or (@eq (list bool) (Sem Normalize_e (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (Sem Normalize_e (@cons (list bool) v l))) O)) *)
(* Goal: or (@eq (list bool) (Sem Normalize_e (@nil (list bool))) (@nil bool)) (not (@eq nat (bs2nat (Sem Normalize_e (@nil (list bool)))) O)) *)
tauto.
(* Goal: or (@eq (list bool) (Sem Normalize_e (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (Sem Normalize_e (@cons (list bool) v l))) O)) *)
simpl.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) v l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) v l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
induction v as [ | [ | ] v IH].
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool true v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool true v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@nil bool) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@nil bool) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
tauto.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool true v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool true v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
do 2 rewrite Rev_correct in *.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool true v) l))) (@nil (list bool)))) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool true v) l))) (@nil (list bool)))) (@nil (list bool)))))) O)) *)
simpl in *.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@app bool (@rev bool v) (@cons bool true (@nil bool))) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@app bool (@rev bool v) (@cons bool true (@nil bool))) (@nil (list bool)))))) O)) *)
rewrite RemoveLSZ_app.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool match Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool))) with | nil => Sem RemoveLSZ_e (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))) | cons b l => @app bool (@cons bool b l) (@cons bool true (@nil bool)) end) (@nil bool)) (not (@eq nat (bs2nat (@rev bool match Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool))) with | nil => Sem RemoveLSZ_e (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))) | cons b l => @app bool (@cons bool b l) (@cons bool true (@nil bool)) end)) O)) *)
destruct (Sem RemoveLSZ_e [rev v]).
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool (@app bool (@cons bool b l0) (@cons bool true (@nil bool)))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (@app bool (@cons bool b l0) (@cons bool true (@nil bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool)))))) O)) *)
right.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool (@app bool (@cons bool b l0) (@cons bool true (@nil bool)))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (@app bool (@cons bool b l0) (@cons bool true (@nil bool))))) O)) *)
(* Goal: not (@eq nat (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@cons bool true (@nil bool)) (@nil (list bool)))))) O) *)
discriminate.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool (@app bool (@cons bool b l0) (@cons bool true (@nil bool)))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (@app bool (@cons bool b l0) (@cons bool true (@nil bool))))) O)) *)
right.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: not (@eq nat (bs2nat (@rev bool (@app bool (@cons bool b l0) (@cons bool true (@nil bool))))) O) *)
simpl.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: not (@eq nat (bs2nat (@app bool (@rev bool (@app bool l0 (@cons bool true (@nil bool)))) (@cons bool b (@nil bool)))) O) *)
rewrite rev_unit.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
(* Goal: not (@eq nat (bs2nat (@app bool (@cons bool true (@rev bool l0)) (@cons bool b (@nil bool)))) O) *)
discriminate.
(* Goal: or (@eq (list bool) (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Rev_e (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (Sem Rev_e (@cons (list bool) (@cons bool false v) l)) (@nil (list bool)))) (@nil (list bool))))) O)) *)
do 2 rewrite Rev_correct in *.
(* Goal: or (@eq (list bool) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false v) l))) (@nil (list bool)))) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (Sem RemoveLSZ_e (@cons (list bool) (@rev bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false v) l))) (@nil (list bool)))) (@nil (list bool)))))) O)) *)
simpl in *.
(* Goal: or (@eq (list bool) (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@app bool (@rev bool v) (@cons bool false (@nil bool))) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@app bool (@rev bool v) (@cons bool false (@nil bool))) (@nil (list bool)))))) O)) *)
rewrite RemoveLSZ_app.
(* Goal: or (@eq (list bool) (@rev bool match Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool))) with | nil => Sem RemoveLSZ_e (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))) | cons b l => @app bool (@cons bool b l) (@cons bool false (@nil bool)) end) (@nil bool)) (not (@eq nat (bs2nat (@rev bool match Sem RemoveLSZ_e (@cons (list bool) (@rev bool v) (@nil (list bool))) with | nil => Sem RemoveLSZ_e (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))) | cons b l => @app bool (@cons bool b l) (@cons bool false (@nil bool)) end)) O)) *)
destruct (Sem RemoveLSZ_e [rev v]).
(* Goal: or (@eq (list bool) (@rev bool (@app bool (@cons bool b l0) (@cons bool false (@nil bool)))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (@app bool (@cons bool b l0) (@cons bool false (@nil bool))))) O)) *)
(* Goal: or (@eq (list bool) (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (Sem RemoveLSZ_e (@cons (list bool) (@cons bool false (@nil bool)) (@nil (list bool)))))) O)) *)
trivial.
(* Goal: or (@eq (list bool) (@rev bool (@app bool (@cons bool b l0) (@cons bool false (@nil bool)))) (@nil bool)) (not (@eq nat (bs2nat (@rev bool (@app bool (@cons bool b l0) (@cons bool false (@nil bool))))) O)) *)
simpl in *.
(* Goal: or (@eq (list bool) (@app bool (@rev bool (@app bool l0 (@cons bool false (@nil bool)))) (@cons bool b (@nil bool))) (@nil bool)) (not (@eq nat (bs2nat (@app bool (@rev bool (@app bool l0 (@cons bool false (@nil bool)))) (@cons bool b (@nil bool)))) O)) *)
rewrite rev_unit.
(* Goal: or (@eq (list bool) (@app bool (@cons bool false (@rev bool l0)) (@cons bool b (@nil bool))) (@nil bool)) (not (@eq nat (bs2nat (@app bool (@cons bool false (@rev bool l0)) (@cons bool b (@nil bool)))) O)) *)
simpl.
(* Goal: or (@eq (list bool) (@cons bool false (@app bool (@rev bool l0) (@cons bool b (@nil bool)))) (@nil bool)) (not (@eq nat (bs2nat (@cons bool false (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O)) *)
right.
(* Goal: not (@eq nat (bs2nat (@cons bool false (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
rewrite bs2nat_false.
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
destruct IH as [IH | IH].
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
apply app_eq_nil in IH.
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
destruct IH as [_ IH].
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
congruence.
(* Goal: not (@eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool (@rev bool l0) (@cons bool b (@nil bool))))) O) *)
omega.
Qed.
Opaque Normalize_e.
Definition Succ_e : Cobham :=
Rec
(Comp 0 (Succ true) [Zero])
(Comp 2 (Succ true) [Proj 2 0])
(Comp 2 (Succ false) [Proj 2 1])
(Comp 1 (Succ true) [Proj 1 0]).
Lemma arity_Succ : arity Succ_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity Succ_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma length_Succ : forall l,
length (Sem Succ_e l) <= length (Sem (Comp 1 (Succ true) [Proj 1 0]) l).
Proof.
(* Goal: forall l : list (list bool), le (@length bool (Sem Succ_e l)) (@length bool (Sem (Comp (S O) (Succ true) (@cons Cobham (Proj (S O) O) (@nil Cobham))) l)) *)
destruct l as [ | v l]; trivial; simpl.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @cons bool true (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) v l)) (S (@length bool v)) *)
induction v as [ | [ | ] v IH]; trivial; simpl; omega.
Qed.
Lemma le_1_length_Succ v :
1 <= length (Sem Succ_e [v]).
Proof.
(* Goal: le (S O) (@length bool (Sem Succ_e (@cons (list bool) v (@nil (list bool))))) *)
destruct v as [ | [ | ] v]; trivial; simpl; omega.
Qed.
Lemma le_length_Succ v :
length v <= length (Sem Succ_e [v]).
Proof.
(* Goal: le (@length bool v) (@length bool (Sem Succ_e (@cons (list bool) v (@nil (list bool))))) *)
induction v as [ | [ | ] v IH].
(* Goal: le (@length bool (@cons bool false v)) (@length bool (Sem Succ_e (@cons (list bool) (@cons bool false v) (@nil (list bool))))) *)
(* Goal: le (@length bool (@cons bool true v)) (@length bool (Sem Succ_e (@cons (list bool) (@cons bool true v) (@nil (list bool))))) *)
(* Goal: le (@length bool (@nil bool)) (@length bool (Sem Succ_e (@cons (list bool) (@nil bool) (@nil (list bool))))) *)
simpl; omega.
(* Goal: le (@length bool (@cons bool false v)) (@length bool (Sem Succ_e (@cons (list bool) (@cons bool false v) (@nil (list bool))))) *)
(* Goal: le (@length bool (@cons bool true v)) (@length bool (Sem Succ_e (@cons (list bool) (@cons bool true v) (@nil (list bool))))) *)
simpl in *.
(* Goal: le (@length bool (@cons bool false v)) (@length bool (Sem Succ_e (@cons (list bool) (@cons bool false v) (@nil (list bool))))) *)
(* Goal: le (S (@length bool v)) (S (@length bool (sem_Rec (fun _ : list (list bool) => @cons bool true (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) v (@nil (list bool))))) *)
omega.
(* Goal: le (@length bool (@cons bool false v)) (@length bool (Sem Succ_e (@cons (list bool) (@cons bool false v) (@nil (list bool))))) *)
trivial.
Qed.
Lemma Succ_length v :
length (Sem Succ_e v) <= S (length (hd nil v)).
Proof.
(* Goal: le (@length bool (Sem Succ_e v)) (S (@length bool (@hd (list bool) (@nil bool) v))) *)
intros; simpl.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @cons bool true (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@hd (list bool) (@nil bool) v) (@tl (list bool) v))) (S (@length bool (@hd (list bool) (@nil bool) v))) *)
induction (hd nil v); simpl; auto.
(* Goal: le (@length bool (if a then @cons bool false (sem_Rec (fun _ : list (list bool) => @cons bool true (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) l (@tl (list bool) v)) else @cons bool true l)) (S (S (@length bool l))) *)
case a; simpl; omega.
Qed.
Lemma rec_bounded_Succ :
rec_bounded Succ_e.
Lemma Succ_correct : forall l,
bs2nat (Sem Succ_e l) = 1 + bs2nat (hd nil l).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Succ_e l)) (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) l))) *)
destruct l as [ | v l]; trivial; simpl hd.
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) v l))) (Init.Nat.add (S O) (bs2nat v)) *)
induction v as [ | [ | ] v IH]; trivial.
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) (@cons bool true v) l))) (Init.Nat.add (S O) (bs2nat (@cons bool true v))) *)
simpl Sem in *.
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun _ : list (list bool) => @cons bool true (@nil bool)) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) v l))) (Init.Nat.add (S O) (bs2nat (@cons bool true v))) *)
rewrite bs2nat_false, bs2nat_true, IH; ring.
Qed.
Opaque Succ_e.
Definition Pred'_e : Cobham :=
Rec
Zero
(Comp 2 (Succ true) [Proj 2 1])
(Comp 2 (Succ false) [Proj 2 0])
(Proj 1 0).
Lemma arity_Pred' : arity Pred'_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity Pred'_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma rec_bounded_Pred' :
rec_bounded Pred'_e.
Proof.
(* Goal: rec_bounded Pred'_e *)
simpl.
(* Goal: and True (and True (and (and True (and True True)) (and (and True (and True True)) (forall l : list (list bool), le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))))))) *)
intuition.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))) *)
destruct l as [ | v l].
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (@nth (list bool) O (@nil (list bool)) (@nil bool))) *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *)
simpl.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) v l)) (@length bool v) *)
induction v as [ | [ | ] v IH].
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@cons bool true v) l)) (@length bool (@cons bool true v)) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@nil bool) l)) (@length bool (@nil bool)) *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@cons bool true v) l)) (@length bool (@cons bool true v)) *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (@cons bool false v) l)) (@length bool (@cons bool false v)) *)
simpl; omega.
Qed.
Lemma Pred'_correct : forall l,
hd nil l = nil \/ bs2nat (hd nil l) <> 0 ->
bs2nat (Sem Pred'_e l) = bs2nat (hd nil l) - 1.
Proof.
(* Goal: forall (l : list (list bool)) (_ : or (@eq (list bool) (@hd (list bool) (@nil bool) l) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) l)) O))), @eq nat (bs2nat (Sem Pred'_e l)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
intros l H.
(* Goal: @eq nat (bs2nat (Sem Pred'_e l)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
destruct l as [ | v l].
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) v l))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (S O)) *)
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@nil (list bool)))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool)))) (S O)) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) v l))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (S O)) *)
(* Goal: @eq nat (bs2nat (@nil bool)) (Init.Nat.sub (bs2nat (@nil bool)) (S O)) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) v l))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (S O)) *)
simpl hd.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) v l))) (Init.Nat.sub (bs2nat v) (S O)) *)
induction v as [ | [ | ] v IH].
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (S O)) *)
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@cons bool true v) l))) (Init.Nat.sub (bs2nat (@cons bool true v)) (S O)) *)
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@nil bool) l))) (Init.Nat.sub (bs2nat (@nil bool)) (S O)) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (S O)) *)
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@cons bool true v) l))) (Init.Nat.sub (bs2nat (@cons bool true v)) (S O)) *)
simpl Sem in *.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (S O)) *)
(* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.sub (bs2nat (@cons bool true v)) (S O)) *)
rewrite bs2nat_false, bs2nat_true.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (S O)) *)
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat v)) (Init.Nat.sub (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v))) (S O)) *)
omega.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (S O)) *)
simpl Sem in *.
(* Goal: @eq nat (bs2nat (@cons bool true (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @cons bool true (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) v l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (S O)) *)
rewrite bs2nat_false, bs2nat_true, IH.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) O)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (Init.Nat.sub (bs2nat v) (S O)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (S O)) *)
simpl in H.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) O)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (Init.Nat.sub (bs2nat v) (S O)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (S O)) *)
destruct H as [H | H].
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) O)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (Init.Nat.sub (bs2nat v) (S O)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (S O)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (Init.Nat.sub (bs2nat v) (S O)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (S O)) *)
congruence.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) O)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (Init.Nat.sub (bs2nat v) (S O)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (S O)) *)
rewrite bs2nat_false in H.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) O)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (Init.Nat.sub (bs2nat v) (S O)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (S O)) *)
omega.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) O)) *)
simpl in *.
(* Goal: or (@eq (list bool) v (@nil bool)) (not (@eq nat (bs2nat v) O)) *)
destruct H as [H | H].
(* Goal: or (@eq (list bool) v (@nil bool)) (not (@eq nat (bs2nat v) O)) *)
(* Goal: or (@eq (list bool) v (@nil bool)) (not (@eq nat (bs2nat v) O)) *)
congruence.
(* Goal: or (@eq (list bool) v (@nil bool)) (not (@eq nat (bs2nat v) O)) *)
rewrite bs2nat_false in H.
(* Goal: or (@eq (list bool) v (@nil bool)) (not (@eq nat (bs2nat v) O)) *)
simpl in H.
(* Goal: or (@eq (list bool) v (@nil bool)) (not (@eq nat (bs2nat v) O)) *)
right.
(* Goal: not (@eq nat (bs2nat v) O) *)
omega.
Qed.
Opaque Pred'_e.
Definition Pred_e : Cobham :=
Comp 1 Pred'_e [Normalize_e].
Lemma arity_Pred : arity Pred_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity Pred_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma rec_bounded_Pred :
rec_bounded Pred_e.
Proof.
(* Goal: rec_bounded Pred_e *)
simpl.
(* Goal: and (rec_bounded Pred'_e) (and (rec_bounded Normalize_e) True) *)
intuition.
(* Goal: rec_bounded Normalize_e *)
(* Goal: rec_bounded Pred'_e *)
apply rec_bounded_Pred'.
(* Goal: rec_bounded Normalize_e *)
apply rec_bounded_Normalize.
Qed.
Lemma Pred_correct : forall l,
bs2nat (Sem Pred_e l) = bs2nat (hd nil l) - 1.
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Pred_e l)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
intro l.
(* Goal: @eq nat (bs2nat (Sem Pred_e l)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Pred'_e (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
rewrite Pred'_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) (S O)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat (Init.Nat.sub (bs2nat (Sem Normalize_e l)) (S O)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
rewrite Normalize_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat (Init.Nat.sub (bs2nat (Sem (Proj (S O) O) l)) (S O)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat (Init.Nat.sub (bs2nat (@nth (list bool) O l (@nil bool))) (S O)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (S O)) *)
rewrite hd_nth_0.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat (Init.Nat.sub (bs2nat (@nth (list bool) O l (@nil bool))) (S O)) (Init.Nat.sub (bs2nat (@nth (list bool) O l (@nil bool))) (S O)) *)
trivial.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
apply Normalize_normal.
Qed.
Opaque Pred_e.
Definition OneMinus'_e : Cobham :=
Rec2
(One_e 0)
(Zero_e 2)
(One_e 1).
Lemma arity_OneMinus' : arity OneMinus'_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity OneMinus'_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma rec_bounded_OneMinus' :
rec_bounded OneMinus'_e.
Proof.
(* Goal: rec_bounded OneMinus'_e *)
simpl.
(* Goal: and (rec_bounded (One_e (S O))) (and (rec_bounded (One_e O)) (and (rec_bounded (Zero_e (S (S O)))) (and (rec_bounded (Zero_e (S (S O)))) (forall l : list (list bool), le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)))))) *)
intuition.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (One_e O) *)
(* Goal: rec_bounded (One_e (S O)) *)
apply rec_bounded_One.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (One_e O) *)
apply rec_bounded_One.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
apply rec_bounded_Zero.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
apply rec_bounded_Zero.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
destruct l as [ | v l].
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (Sem (One_e (S O)) (@cons (list bool) v l))) *)
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (Sem (One_e (S O)) (@nil (list bool)))) *)
trivial.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (Sem (One_e (S O)) (@cons (list bool) v l))) *)
simpl.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) v l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) v l))) *)
induction v as [ | [ | ] v IH].
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@cons bool false v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool false v) l))) *)
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@cons bool true v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool true v) l))) *)
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@nil bool) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@nil bool) l))) *)
trivial.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@cons bool false v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool false v) l))) *)
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@cons bool true v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool true v) l))) *)
auto with arith.
(* Goal: le (@length bool (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) (@cons bool false v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool false v) l))) *)
auto with arith.
Qed.
Lemma OneMinus'_correct : forall l,
hd nil l = nil \/ bs2nat (hd nil l) <> 0 ->
bs2nat (Sem OneMinus'_e l) = 1 - bs2nat (hd nil l).
Proof.
(* Goal: forall (l : list (list bool)) (_ : or (@eq (list bool) (@hd (list bool) (@nil bool) l) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) l)) O))), @eq nat (bs2nat (Sem OneMinus'_e l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l))) *)
intros [ | v l] H.
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) v l))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) *)
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@nil (list bool)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) v l))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) *)
simpl hd.
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) v l))) (Init.Nat.sub (S O) (bs2nat v)) *)
destruct v as [ | [ | ] v].
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (S O) (bs2nat (@cons bool false v))) *)
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) (@cons bool true v) l))) (Init.Nat.sub (S O) (bs2nat (@cons bool true v))) *)
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) (@nil bool) l))) (Init.Nat.sub (S O) (bs2nat (@nil bool))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (S O) (bs2nat (@cons bool false v))) *)
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) (@cons bool true v) l))) (Init.Nat.sub (S O) (bs2nat (@cons bool true v))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (S O) (bs2nat (@cons bool false v))) *)
simpl Sem in *.
(* Goal: @eq nat (bs2nat (Sem (Zero_e (S (S O))) (@cons (list bool) v (@cons (list bool) (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) v l) l)))) (Init.Nat.sub (S O) (bs2nat (@cons bool false v))) *)
simpl in *.
(* Goal: @eq nat (bs2nat (Sem (Zero_e (S (S O))) (@cons (list bool) v (@cons (list bool) (sem_Rec (Sem (One_e O)) (Sem (Zero_e (S (S O)))) (Sem (Zero_e (S (S O)))) v l) l)))) match bs2nat (@cons bool false v) with | O => S O | S l => O end *)
rewrite Zero_correct.
(* Goal: @eq nat O match bs2nat (@cons bool false v) with | O => S O | S l => O end *)
rewrite bs2nat_false in *.
(* Goal: @eq nat O match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end *)
destruct H as [H | H].
(* Goal: @eq nat O match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end *)
(* Goal: @eq nat O match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end *)
congruence.
(* Goal: @eq nat O match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end *)
destruct (2 * bs2nat v).
(* Goal: @eq nat O O *)
(* Goal: @eq nat O (S O) *)
tauto.
(* Goal: @eq nat O O *)
trivial.
Qed.
Opaque OneMinus'_e.
Definition OneMinus_e : Cobham :=
Comp 1 OneMinus'_e [Normalize_e].
Lemma arity_OneMinus : arity OneMinus_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity OneMinus_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma rec_bounded_OneMinus :
rec_bounded OneMinus_e.
Proof.
(* Goal: rec_bounded OneMinus_e *)
simpl.
(* Goal: and (rec_bounded OneMinus'_e) (and (rec_bounded Normalize_e) True) *)
intuition.
(* Goal: rec_bounded Normalize_e *)
(* Goal: rec_bounded OneMinus'_e *)
apply rec_bounded_OneMinus'.
(* Goal: rec_bounded Normalize_e *)
apply rec_bounded_Normalize.
Qed.
Lemma OneMinus_correct : forall l,
bs2nat (Sem OneMinus_e l) = 1 - bs2nat (hd nil l).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem OneMinus_e l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l))) *)
intro l.
(* Goal: @eq nat (bs2nat (Sem OneMinus_e l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem OneMinus'_e (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end *)
rewrite OneMinus'_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))))) match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat match bs2nat (Sem Normalize_e l) with | O => S O | S l => O end match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end *)
rewrite Normalize_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat match bs2nat (Sem (Proj (S O) O) l) with | O => S O | S l => O end match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end *)
rewrite hd_nth_0.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
(* Goal: @eq nat match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end *)
trivial.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e l) (@nil (list bool))))) O)) *)
apply Normalize_normal.
Qed.
Opaque OneMinus_e.
Definition Div2_e : Cobham :=
Rec2
Zero
(Proj 2 0)
(Proj 1 0).
Lemma arity_Div2 : arity Div2_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity Div2_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma length_Div2 : forall l,
length (Sem Div2_e l) = length (hd nil l) - 1.
Proof.
(* Goal: forall l : list (list bool), @eq nat (@length bool (Sem Div2_e l)) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (S O)) *)
destruct l as [ | v l].
(* Goal: @eq nat (@length bool (Sem Div2_e (@cons (list bool) v l))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (S O)) *)
(* Goal: @eq nat (@length bool (Sem Div2_e (@nil (list bool)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@nil (list bool)))) (S O)) *)
trivial.
(* Goal: @eq nat (@length bool (Sem Div2_e (@cons (list bool) v l))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (S O)) *)
simpl.
(* Goal: @eq nat (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) v l)) (Init.Nat.sub (@length bool v) (S O)) *)
induction v as [ | [ | ] v IH].
(* Goal: @eq nat (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool false v) l)) (Init.Nat.sub (@length bool (@cons bool false v)) (S O)) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool true v) l)) (Init.Nat.sub (@length bool (@cons bool true v)) (S O)) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@nil bool) l)) (Init.Nat.sub (@length bool (@nil bool)) (S O)) *)
trivial.
(* Goal: @eq nat (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool false v) l)) (Init.Nat.sub (@length bool (@cons bool false v)) (S O)) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool true v) l)) (Init.Nat.sub (@length bool (@cons bool true v)) (S O)) *)
simpl; omega.
(* Goal: @eq nat (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool false v) l)) (Init.Nat.sub (@length bool (@cons bool false v)) (S O)) *)
simpl; omega.
Qed.
Lemma rec_bounded_Div2 :
rec_bounded Div2_e.
Proof.
(* Goal: rec_bounded Div2_e *)
simpl.
(* Goal: and True (and True (and True (and True (forall l : list (list bool), le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))))))) *)
intuition.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) O l (@nil bool))) *)
destruct l as [ | v l].
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (@nth (list bool) O (@nil (list bool)) (@nil bool))) *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (@nth (list bool) O (@cons (list bool) v l) (@nil bool))) *)
simpl.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) v l)) (@length bool v) *)
destruct v as [ | [ | ] v].
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool false v) l)) (@length bool (@cons bool false v)) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool true v) l)) (@length bool (@cons bool true v)) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@nil bool) l)) (@length bool (@nil bool)) *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool false v) l)) (@length bool (@cons bool false v)) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool true v) l)) (@length bool (@cons bool true v)) *)
simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (@cons bool false v) l)) (@length bool (@cons bool false v)) *)
simpl; omega.
Qed.
Lemma Div2_correct_bs : forall l,
Sem Div2_e l =
tl (hd nil l).
Proof.
(* Goal: forall l : list (list bool), @eq (list bool) (Sem Div2_e l) (@tl bool (@hd (list bool) (@nil bool) l)) *)
destruct l as [ | v l].
(* Goal: @eq (list bool) (Sem Div2_e (@cons (list bool) v l)) (@tl bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) *)
(* Goal: @eq (list bool) (Sem Div2_e (@nil (list bool))) (@tl bool (@hd (list bool) (@nil bool) (@nil (list bool)))) *)
trivial.
(* Goal: @eq (list bool) (Sem Div2_e (@cons (list bool) v l)) (@tl bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) *)
simpl.
(* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) v l) (@tl bool v) *)
destruct v as [ | [ | ] v]; trivial.
Qed.
Lemma Div2_correct : forall l,
bs2nat (Sem Div2_e l) = div2 (bs2nat (hd nil l)).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Div2_e l)) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) l))) *)
intros [ | v l].
(* Goal: @eq nat (bs2nat (Sem Div2_e (@cons (list bool) v l))) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) *)
(* Goal: @eq nat (bs2nat (Sem Div2_e (@nil (list bool)))) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Div2_e (@cons (list bool) v l))) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) *)
rewrite Div2_correct_bs.
(* Goal: @eq nat (bs2nat (@tl bool (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) *)
simpl.
(* Goal: @eq nat (bs2nat (@tl bool v)) (Nat.div2 (bs2nat v)) *)
apply bs2nat_tl.
Qed.
Opaque Div2_e.
Definition Mod2_e : Cobham :=
Rec
Zero
(False_e 2)
(One_e 2)
(One_e 1).
Lemma arity_Mod2 : arity Mod2_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity Mod2_e) (ok_arity (S O)) *)
simpl.
(* Goal: @eq Arity match arity (False_e (S (S O))) with | error_Rec a a0 a1 a2 => error_Rec (ok_arity O) (error_Rec a a0 a1 a2) (arity (One_e (S (S O)))) (arity (One_e (S O))) | error_Comp a l => error_Rec (ok_arity O) (error_Comp a l) (arity (One_e (S (S O)))) (arity (One_e (S O))) | error_Proj n n0 => error_Rec (ok_arity O) (error_Proj n n0) (arity (One_e (S (S O)))) (arity (One_e (S O))) | ok_arity h0n => match arity (One_e (S (S O))) with | error_Rec a a0 a1 a2 => error_Rec (ok_arity O) (ok_arity h0n) (error_Rec a a0 a1 a2) (arity (One_e (S O))) | error_Comp a l => error_Rec (ok_arity O) (ok_arity h0n) (error_Comp a l) (arity (One_e (S O))) | error_Proj n n0 => error_Rec (ok_arity O) (ok_arity h0n) (error_Proj n n0) (arity (One_e (S O))) | ok_arity h1n => match arity (One_e (S O)) with | error_Rec a a0 a1 a2 => error_Rec (ok_arity O) (ok_arity h0n) (ok_arity h1n) (error_Rec a a0 a1 a2) | error_Comp a l => error_Rec (ok_arity O) (ok_arity h0n) (ok_arity h1n) (error_Comp a l) | error_Proj n n0 => error_Rec (ok_arity O) (ok_arity h0n) (ok_arity h1n) (error_Proj n n0) | ok_arity jn => if andb (andb match h0n with | O => false | S (O as m') => false | S (S (O as m'0) as m') => true | S (S (S n as m'0) as m') => false end (Nat.eqb h1n h0n)) match h1n with | O => false | S m' => Nat.eqb jn m' end then ok_arity jn else error_Rec (ok_arity O) (ok_arity h0n) (ok_arity h1n) (ok_arity jn) end end end (ok_arity (S O)) *)
trivial.
Qed.
Lemma rec_bounded_Mod2 :
rec_bounded Mod2_e.
Proof.
(* Goal: rec_bounded Mod2_e *)
simpl.
(* Goal: and (rec_bounded (One_e (S O))) (and True (and (rec_bounded (False_e (S (S O)))) (and (rec_bounded (One_e (S (S O)))) (forall l : list (list bool), le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)))))) *)
intuition.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
(* Goal: rec_bounded (One_e (S (S O))) *)
(* Goal: rec_bounded (False_e (S (S O))) *)
(* Goal: rec_bounded (One_e (S O)) *)
apply rec_bounded_One.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
(* Goal: rec_bounded (One_e (S (S O))) *)
(* Goal: rec_bounded (False_e (S (S O))) *)
apply rec_bounded_False.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
(* Goal: rec_bounded (One_e (S (S O))) *)
apply rec_bounded_One.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (Sem (One_e (S O)) l)) *)
destruct l as [ | v l].
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (Sem (One_e (S O)) (@cons (list bool) v l))) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (Sem (One_e (S O)) (@nil (list bool)))) *)
simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (Sem (One_e (S O)) (@cons (list bool) v l))) *)
simpl.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) v l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) v l))) *)
induction v as [ | [ | ] v IH].
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@cons bool false v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool false v) l))) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@cons bool true v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool true v) l))) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@nil bool) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@nil bool) l))) *)
simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@cons bool false v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool false v) l))) *)
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@cons bool true v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool true v) l))) *)
auto with arith.
(* Goal: le (@length bool (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@cons bool false v) l)) (@length bool (Sem (One_e (S O)) (@cons (list bool) (@cons bool false v) l))) *)
auto with arith.
Qed.
Lemma Mod2_correct_bs : forall l,
(hd nil l) <> nil ->
Sem Mod2_e l = [hd true (hd nil l)].
Proof.
(* Goal: forall (l : list (list bool)) (_ : not (@eq (list bool) (@hd (list bool) (@nil bool) l) (@nil bool))), @eq (list bool) (Sem Mod2_e l) (@cons bool (@hd bool true (@hd (list bool) (@nil bool) l)) (@nil bool)) *)
intros.
(* Goal: @eq (list bool) (Sem Mod2_e l) (@cons bool (@hd bool true (@hd (list bool) (@nil bool) l)) (@nil bool)) *)
simpl.
(* Goal: @eq (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l)) (@cons bool (@hd bool true (@hd (list bool) (@nil bool) l)) (@nil bool)) *)
destruct (hd nil l); simpl; trivial.
(* Goal: @eq (list bool) (if b then Sem (One_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l))) else Sem (False_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l)))) (@cons bool b (@nil bool)) *)
(* Goal: @eq (list bool) (@nil bool) (@cons bool true (@nil bool)) *)
elim H; trivial.
(* Goal: @eq (list bool) (if b then Sem (One_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l))) else Sem (False_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l)))) (@cons bool b (@nil bool)) *)
case b.
(* Goal: @eq (list bool) (Sem (False_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l)))) (@cons bool false (@nil bool)) *)
(* Goal: @eq (list bool) (Sem (One_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l)))) (@cons bool true (@nil bool)) *)
rewrite One_correct_bs.
(* Goal: @eq (list bool) (Sem (False_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l)))) (@cons bool false (@nil bool)) *)
(* Goal: @eq (list bool) (@cons bool true (@nil bool)) (@cons bool true (@nil bool)) *)
trivial.
(* Goal: @eq (list bool) (Sem (False_e (S (S O))) (@cons (list bool) l0 (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) l0 (@tl (list bool) l)) (@tl (list bool) l)))) (@cons bool false (@nil bool)) *)
rewrite False_correct_bs.
(* Goal: @eq (list bool) (@cons bool false (@nil bool)) (@cons bool false (@nil bool)) *)
trivial.
Qed.
Lemma Mod2_correct : forall l,
bs2nat (Sem Mod2_e l) = mod2 (bs2nat (hd nil l)).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Mod2_e l)) (mod2 (bs2nat (@hd (list bool) (@nil bool) l))) *)
unfold mod2.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Mod2_e l)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) l))))) *)
destruct l as [ | v l].
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) v l))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@nil (list bool)))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool)))) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool))))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) v l))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))))) *)
simpl hd.
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) v l))) (Init.Nat.sub (bs2nat v) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat v)))) *)
destruct v as [ | [ | ] v].
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool true v) l))) (Init.Nat.sub (bs2nat (@cons bool true v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool true v))))) *)
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@nil bool) l))) (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@nil bool))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool true v) l))) (Init.Nat.sub (bs2nat (@cons bool true v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool true v))))) *)
simpl Sem in *.
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
(* Goal: @eq nat (bs2nat (Sem (One_e (S (S O))) (@cons (list bool) v (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) v l) l)))) (Init.Nat.sub (bs2nat (@cons bool true v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool true v))))) *)
rewrite One_correct, bs2nat_true.
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
(* Goal: @eq nat (S O) (Init.Nat.sub (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v))) (Init.Nat.mul (S (S O)) (Nat.div2 (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v)))))) *)
change (1 + 2 * bs2nat v) with (S (2 * bs2nat v)).
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
(* Goal: @eq nat (S O) (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat v))) (Init.Nat.mul (S (S O)) (Nat.div2 (S (Init.Nat.mul (S (S O)) (bs2nat v)))))) *)
rewrite div2_double_plus_one.
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
(* Goal: @eq nat (S O) (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat v))) (Init.Nat.mul (S (S O)) (bs2nat v))) *)
omega.
(* Goal: @eq nat (bs2nat (Sem Mod2_e (@cons (list bool) (@cons bool false v) l))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
simpl Sem in *.
(* Goal: @eq nat (bs2nat (Sem (False_e (S (S O))) (@cons (list bool) v (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) v l) l)))) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@cons bool false v))))) *)
rewrite bs2nat_false.
(* Goal: @eq nat (bs2nat (Sem (False_e (S (S O))) (@cons (list bool) v (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) v l) l)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (Init.Nat.mul (S (S O)) (Nat.div2 (Init.Nat.mul (S (S O)) (bs2nat v))))) *)
rewrite div2_double.
(* Goal: @eq nat (bs2nat (Sem (False_e (S (S O))) (@cons (list bool) v (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (Sem (False_e (S (S O)))) (Sem (One_e (S (S O)))) v l) l)))) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (Init.Nat.mul (S (S O)) (bs2nat v))) *)
auto with arith.
Qed.
Opaque Mod2_e.
Definition Length_e : Cobham :=
Rec2
Zero
(Comp 2 Succ_e [Proj 2 1])
(Proj 1 0).
Lemma arity_Length : arity Length_e = ok_arity 1.
Proof.
(* Goal: @eq Arity (arity Length_e) (ok_arity (S O)) *)
trivial.
Qed.
Lemma rec_bounded_Length :
rec_bounded Length_e.
Lemma Length_correct : forall l,
bs2nat (Sem Length_e l) = length (hd nil l).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem Length_e l)) (@length bool (@hd (list bool) (@nil bool) l)) *)
destruct l as [ | v l].
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) v l))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) *)
(* Goal: @eq nat (bs2nat (Sem Length_e (@nil (list bool)))) (@length bool (@hd (list bool) (@nil bool) (@nil (list bool)))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) v l))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) v l))) *)
simpl hd.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) v l))) (@length bool v) *)
induction v as [ | [ | ] v IH].
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool false v) l))) (@length bool (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool true v) l))) (@length bool (@cons bool true v)) *)
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@nil bool) l))) (@length bool (@nil bool)) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool false v) l))) (@length bool (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool true v) l))) (@length bool (@cons bool true v)) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool false v) l))) (@length bool (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l) (@nil (list bool))))) (S (@length bool v)) *)
rewrite Succ_correct.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool false v) l))) (@length bool (@cons bool false v)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l) (@nil (list bool)))))) (S (@length bool v)) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool false v) l))) (@length bool (@cons bool false v)) *)
(* Goal: @eq nat (S (bs2nat (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l))) (S (@length bool v)) *)
f_equal.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool false v) l))) (@length bool (@cons bool false v)) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l)) (@length bool v) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Length_e (@cons (list bool) (@cons bool false v) l))) (@length bool (@cons bool false v)) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l) (@nil (list bool))))) (S (@length bool v)) *)
rewrite Succ_correct.
(* Goal: @eq nat (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l) (@nil (list bool)))))) (S (@length bool v)) *)
simpl.
(* Goal: @eq nat (S (bs2nat (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l))) (S (@length bool v)) *)
f_equal.
(* Goal: @eq nat (bs2nat (sem_Rec (fun _ : list (list bool) => @nil bool) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) v l)) (@length bool v) *)
trivial.
Qed.
Opaque Length_e.
Definition MultOneMinus'_e : Cobham :=
Comp 2 Cond [
Proj 2 1;
Proj 2 0;
Zero_e 2;
Zero_e 2
].
Lemma arity_MultOneMinus' : arity MultOneMinus'_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity MultOneMinus'_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_MultOneMinus' :
rec_bounded MultOneMinus'_e.
Proof.
(* Goal: rec_bounded MultOneMinus'_e *)
simpl.
(* Goal: and (rec_bounded Cond) (and True (and True (and (rec_bounded (Zero_e (S (S O)))) (and (rec_bounded (Zero_e (S (S O)))) True)))) *)
intuition.
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded Cond *)
apply rec_bounded'_spec with 4.
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded' Cond *)
(* Goal: @eq Arity (arity Cond) (ok_arity (S (S (S (S O))))) *)
apply arity_Cond.
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded' Cond *)
apply rec_bounded_Cond.
(* Goal: rec_bounded (Zero_e (S (S O))) *)
(* Goal: rec_bounded (Zero_e (S (S O))) *)
apply rec_bounded_Zero.
(* Goal: rec_bounded (Zero_e (S (S O))) *)
apply rec_bounded_Zero.
Qed.
Lemma MultOneMinus'_correct : forall l,
hd nil (tl l) = nil \/ bs2nat (hd nil (tl l)) <> 0 ->
bs2nat (Sem MultOneMinus'_e l) = bs2nat (hd nil l) * (1 - bs2nat (hd nil (tl l))).
Proof.
(* Goal: forall (l : list (list bool)) (_ : or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))) O))), @eq nat (bs2nat (Sem MultOneMinus'_e l)) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
intros [ | u [ | v l] ] H.
(* Goal: @eq nat (bs2nat (Sem MultOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat (Sem MultOneMinus'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool))))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))))) *)
(* Goal: @eq nat (bs2nat (Sem MultOneMinus'_e (@nil (list bool)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@nil (list bool))))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem MultOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat (Sem MultOneMinus'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool))))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))))) *)
auto with arith.
(* Goal: @eq nat (bs2nat (Sem MultOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@nil (list bool)))))))) (Init.Nat.mul (bs2nat u) match bs2nat v with | O => S O | S l => O end) *)
rewrite Cond_correct.
(* Goal: @eq nat (bs2nat match @hd (list bool) (@nil bool) (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@nil (list bool)))))) with | nil => @hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@nil (list bool))))))) | cons (true as b) l0 => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@nil (list bool)))))))) | cons (false as b) l0 => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@cons (list bool) (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l))) (@nil (list bool))))))))) end) (Init.Nat.mul (bs2nat u) match bs2nat v with | O => S O | S l => O end) *)
simpl in *.
(* Goal: @eq nat (bs2nat match v with | nil => u | cons (true as b) l0 => Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l)) | cons (false as b) l0 => Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) v l)) end) (Init.Nat.mul (bs2nat u) match bs2nat v with | O => S O | S l => O end) *)
destruct v as [ | [ | ] v].
(* Goal: @eq nat (bs2nat (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) (@cons bool false v) l)))) (Init.Nat.mul (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (bs2nat (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) (@cons bool true v) l)))) (Init.Nat.mul (bs2nat u) match bs2nat (@cons bool true v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.mul (bs2nat u) match bs2nat (@nil bool) with | O => S O | S l => O end) *)
auto with arith.
(* Goal: @eq nat (bs2nat (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) (@cons bool false v) l)))) (Init.Nat.mul (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (bs2nat (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) (@cons bool true v) l)))) (Init.Nat.mul (bs2nat u) match bs2nat (@cons bool true v) with | O => S O | S l => O end) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem (Zero_e (S (S O))) (@cons (list bool) u (@cons (list bool) (@cons bool false v) l)))) (Init.Nat.mul (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
rewrite Zero_correct.
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
rewrite bs2nat_false in *.
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end) *)
destruct (2 * bs2nat v).
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) O) *)
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) (S O)) *)
destruct H.
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) O) *)
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) (S O)) *)
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) (S O)) *)
congruence.
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) O) *)
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) (S O)) *)
tauto.
(* Goal: @eq nat O (Init.Nat.mul (bs2nat u) O) *)
trivial.
Qed.
Opaque MultOneMinus'_e.
Definition MultOneMinus_e : Cobham :=
Comp 2 MultOneMinus'_e [Proj 2 0; Comp 2 Normalize_e [Proj 2 1]].
Lemma arity_MultOneMinus : arity MultOneMinus_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity MultOneMinus_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_MultOneMinus :
rec_bounded MultOneMinus_e.
Proof.
(* Goal: rec_bounded MultOneMinus_e *)
simpl.
(* Goal: and (rec_bounded MultOneMinus'_e) (and True (and (and (rec_bounded Normalize_e) (and True True)) True)) *)
intuition.
(* Goal: rec_bounded Normalize_e *)
(* Goal: rec_bounded MultOneMinus'_e *)
apply rec_bounded_MultOneMinus'.
(* Goal: rec_bounded Normalize_e *)
apply rec_bounded_Normalize.
Qed.
Lemma MultOneMinus_correct : forall l,
bs2nat (Sem MultOneMinus_e l) = bs2nat (hd nil l) * (1 - bs2nat (hd nil (tl l))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem MultOneMinus_e l)) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
intro l.
(* Goal: @eq nat (bs2nat (Sem MultOneMinus_e l)) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem MultOneMinus'_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
rewrite MultOneMinus'_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
rewrite Normalize_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (Sem (Proj (S O) O) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (@nth (list bool) (S O) l (@nil bool)) with | O => S O | S l => O end) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
rewrite hd_nth_1, hd_nth_0.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (@nth (list bool) (S O) l (@nil bool)) with | O => S O | S l => O end) (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (@nth (list bool) (S O) l (@nil bool)) with | O => S O | S l => O end) *)
trivial.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
simpl.
(* Goal: or (@eq (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) O)) *)
apply Normalize_normal.
Qed.
Opaque MultOneMinus_e.
Definition PlusOneMinus'_e : Cobham :=
Comp 2 Cond [
Proj 2 1;
Comp 2 Succ_e [Proj 2 0];
Proj 2 0;
Proj 2 0
].
Lemma arity_PlusOneMinus' : arity PlusOneMinus'_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity PlusOneMinus'_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_PlusOneMinus' :
rec_bounded PlusOneMinus'_e.
Proof.
(* Goal: rec_bounded PlusOneMinus'_e *)
simpl.
(* Goal: and (rec_bounded Cond) (and True (and (and (rec_bounded Succ_e) (and True True)) (and True (and True True)))) *)
intuition.
(* Goal: rec_bounded Succ_e *)
(* Goal: rec_bounded Cond *)
apply rec_bounded'_spec with 4.
(* Goal: rec_bounded Succ_e *)
(* Goal: rec_bounded' Cond *)
(* Goal: @eq Arity (arity Cond) (ok_arity (S (S (S (S O))))) *)
apply arity_Cond.
(* Goal: rec_bounded Succ_e *)
(* Goal: rec_bounded' Cond *)
apply rec_bounded_Cond.
(* Goal: rec_bounded Succ_e *)
apply rec_bounded_Succ.
Qed.
Lemma PlusOneMinus'_correct : forall l,
hd nil (tl l) = nil \/ bs2nat (hd nil (tl l)) <> 0 ->
bs2nat (Sem PlusOneMinus'_e l) = bs2nat (hd nil l) + (1 - bs2nat (hd nil (tl l))).
Proof.
(* Goal: forall (l : list (list bool)) (_ : or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) l)) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))) O))), @eq nat (bs2nat (Sem PlusOneMinus'_e l)) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
intros [ | u [ | v l] ] H.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool))))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))))) *)
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@nil (list bool)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@nil (list bool))))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool))))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) match bs2nat (@nil bool) with | O => S O | S l => O end) *)
rewrite Cond_correct.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat match @hd (list bool) (@nil bool) (@cons (list bool) (@nil bool) (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool)))))) with | nil => @hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool))))))) | cons (true as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool)))))))) | cons (false as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool))))))))) end) (Init.Nat.add (bs2nat u) match bs2nat (@nil bool) with | O => S O | S l => O end) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.add (bs2nat u) match bs2nat (@nil bool) with | O => S O | S l => O end) *)
rewrite Succ_correct, bs2nat_nil.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (S O)) *)
simpl; ring.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) v (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) match bs2nat v with | O => S O | S l => O end) *)
rewrite Cond_correct.
(* Goal: @eq nat (bs2nat match @hd (list bool) (@nil bool) (@cons (list bool) v (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool)))))) with | nil => @hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) v (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool))))))) | cons (true as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) v (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool)))))))) | cons (false as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) v (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@cons (list bool) u (@nil (list bool))))))))) end) (Init.Nat.add (bs2nat u) match bs2nat v with | O => S O | S l => O end) *)
simpl.
(* Goal: @eq nat (bs2nat match v with | nil => Sem Succ_e (@cons (list bool) u (@nil (list bool))) | cons (true as b) l => u | cons (false as b) l => u end) (Init.Nat.add (bs2nat u) match bs2nat v with | O => S O | S l => O end) *)
destruct v as [ | [ | ] v].
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool true v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.add (bs2nat u) match bs2nat (@nil bool) with | O => S O | S l => O end) *)
rewrite Succ_correct, bs2nat_nil.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool true v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (S O)) *)
simpl; ring.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool true v) with | O => S O | S l => O end) *)
trivial.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
simpl in H.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match bs2nat (@cons bool false v) with | O => S O | S l => O end) *)
rewrite bs2nat_false in *.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end) *)
destruct (2 * bs2nat v).
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) O) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (S O)) *)
destruct H.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) O) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (S O)) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (S O)) *)
congruence.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) O) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (S O)) *)
tauto.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) O) *)
trivial.
Qed.
Lemma PlusOneMinus'_length : forall l,
length (Sem PlusOneMinus'_e [nth 0 l nil; Sem Normalize_e [nth 1 l nil]])
<= S (length (hd nil l)).
Proof.
(* Goal: forall l : list (list bool), le (@length bool (Sem PlusOneMinus'_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (S (@length bool (@hd (list bool) (@nil bool) l))) *)
intros; simpl.
(* Goal: le (@length bool (Sem Cond (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))))))) (S (@length bool (@hd (list bool) (@nil bool) l))) *)
rewrite Cond_correct; simpl.
(* Goal: le (@length bool match Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))) with | nil => Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))) | cons (true as b) l0 => @nth (list bool) O l (@nil bool) | cons (false as b) l0 => @nth (list bool) O l (@nil bool) end) (S (@length bool (@hd (list bool) (@nil bool) l))) *)
rewrite hd_nth_0.
(* Goal: le (@length bool match Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))) with | nil => Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))) | cons (true as b) l0 => @nth (list bool) O l (@nil bool) | cons (false as b) l0 => @nth (list bool) O l (@nil bool) end) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
destruct (Sem Normalize_e [nth 1 l nil]); auto.
(* Goal: le (@length bool (if b then @nth (list bool) O l (@nil bool) else @nth (list bool) O l (@nil bool))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
(* Goal: le (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
apply Succ_length.
(* Goal: le (@length bool (if b then @nth (list bool) O l (@nil bool) else @nth (list bool) O l (@nil bool))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
case b; auto.
Qed.
Opaque PlusOneMinus'_e.
Definition PlusOneMinus_e : Cobham :=
Comp 2 PlusOneMinus'_e [Proj 2 0; Comp 2 Normalize_e [Proj 2 1] ].
Lemma arity_PlusOneMinus : arity PlusOneMinus_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity PlusOneMinus_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_PlusOneMinus :
rec_bounded PlusOneMinus_e.
Proof.
(* Goal: rec_bounded PlusOneMinus_e *)
simpl.
(* Goal: and (rec_bounded PlusOneMinus'_e) (and True (and (and (rec_bounded Normalize_e) (and True True)) True)) *)
intuition.
(* Goal: rec_bounded Normalize_e *)
(* Goal: rec_bounded PlusOneMinus'_e *)
apply rec_bounded_PlusOneMinus'.
(* Goal: rec_bounded Normalize_e *)
apply rec_bounded_Normalize.
Qed.
Lemma PlusOneMinus_correct : forall l,
bs2nat (Sem PlusOneMinus_e l) = bs2nat (hd nil l) + (1 - bs2nat (hd nil (tl l))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem PlusOneMinus_e l)) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
intro l.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus_e l)) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus'_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
rewrite PlusOneMinus'_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))))) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
rewrite Normalize_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (Sem (Proj (S O) O) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (@nth (list bool) (S O) l (@nil bool)) with | O => S O | S l => O end) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) match bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)) with | O => S O | S l => O end) *)
rewrite hd_nth_1, hd_nth_0.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (@nth (list bool) (S O) l (@nil bool)) with | O => S O | S l => O end) (Init.Nat.add (bs2nat (@nth (list bool) O l (@nil bool))) match bs2nat (@nth (list bool) (S O) l (@nil bool)) with | O => S O | S l => O end) *)
trivial.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool))))))) O)) *)
simpl.
(* Goal: or (@eq (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil bool)) (not (@eq nat (bs2nat (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) O)) *)
apply Normalize_normal.
Qed.
Lemma PlusOneMinus_length : forall l,
length (Sem PlusOneMinus_e [nth 0 l nil; nth 1 l nil]) <= S (length (nth 0 l nil)).
Proof.
(* Goal: forall l : list (list bool), le (@length bool (Sem PlusOneMinus_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
intros; simpl.
(* Goal: le (@length bool (Sem PlusOneMinus'_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
rewrite <- hd_nth_0 at 2.
(* Goal: le (@length bool (Sem PlusOneMinus'_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@nil (list bool)))))) (S (@length bool (@hd (list bool) (@nil bool) l))) *)
apply PlusOneMinus'_length.
Qed.
Opaque PlusOneMinus_e.
Definition OneMinusMultPlus'_e : Cobham :=
Rec
(Proj 1 0)
(Comp 3 (Succ false) [Proj 3 0])
(Comp 3 (Succ true) [Proj 3 0])
(Comp 2 Smash [Comp 2 Succ_e [Proj 2 1]; Comp 2 (Succ true) [Proj 2 0]]).
Lemma arity_OneMinusMultPlus' : arity OneMinusMultPlus'_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity OneMinusMultPlus'_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_OneMinusMultPlus' :
rec_bounded OneMinusMultPlus'_e.
Proof.
(* Goal: rec_bounded OneMinusMultPlus'_e *)
simpl.
(* Goal: and (and True (and (and (rec_bounded Succ_e) (and True True)) (and (and True (and True True)) True))) (and True (and (and True (and True True)) (and (and True (and True True)) (forall l : list (list bool), le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@cons bool true (@nth (list bool) O l (@nil bool))))))))) *)
intuition.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@cons bool true (@nth (list bool) O l (@nil bool))))) *)
(* Goal: rec_bounded Succ_e *)
apply rec_bounded_Succ.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) (@cons bool true (@nth (list bool) O l (@nil bool))))) *)
destruct l as [ | v l].
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) (@cons (list bool) v l) (@nil bool)) (@nil (list bool)))) (@cons bool true (@nth (list bool) O (@cons (list bool) v l) (@nil bool))))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) (@nil (list bool)) (@nil bool)) (@nil (list bool)))) (@cons bool true (@nth (list bool) O (@nil (list bool)) (@nil bool))))) *)
simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) (@hd (list bool) (@nil bool) (@cons (list bool) v l)) (@tl (list bool) (@cons (list bool) v l)))) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) (S O) (@cons (list bool) v l) (@nil bool)) (@nil (list bool)))) (@cons bool true (@nth (list bool) O (@cons (list bool) v l) (@nil bool))))) *)
simpl.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) v l)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true v))) *)
induction v as [ | [ | ] v IH]; simpl.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool true v)))) *)
(* Goal: le (@length bool (@nth (list bool) O l (@nil bool))) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@nil bool)))) *)
rewrite length_smash.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool true v)))) *)
(* Goal: le (@length bool (@nth (list bool) O l (@nil bool))) (Init.Nat.add (S O) (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (@length bool (@cons bool true (@nil bool))))) *)
simpl.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool true v)))) *)
(* Goal: le (@length bool (@nth (list bool) O l (@nil bool))) (S (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S O))) *)
rewrite mult_1_r.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool true v)))) *)
(* Goal: le (@length bool (@nth (list bool) O l (@nil bool))) (S (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))))) *)
eapply le_trans; [idtac | apply le_n_S; apply le_length_Succ].
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool true v)))) *)
(* Goal: le (@length bool (@nth (list bool) O l (@nil bool))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
omega.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool true v)))) *)
rewrite length_smash.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (Init.Nat.add (S O) (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (@length bool (@cons bool true (@cons bool true v))))) *)
simpl.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (S (@length bool v)) (S (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S (S (@length bool v))))) *)
apply le_n_S.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (@length bool v) (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S (S (@length bool v)))) *)
rewrite <- (mult_1_l (length v)).
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (Nat.mul (S O) (@length bool v)) (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S (S (Nat.mul (S O) (@length bool v))))) *)
apply mult_le_compat.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (@length bool v) (S (S (Nat.mul (S O) (@length bool v)))) *)
(* Goal: le (S O) (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) *)
apply le_1_length_Succ.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
(* Goal: le (@length bool v) (S (S (Nat.mul (S O) (@length bool v)))) *)
omega.
(* Goal: le (S (@length bool v)) (@length bool (smash_bs (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons bool true (@cons bool false v)))) *)
rewrite length_smash.
(* Goal: le (S (@length bool v)) (Init.Nat.add (S O) (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (@length bool (@cons bool true (@cons bool false v))))) *)
simpl.
(* Goal: le (S (@length bool v)) (S (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S (S (@length bool v))))) *)
apply le_n_S.
(* Goal: le (@length bool v) (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S (S (@length bool v)))) *)
rewrite <- (mult_1_l (length v)).
(* Goal: le (Nat.mul (S O) (@length bool v)) (Init.Nat.mul (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (S (S (Nat.mul (S O) (@length bool v))))) *)
apply mult_le_compat.
(* Goal: le (@length bool v) (S (S (Nat.mul (S O) (@length bool v)))) *)
(* Goal: le (S O) (@length bool (Sem Succ_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) *)
apply le_1_length_Succ.
(* Goal: le (@length bool v) (S (S (Nat.mul (S O) (@length bool v)))) *)
omega.
Qed.
Lemma OneMinusMultPlus'_correct : forall l,
hd nil l = nil \/ bs2nat (hd nil l) <> 0 ->
bs2nat (Sem OneMinusMultPlus'_e l) =
(1 - bs2nat (hd nil l)) * bs2nat (hd nil (tl l)) +
bs2nat (hd nil l) * (1 - (1 - bs2nat (hd nil l))).
Proof.
(* Goal: forall (l : list (list bool)) (_ : or (@eq (list bool) (@hd (list bool) (@nil bool) l) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) l)) O))), @eq nat (bs2nat (Sem OneMinusMultPlus'_e l)) (Init.Nat.add (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l)))))) *)
intros [ | v l] H.
(* Goal: @eq nat (bs2nat (Sem OneMinusMultPlus'_e (@cons (list bool) v l))) (Init.Nat.add (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) v l))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (Init.Nat.sub (S O) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))))))) *)
(* Goal: @eq nat (bs2nat (Sem OneMinusMultPlus'_e (@nil (list bool)))) (Init.Nat.add (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@nil (list bool)))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool)))) (Init.Nat.sub (S O) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@nil (list bool)))))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem OneMinusMultPlus'_e (@cons (list bool) v l))) (Init.Nat.add (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l)))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) v l))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))) (Init.Nat.sub (S O) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) v l))))))) *)
simpl.
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) O vl (@nil bool))) (fun vl : list (list bool) => @cons bool true (@nth (list bool) O vl (@nil bool))) v l)) (Init.Nat.add (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat v) match match bs2nat v with | O => S O | S l => O end with | O => S O | S l => O end)) *)
destruct v as [ | [ | ] v]; simpl.
(* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool false v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool false v)) match match bs2nat (@cons bool false v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
(* Goal: @eq nat (bs2nat (@cons bool true v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool true v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool true v)) match match bs2nat (@cons bool true v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
(* Goal: @eq nat (bs2nat (@nth (list bool) O l (@nil bool))) (Init.Nat.add (Init.Nat.mul match bs2nat (@nil bool) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@nil bool)) match match bs2nat (@nil bool) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
rewrite bs2nat_nil, hd_nth_0.
(* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool false v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool false v)) match match bs2nat (@cons bool false v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
(* Goal: @eq nat (bs2nat (@cons bool true v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool true v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool true v)) match match bs2nat (@cons bool true v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
(* Goal: @eq nat (bs2nat (@nth (list bool) O l (@nil bool))) (Init.Nat.add (Init.Nat.mul (S O) (bs2nat (@nth (list bool) O l (@nil bool)))) (Init.Nat.mul O O)) *)
ring.
(* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool false v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool false v)) match match bs2nat (@cons bool false v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
(* Goal: @eq nat (bs2nat (@cons bool true v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool true v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool true v)) match match bs2nat (@cons bool true v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
rewrite bs2nat_true.
(* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool false v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool false v)) match match bs2nat (@cons bool false v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v))) (Init.Nat.add (Init.Nat.mul match Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v)) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v))) match match Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v)) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
simpl; ring.
(* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool false v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool false v)) match match bs2nat (@cons bool false v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
simpl in *.
(* Goal: @eq nat (bs2nat (@cons bool false v)) (Init.Nat.add (Init.Nat.mul match bs2nat (@cons bool false v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (bs2nat (@cons bool false v)) match match bs2nat (@cons bool false v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
rewrite bs2nat_false in *.
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat v)) (Init.Nat.add (Init.Nat.mul match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (Init.Nat.mul (S (S O)) (bs2nat v)) match match Init.Nat.mul (S (S O)) (bs2nat v) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
destruct (2 * bs2nat v).
(* Goal: @eq nat (S n) (Init.Nat.add (Init.Nat.mul O (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (S n) (S O))) *)
(* Goal: @eq nat O (Init.Nat.add (Init.Nat.mul (S O) (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul O O)) *)
destruct H.
(* Goal: @eq nat (S n) (Init.Nat.add (Init.Nat.mul O (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (S n) (S O))) *)
(* Goal: @eq nat O (Init.Nat.add (Init.Nat.mul (S O) (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul O O)) *)
(* Goal: @eq nat O (Init.Nat.add (Init.Nat.mul (S O) (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul O O)) *)
congruence.
(* Goal: @eq nat (S n) (Init.Nat.add (Init.Nat.mul O (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (S n) (S O))) *)
(* Goal: @eq nat O (Init.Nat.add (Init.Nat.mul (S O) (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul O O)) *)
tauto.
(* Goal: @eq nat (S n) (Init.Nat.add (Init.Nat.mul O (bs2nat (@hd (list bool) (@nil bool) l))) (Init.Nat.mul (S n) (S O))) *)
ring.
Qed.
Opaque OneMinusMultPlus'_e.
Definition OneMinusMultPlus_e : Cobham :=
Comp 2 OneMinusMultPlus'_e [Comp 2 Normalize_e [Proj 2 0]; Proj 2 1].
Lemma arity_OneMinusMultPlus : arity OneMinusMultPlus_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity OneMinusMultPlus_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_OneMinusMultPlus :
rec_bounded OneMinusMultPlus_e.
Proof.
(* Goal: rec_bounded OneMinusMultPlus_e *)
simpl.
(* Goal: and (rec_bounded OneMinusMultPlus'_e) (and (and (rec_bounded Normalize_e) (and True True)) (and True True)) *)
intuition.
(* Goal: rec_bounded Normalize_e *)
(* Goal: rec_bounded OneMinusMultPlus'_e *)
apply rec_bounded_OneMinusMultPlus'.
(* Goal: rec_bounded Normalize_e *)
apply rec_bounded_Normalize.
Qed.
Lemma OneMinusMultPlus_correct : forall l,
bs2nat (Sem OneMinusMultPlus_e l) =
(1 - bs2nat (hd nil l)) * bs2nat (hd nil (tl l)) +
bs2nat (hd nil l) * (1 - (1 - bs2nat (hd nil l))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem OneMinusMultPlus_e l)) (Init.Nat.add (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l)))))) *)
intro l.
(* Goal: @eq nat (bs2nat (Sem OneMinusMultPlus_e l)) (Init.Nat.add (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (S O) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) l)))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem OneMinusMultPlus'_e (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) (Init.Nat.add (Init.Nat.mul match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
rewrite OneMinusMultPlus'_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) (Init.Nat.sub (S O) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))))))) (Init.Nat.add (Init.Nat.mul match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul match bs2nat (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end (bs2nat (@nth (list bool) (S O) l (@nil bool)))) (Init.Nat.mul (bs2nat (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) match match bs2nat (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end with | O => S O | S l => O end)) (Init.Nat.add (Init.Nat.mul match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
rewrite Normalize_correct.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul match bs2nat (Sem (Proj (S O) O) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end (bs2nat (@nth (list bool) (S O) l (@nil bool)))) (Init.Nat.mul (bs2nat (Sem (Proj (S O) O) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) match match bs2nat (Sem (Proj (S O) O) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) with | O => S O | S l => O end with | O => S O | S l => O end)) (Init.Nat.add (Init.Nat.mul match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
simpl.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end (bs2nat (@nth (list bool) (S O) l (@nil bool)))) (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end with | O => S O | S l => O end)) (Init.Nat.add (Init.Nat.mul match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) match match bs2nat (@hd (list bool) (@nil bool) l) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
rewrite hd_nth_1, hd_nth_0.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) O)) *)
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end (bs2nat (@nth (list bool) (S O) l (@nil bool)))) (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end with | O => S O | S l => O end)) (Init.Nat.add (Init.Nat.mul match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end (bs2nat (@nth (list bool) (S O) l (@nil bool)))) (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) match match bs2nat (@nth (list bool) O l (@nil bool)) with | O => S O | S l => O end with | O => S O | S l => O end)) *)
trivial.
(* Goal: or (@eq (list bool) (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) (@nil bool)) (not (@eq nat (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) (Sem Normalize_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) O)) *)
apply Normalize_normal.
Qed.
Opaque OneMinusMultPlus_e.
Definition PlusMod2_e : Cobham :=
Comp 2 Cond [
Proj 2 1;
Proj 2 0;
Comp 2 Succ_e [Proj 2 0];
Proj 2 0
].
Lemma arity_PlusMod2 :
arity PlusMod2_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity PlusMod2_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_PlusMod2 :
rec_bounded PlusMod2_e.
Proof.
(* Goal: rec_bounded PlusMod2_e *)
simpl.
(* Goal: and (rec_bounded Cond) (and True (and True (and (and (rec_bounded Succ_e) (and True True)) (and True True)))) *)
intuition.
(* Goal: rec_bounded Succ_e *)
(* Goal: rec_bounded Cond *)
apply rec_bounded'_spec with 4.
(* Goal: rec_bounded Succ_e *)
(* Goal: rec_bounded' Cond *)
(* Goal: @eq Arity (arity Cond) (ok_arity (S (S (S (S O))))) *)
apply arity_Cond.
(* Goal: rec_bounded Succ_e *)
(* Goal: rec_bounded' Cond *)
apply rec_bounded_Cond.
(* Goal: rec_bounded Succ_e *)
apply rec_bounded_Succ.
Qed.
Lemma PlusMod2_correct : forall l,
bs2nat (Sem PlusMod2_e l) =
bs2nat (hd nil l) + mod2 (bs2nat (hd nil (tl l))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem PlusMod2_e l)) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) (mod2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
unfold mod2.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem PlusMod2_e l)) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))))) *)
intros [ | u [ | v l] ]; simpl.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat v) (Init.Nat.add (Nat.div2 (bs2nat v)) (Init.Nat.add (Nat.div2 (bs2nat v)) O)))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O)))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) (@nil bool) (@cons (list bool) (Sem Succ_e (@cons (list bool) (@nil bool) (@nil (list bool)))) (@cons (list bool) (@nil bool) (@nil (list bool)))))))) (Init.Nat.add (bs2nat (@nil bool)) (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O)))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat v) (Init.Nat.add (Nat.div2 (bs2nat v)) (Init.Nat.add (Nat.div2 (bs2nat v)) O)))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O)))) *)
rewrite Cond_correct, bs2nat_nil; simpl.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat v) (Init.Nat.add (Nat.div2 (bs2nat v)) (Init.Nat.add (Nat.div2 (bs2nat v)) O)))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) O) *)
omega.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) v (@cons (list bool) u (@cons (list bool) (Sem Succ_e (@cons (list bool) u (@nil (list bool)))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat v) (Init.Nat.add (Nat.div2 (bs2nat v)) (Init.Nat.add (Nat.div2 (bs2nat v)) O)))) *)
rewrite Cond_correct; simpl.
(* Goal: @eq nat (bs2nat match v with | nil => u | cons (true as b) l => Sem Succ_e (@cons (list bool) u (@nil (list bool))) | cons (false as b) l => u end) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat v) (Init.Nat.add (Nat.div2 (bs2nat v)) (Init.Nat.add (Nat.div2 (bs2nat v)) O)))) *)
destruct v as [ | [ | ] v].
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) O)))) *)
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool true v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true v))) O)))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O)))) *)
rewrite bs2nat_nil.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) O)))) *)
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool true v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true v))) O)))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub O (Init.Nat.add (Nat.div2 O) (Init.Nat.add (Nat.div2 O) O)))) *)
simpl; omega.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) O)))) *)
(* Goal: @eq nat (bs2nat (Sem Succ_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool true v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true v))) O)))) *)
rewrite bs2nat_true, Succ_correct.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) O)))) *)
(* Goal: @eq nat (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v))) (Init.Nat.add (Nat.div2 (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v)))) (Init.Nat.add (Nat.div2 (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat v)))) O)))) *)
change (1 + 2 * bs2nat v) with (S (2 * bs2nat v)).
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) O)))) *)
(* Goal: @eq nat (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat v))) (Init.Nat.add (Nat.div2 (S (Init.Nat.mul (S (S O)) (bs2nat v)))) (Init.Nat.add (Nat.div2 (S (Init.Nat.mul (S (S O)) (bs2nat v)))) O)))) *)
rewrite div2_double_plus_one.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) O)))) *)
(* Goal: @eq nat (Init.Nat.add (S O) (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat v))) (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)))) *)
simpl hd; omega.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (bs2nat (@cons bool false v)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false v))) O)))) *)
rewrite bs2nat_false, div2_double.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat v)) (Init.Nat.add (bs2nat v) (Init.Nat.add (bs2nat v) O)))) *)
omega.
Qed.
Opaque PlusMod2_e.
Definition PlusOneMinusMod2_e : Cobham :=
Comp 3 Cond [
Proj 3 2;
Proj 3 0;
Comp 3 PlusOneMinus_e [Proj 3 0; Proj 3 1];
Proj 3 0
].
Lemma arity_PlusOneMinusMod2 :
arity PlusOneMinusMod2_e = ok_arity 3.
Proof.
(* Goal: @eq Arity (arity PlusOneMinusMod2_e) (ok_arity (S (S (S O)))) *)
trivial.
Qed.
Lemma rec_bounded_PlusOneMinusMod2 :
rec_bounded PlusOneMinusMod2_e.
Proof.
(* Goal: rec_bounded PlusOneMinusMod2_e *)
simpl.
(* Goal: and (rec_bounded Cond) (and True (and True (and (and (rec_bounded PlusOneMinus_e) (and True (and True True))) (and True True)))) *)
intuition.
(* Goal: rec_bounded PlusOneMinus_e *)
(* Goal: rec_bounded Cond *)
apply rec_bounded'_spec with 4.
(* Goal: rec_bounded PlusOneMinus_e *)
(* Goal: rec_bounded' Cond *)
(* Goal: @eq Arity (arity Cond) (ok_arity (S (S (S (S O))))) *)
apply arity_Cond.
(* Goal: rec_bounded PlusOneMinus_e *)
(* Goal: rec_bounded' Cond *)
apply rec_bounded_Cond.
(* Goal: rec_bounded PlusOneMinus_e *)
apply rec_bounded_PlusOneMinus.
Qed.
Lemma PlusOneMinusMod2_correct : forall l,
bs2nat (Sem PlusOneMinusMod2_e l) =
bs2nat (hd nil l) +
(1 - bs2nat (hd nil (tl l))) *
mod2 (bs2nat (hd nil (tl (tl l)))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem PlusOneMinusMod2_e l)) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (mod2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) l))))))) *)
unfold mod2.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem PlusOneMinusMod2_e l)) (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) l)) (Init.Nat.mul (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.sub (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) l)))) (Init.Nat.mul (S (S O)) (Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) l))))))))) *)
intros [ | u [ | v [ | w l] ] ]; simpl.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) (@nil bool) (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat (@nil bool) with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) (@nil bool) (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) (@nil bool) (@cons (list bool) (@nil bool) (@nil (list bool))))) (@cons (list bool) (@nil bool) (@nil (list bool)))))))) (Init.Nat.add (bs2nat (@nil bool)) (Init.Nat.mul match bs2nat (@nil bool) with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) (@nil bool) (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat (@nil bool) with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
rewrite Cond_correct.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
(* Goal: @eq nat (bs2nat match @hd (list bool) (@nil bool) (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))) with | nil => @hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool))))))) | cons (true as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) | cons (false as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool))))))))) end) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
rewrite bs2nat_nil.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub O (Init.Nat.add (Nat.div2 O) (Init.Nat.add (Nat.div2 O) O))))) *)
simpl; ring.
(* Goal: @eq nat (bs2nat (Sem Cond (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
rewrite Cond_correct.
(* Goal: @eq nat (bs2nat match @hd (list bool) (@nil bool) (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))) with | nil => @hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool))))))) | cons (true as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool)))))))) | cons (false as b) l => @hd (list bool) (@nil bool) (@tl (list bool) (@tl (list bool) (@tl (list bool) (@cons (list bool) w (@cons (list bool) u (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))) (@cons (list bool) u (@nil (list bool))))))))) end) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
simpl.
(* Goal: @eq nat (bs2nat match w with | nil => u | cons (true as b) l => Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool)))) | cons (false as b) l => u end) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat w) (Init.Nat.add (Nat.div2 (bs2nat w)) (Init.Nat.add (Nat.div2 (bs2nat w)) O))))) *)
destruct w as [ | [ | ] w].
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool true w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) O))))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@nil bool)) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) (Init.Nat.add (Nat.div2 (bs2nat (@nil bool))) O))))) *)
rewrite bs2nat_nil.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool true w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) O))))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub O (Init.Nat.add (Nat.div2 O) (Init.Nat.add (Nat.div2 O) O))))) *)
simpl; ring.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (bs2nat (Sem PlusOneMinus_e (@cons (list bool) u (@cons (list bool) v (@nil (list bool)))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool true w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) O))))) *)
rewrite PlusOneMinus_correct.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v (@nil (list bool)))))) (Init.Nat.sub (S O) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v (@nil (list bool))))))))) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool true w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) O))))) *)
simpl.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat u) match bs2nat v with | O => S O | S l => O end) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool true w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool true w))) O))))) *)
rewrite bs2nat_true.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat u) match bs2nat v with | O => S O | S l => O end) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat w))) (Init.Nat.add (Nat.div2 (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat w)))) (Init.Nat.add (Nat.div2 (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat w)))) O))))) *)
change (1 + 2 * bs2nat w) with (S (2 * bs2nat w)).
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat u) match bs2nat v with | O => S O | S l => O end) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat w))) (Init.Nat.add (Nat.div2 (S (Init.Nat.mul (S (S O)) (bs2nat w)))) (Init.Nat.add (Nat.div2 (S (Init.Nat.mul (S (S O)) (bs2nat w)))) O))))) *)
rewrite div2_double_plus_one.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat u) match bs2nat v with | O => S O | S l => O end) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat w))) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
case (bs2nat v).
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: forall _ : nat, @eq nat (Init.Nat.add (bs2nat u) O) (Init.Nat.add (bs2nat u) (Init.Nat.mul O (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat w))) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
(* Goal: @eq nat (Init.Nat.add (bs2nat u) (S O)) (Init.Nat.add (bs2nat u) (Init.Nat.mul (S O) (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat w))) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
omega.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
(* Goal: forall _ : nat, @eq nat (Init.Nat.add (bs2nat u) O) (Init.Nat.add (bs2nat u) (Init.Nat.mul O (Init.Nat.sub (S (Init.Nat.mul (S (S O)) (bs2nat w))) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
trivial.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (bs2nat (@cons bool false w)) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) (Init.Nat.add (Nat.div2 (bs2nat (@cons bool false w))) O))))) *)
rewrite bs2nat_false.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat w)) (Init.Nat.add (Nat.div2 (Init.Nat.mul (S (S O)) (bs2nat w))) (Init.Nat.add (Nat.div2 (Init.Nat.mul (S (S O)) (bs2nat w))) O))))) *)
rewrite div2_double.
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul match bs2nat v with | O => S O | S l => O end (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat w)) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
case (bs2nat v).
(* Goal: forall _ : nat, @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul O (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat w)) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
(* Goal: @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul (S O) (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat w)) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
omega.
(* Goal: forall _ : nat, @eq nat (bs2nat u) (Init.Nat.add (bs2nat u) (Init.Nat.mul O (Init.Nat.sub (Init.Nat.mul (S (S O)) (bs2nat w)) (Init.Nat.add (bs2nat w) (Init.Nat.add (bs2nat w) O))))) *)
trivial.
Qed.
Lemma PlusOneMinusMod2_length : forall l,
length (Sem PlusOneMinusMod2_e l) <= S (length (hd nil l)).
Proof.
(* Goal: forall l : list (list bool), le (@length bool (Sem PlusOneMinusMod2_e l)) (S (@length bool (@hd (list bool) (@nil bool) l))) *)
intros; simpl.
(* Goal: le (@length bool (Sem Cond (@cons (list bool) (@nth (list bool) (S (S O)) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem PlusOneMinus_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool))))) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))))))) (S (@length bool (@hd (list bool) (@nil bool) l))) *)
rewrite Cond_correct; simpl.
(* Goal: le (@length bool match @nth (list bool) (S (S O)) l (@nil bool) with | nil => @nth (list bool) O l (@nil bool) | cons (true as b) l0 => Sem PlusOneMinus_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) | cons (false as b) l0 => @nth (list bool) O l (@nil bool) end) (S (@length bool (@hd (list bool) (@nil bool) l))) *)
rewrite hd_nth_0.
(* Goal: le (@length bool match @nth (list bool) (S (S O)) l (@nil bool) with | nil => @nth (list bool) O l (@nil bool) | cons (true as b) l0 => Sem PlusOneMinus_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) | cons (false as b) l0 => @nth (list bool) O l (@nil bool) end) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
destruct (nth 2 l nil); auto.
(* Goal: le (@length bool (if b then Sem PlusOneMinus_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))) else @nth (list bool) O l (@nil bool))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
case b; auto.
(* Goal: le (@length bool (Sem PlusOneMinus_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@nil (list bool)))))) (S (@length bool (@nth (list bool) O l (@nil bool)))) *)
apply PlusOneMinus_length.
Qed.
Opaque PlusOneMinusMod2_e.
Definition MultTwoPowerLength'_e : Cobham :=
Rec2
(Proj 1 0)
(Comp 3 (Succ false) [Proj 3 1])
(Comp 2 Smash [Comp 2 (Succ true) [Proj 2 0]; Comp 2 (Succ true) [Proj 2 1] ] ).
Lemma arity_MultTwoPowerLength' :
arity MultTwoPowerLength'_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity MultTwoPowerLength'_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_MultTwoPowerLength' :
rec_bounded MultTwoPowerLength'_e.
Proof.
(* Goal: rec_bounded MultTwoPowerLength'_e *)
simpl.
(* Goal: and (and True (and (and True (and True True)) (and (and True (and True True)) True))) (and True (and (and True (and True True)) (and (and True (and True True)) (forall l : list (list bool), le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (@length bool (smash' (@nth (list bool) (S O) l (@nil bool)) (smash_bs (@nth (list bool) O l (@nil bool)) (@cons bool true (@nth (list bool) (S O) l (@nil bool))))))))))) *)
intuition.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (S (@length bool (smash' (@nth (list bool) (S O) l (@nil bool)) (smash_bs (@nth (list bool) O l (@nil bool)) (@cons bool true (@nth (list bool) (S O) l (@nil bool))))))) *)
destruct l as [ | u [ | v l] ]; simpl.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (S (@length bool (smash_bs u (@cons bool true (@nil bool))))) *)
(* Goal: le O (S (S O)) *)
omega.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (S (@length bool (smash_bs u (@cons bool true (@nil bool))))) *)
rewrite length_smash; simpl.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (S (S (Init.Nat.mul (@length bool u) (S O)))) *)
rewrite mult_1_r.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (S (S (@length bool u))) *)
induction u as [ | [ | ] u IH]; simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (@length bool (smash' v (smash_bs u (@cons bool true v))))) *)
rewrite length_smash', length_smash; simpl.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l))) (S (Init.Nat.add (@length bool v) (S (Init.Nat.mul (@length bool u) (S (@length bool v)))))) *)
induction u as [ | [ | ] u IH]; simpl; omega.
Qed.
Lemma MultTwoPowerLength'_correct : forall l,
bs2nat (Sem MultTwoPowerLength'_e l) =
power 2 (length (hd nil l)) * bs2nat (hd nil (tl l)).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem MultTwoPowerLength'_e l)) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) l))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
destruct l as [ | u [ | v l] ].
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool))))))) *)
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@nil (list bool)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@nil (list bool))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@nil (list bool)))))) *)
trivial.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool))))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) (Init.Nat.mul (power (S (S O)) (@length bool u)) (bs2nat (@nil bool))) *)
rewrite bs2nat_nil, mult_0_r.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool)))) O *)
induction u as [ | [ | ] u IH].
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@cons bool true u) (@nil (list bool)))) O *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@nil bool) (@nil (list bool)))) O *)
trivial.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@cons bool true u) (@nil (list bool)))) O *)
simpl.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool))))) O *)
rewrite bs2nat_false.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool))))) O *)
omega.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (@cons bool false u) (@nil (list bool)))) O *)
simpl.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool))))) O *)
rewrite bs2nat_false.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@nil (list bool))))) O *)
omega.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.mul (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l)))))) *)
induction u as [ | [ | ] u IH]; simpl in *.
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l)))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (Init.Nat.add (power (S (S O)) (@length bool u)) O)) (bs2nat v)) *)
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l)))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (Init.Nat.add (power (S (S O)) (@length bool u)) O)) (bs2nat v)) *)
(* Goal: @eq nat (bs2nat v) (Init.Nat.add (bs2nat v) O) *)
trivial.
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l)))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (Init.Nat.add (power (S (S O)) (@length bool u)) O)) (bs2nat v)) *)
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l)))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (Init.Nat.add (power (S (S O)) (@length bool u)) O)) (bs2nat v)) *)
rewrite bs2nat_false, plus_0_r, IH.
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l)))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (Init.Nat.add (power (S (S O)) (@length bool u)) O)) (bs2nat v)) *)
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (Init.Nat.mul (power (S (S O)) (@length bool u)) (bs2nat v))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (power (S (S O)) (@length bool u))) (bs2nat v)) *)
ring.
(* Goal: @eq nat (bs2nat (@cons bool false (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) (fun vl : list (list bool) => @cons bool false (@nth (list bool) (S O) vl (@nil bool))) u (@cons (list bool) v l)))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (Init.Nat.add (power (S (S O)) (@length bool u)) O)) (bs2nat v)) *)
rewrite bs2nat_false, plus_0_r, IH.
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (Init.Nat.mul (power (S (S O)) (@length bool u)) (bs2nat v))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) (@length bool u)) (power (S (S O)) (@length bool u))) (bs2nat v)) *)
ring.
Qed.
Opaque MultTwoPowerLength'_e.
Definition MultTwoPowerLength_e : Cobham :=
Comp 2 MultTwoPowerLength'_e [Proj 2 1; Proj 2 0].
Lemma arity_MultTwoPowerLength :
arity MultTwoPowerLength_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity MultTwoPowerLength_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_MultTwoPowerLength :
rec_bounded MultTwoPowerLength_e.
Proof.
(* Goal: rec_bounded MultTwoPowerLength_e *)
simpl.
(* Goal: and (rec_bounded MultTwoPowerLength'_e) (and True (and True True)) *)
intuition.
(* Goal: rec_bounded MultTwoPowerLength'_e *)
apply rec_bounded_MultTwoPowerLength'.
Qed.
Lemma MultTwoPowerLength_correct : forall l,
bs2nat (Sem MultTwoPowerLength_e l) =
bs2nat (hd nil l) * power 2 (length (hd nil (tl l))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem MultTwoPowerLength_e l)) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
intro l.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength_e l)) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
simpl.
(* Goal: @eq nat (bs2nat (Sem MultTwoPowerLength'_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
rewrite MultTwoPowerLength'_correct; simpl.
(* Goal: @eq nat (Init.Nat.mul (power (S (S O)) (@length bool (@nth (list bool) (S O) l (@nil bool)))) (bs2nat (@nth (list bool) O l (@nil bool)))) (Init.Nat.mul (bs2nat (@hd (list bool) (@nil bool) l)) (power (S (S O)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
rewrite hd_nth_0, hd_nth_1.
(* Goal: @eq nat (Init.Nat.mul (power (S (S O)) (@length bool (@nth (list bool) (S O) l (@nil bool)))) (bs2nat (@nth (list bool) O l (@nil bool)))) (Init.Nat.mul (bs2nat (@nth (list bool) O l (@nil bool))) (power (S (S O)) (@length bool (@nth (list bool) (S O) l (@nil bool))))) *)
ring.
Qed.
Opaque MultTwoPowerLength_e.
Definition DivTwoPower'_e : Cobham :=
Rec2
(Proj 1 0)
(Comp 3 Div2_e [Proj 3 1])
(Proj 2 1).
Lemma arity_DivTwoPower' :
arity DivTwoPower'_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity DivTwoPower'_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma length_DivTwoPower' : forall l,
length (Sem DivTwoPower'_e l) = length (hd nil (tl l)) - length (hd nil l).
Proof.
(* Goal: forall l : list (list bool), @eq nat (@length bool (Sem DivTwoPower'_e l)) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@length bool (@hd (list bool) (@nil bool) l))) *)
intros [ | u [ | v l] ].
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) *)
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@nil (list bool)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@nil (list bool))))) (@length bool (@hd (list bool) (@nil bool) (@nil (list bool))))) *)
trivial.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@nil (list bool))))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))))) *)
simpl.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool)))) O *)
induction u as [ | [ | ] u IH].
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@nil (list bool)))) O *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@nil bool) (@nil (list bool)))) O *)
trivial.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@nil (list bool)))) O *)
simpl.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) O *)
rewrite length_Div2.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: @eq nat (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) (S O)) O *)
simpl; omega.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
simpl.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) O *)
rewrite length_Div2.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq nat (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) (S O)) O *)
simpl; omega.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
induction u as [ | [ | ] u IH].
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@cons bool true u) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@nil bool) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@nil bool) (@cons (list bool) v l))))) *)
simpl; omega.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@cons bool true u) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))))) *)
simpl in *.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) *)
(* Goal: @eq nat (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (Init.Nat.sub (@length bool v) (S (@length bool u))) *)
rewrite length_Div2.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) *)
(* Goal: @eq nat (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (S O)) (Init.Nat.sub (@length bool v) (S (@length bool u))) *)
simpl; omega.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) *)
simpl in *.
(* Goal: @eq nat (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (Init.Nat.sub (@length bool v) (S (@length bool u))) *)
rewrite length_Div2.
(* Goal: @eq nat (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (S O)) (Init.Nat.sub (@length bool v) (S (@length bool u))) *)
simpl; omega.
Qed.
Lemma rec_bounded_DivTwoPower' :
rec_bounded DivTwoPower'_e.
Proof.
(* Goal: rec_bounded DivTwoPower'_e *)
simpl.
(* Goal: and True (and True (and (and (rec_bounded Div2_e) (and True True)) (and (and (rec_bounded Div2_e) (and True True)) (forall l : list (list bool), le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) (S O) l (@nil bool))))))) *)
intuition.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) (S O) l (@nil bool))) *)
(* Goal: rec_bounded Div2_e *)
(* Goal: rec_bounded Div2_e *)
apply rec_bounded_Div2.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) (S O) l (@nil bool))) *)
(* Goal: rec_bounded Div2_e *)
apply rec_bounded_Div2.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) l) (@tl (list bool) l))) (@length bool (@nth (list bool) (S O) l (@nil bool))) *)
destruct l as [ | u [ | v l] ].
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@nil (list bool))) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@nil (list bool))) (@tl (list bool) (@nil (list bool))))) (@length bool (@nth (list bool) (S O) (@nil (list bool)) (@nil bool))) *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool)))) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@nil (list bool))) (@nil bool))) *)
simpl.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool)))) O *)
induction u as [ | [ | ] u IH].
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@nil (list bool)))) O *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@nil bool) (@nil (list bool)))) O *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@nil (list bool)))) O *)
simpl.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: le (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) O *)
rewrite length_Div2.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
(* Goal: le (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) (S O)) O *)
simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool)))) O *)
simpl.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) O *)
rewrite length_Div2.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) (S O)) O *)
simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) u (@cons (list bool) v l)) (@nil bool))) *)
induction u as [ | [ | ] u IH].
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@nil bool) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@nil bool) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@nil bool) (@cons (list bool) v l)) (@nil bool))) *)
trivial.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@cons bool true u) (@cons (list bool) v l)) (@nil bool))) *)
simpl in *.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (@length bool v) *)
rewrite length_Div2.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)) (@nil bool))) *)
(* Goal: le (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (S O)) (@length bool v) *)
simpl; omega.
(* Goal: le (@length bool (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@hd (list bool) (@nil bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))) (@tl (list bool) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l))))) (@length bool (@nth (list bool) (S O) (@cons (list bool) (@cons bool false u) (@cons (list bool) v l)) (@nil bool))) *)
simpl in *.
(* Goal: le (@length bool (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (@length bool v) *)
rewrite length_Div2.
(* Goal: le (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (S O)) (@length bool v) *)
simpl; omega.
Qed.
Lemma DivTwoPower'_correct_bs : forall l,
Sem DivTwoPower'_e l =
fun_power (length (hd nil l)) (@tl _) (hd nil (tl l)).
Proof.
(* Goal: forall l : list (list bool), @eq (list bool) (Sem DivTwoPower'_e l) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) l)) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) l))) *)
intros [ | u [ | v l] ].
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@nil (list bool)))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool))))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))) *)
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@nil (list bool))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@nil (list bool)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@nil (list bool))))) *)
trivial.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@nil (list bool)))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@nil (list bool))))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@nil (list bool)))))) *)
simpl.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@fun_power (list bool) (@length bool u) (@tl bool) (@nil bool)) *)
induction u as [ | [ | ] u IH].
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool))) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) (@nil bool)) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@nil (list bool))) (@fun_power (list bool) (@length bool (@cons bool true u)) (@tl bool) (@nil bool)) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@nil bool) (@nil (list bool))) (@fun_power (list bool) (@length bool (@nil bool)) (@tl bool) (@nil bool)) *)
trivial.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool))) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) (@nil bool)) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@nil (list bool))) (@fun_power (list bool) (@length bool (@cons bool true u)) (@tl bool) (@nil bool)) *)
simpl.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool))) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) (@nil bool)) *)
(* Goal: @eq (list bool) (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool)))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) (@nil bool))) *)
rewrite Div2_correct_bs.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool))) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) (@nil bool)) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) (@nil bool))) *)
simpl; congruence.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@nil (list bool))) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) (@nil bool)) *)
simpl.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool)))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) (@nil bool))) *)
rewrite Div2_correct_bs.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@nil (list bool))) (@nil (list bool))))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) (@nil bool))) *)
simpl; congruence.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) u (@cons (list bool) v l))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) u (@cons (list bool) v l)))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) u (@cons (list bool) v l))))) *)
simpl.
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@fun_power (list bool) (@length bool u) (@tl bool) v) *)
induction u as [ | [ | ] u IH].
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) v) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@cons bool true u)) (@tl bool) v) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@nil bool) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@nil bool)) (@tl bool) v) *)
trivial.
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) v) *)
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool true u) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@cons bool true u)) (@tl bool) v) *)
simpl.
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) v) *)
(* Goal: @eq (list bool) (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool)))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) v)) *)
rewrite Div2_correct_bs.
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) v) *)
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) v)) *)
simpl; congruence.
(* Goal: @eq (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (@cons bool false u) (@cons (list bool) v l)) (@fun_power (list bool) (@length bool (@cons bool false u)) (@tl bool) v) *)
simpl.
(* Goal: @eq (list bool) (Sem Div2_e (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool)))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) v)) *)
rewrite Div2_correct_bs.
(* Goal: @eq (list bool) (@tl bool (@hd (list bool) (@nil bool) (@cons (list bool) (sem_Rec (fun vl : list (list bool) => @nth (list bool) O vl (@nil bool)) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) (fun vl : list (list bool) => Sem Div2_e (@cons (list bool) (@nth (list bool) (S O) vl (@nil bool)) (@nil (list bool)))) u (@cons (list bool) v l)) (@nil (list bool))))) (@tl bool (@fun_power (list bool) (@length bool u) (@tl bool) v)) *)
simpl; congruence.
Qed.
Lemma DivTwoPower'_correct : forall l,
bs2nat (Sem DivTwoPower'_e l) =
fun_power (length (hd nil l)) div2 (bs2nat (hd nil (tl l))).
Proof.
(* Goal: forall l : list (list bool), @eq nat (bs2nat (Sem DivTwoPower'_e l)) (@fun_power nat (@length bool (@hd (list bool) (@nil bool) l)) Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
intro l.
(* Goal: @eq nat (bs2nat (Sem DivTwoPower'_e l)) (@fun_power nat (@length bool (@hd (list bool) (@nil bool) l)) Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
rewrite DivTwoPower'_correct_bs.
(* Goal: @eq nat (bs2nat (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) l)) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (@fun_power nat (@length bool (@hd (list bool) (@nil bool) l)) Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
induction (length (hd nil l)).
(* Goal: @eq nat (bs2nat (@fun_power (list bool) (S n) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (@fun_power nat (S n) Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
(* Goal: @eq nat (bs2nat (@fun_power (list bool) O (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (@fun_power nat O Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
trivial.
(* Goal: @eq nat (bs2nat (@fun_power (list bool) (S n) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (@fun_power nat (S n) Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
simpl.
(* Goal: @eq nat (bs2nat (@tl bool (@fun_power (list bool) n (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) l))))) (Nat.div2 (@fun_power nat n Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
rewrite bs2nat_tl.
(* Goal: @eq nat (Nat.div2 (bs2nat (@fun_power (list bool) n (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) l))))) (Nat.div2 (@fun_power nat n Nat.div2 (bs2nat (@hd (list bool) (@nil bool) (@tl (list bool) l))))) *)
congruence.
Qed.
Opaque DivTwoPower'_e.
Definition DivTwoPower_e : Cobham :=
Comp 2 DivTwoPower'_e [Proj 2 1; Proj 2 0].
Lemma arity_DivTwoPower :
arity DivTwoPower_e = ok_arity 2.
Proof.
(* Goal: @eq Arity (arity DivTwoPower_e) (ok_arity (S (S O))) *)
trivial.
Qed.
Lemma rec_bounded_DivTwoPower :
rec_bounded DivTwoPower_e.
Proof.
(* Goal: rec_bounded DivTwoPower_e *)
simpl.
(* Goal: and (rec_bounded DivTwoPower'_e) (and True (and True True)) *)
intuition.
(* Goal: rec_bounded DivTwoPower'_e *)
apply rec_bounded_DivTwoPower'.
Qed.
Lemma DivTwoPower_correct_bs : forall l,
Sem DivTwoPower_e l =
fun_power (length (hd nil (tl l))) (@tl _) (hd nil l).
Proof.
(* Goal: forall l : list (list bool), @eq (list bool) (Sem DivTwoPower_e l) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@tl bool) (@hd (list bool) (@nil bool) l)) *)
intro l.
(* Goal: @eq (list bool) (Sem DivTwoPower_e l) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@tl bool) (@hd (list bool) (@nil bool) l)) *)
simpl.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@tl bool) (@hd (list bool) (@nil bool) l)) *)
rewrite DivTwoPower'_correct_bs.
(* Goal: @eq (list bool) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))))) (@tl bool) (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@tl bool) (@hd (list bool) (@nil bool) l)) *)
simpl.
(* Goal: @eq (list bool) (@fun_power (list bool) (@length bool (@nth (list bool) (S O) l (@nil bool))) (@tl bool) (@nth (list bool) O l (@nil bool))) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@tl bool) (@hd (list bool) (@nil bool) l)) *)
rewrite <- hd_nth_0, <- hd_nth_1.
(* Goal: @eq (list bool) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@tl bool) (@hd (list bool) (@nil bool) l)) (@fun_power (list bool) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l))) (@tl bool) (@hd (list bool) (@nil bool) l)) *)
trivial.
Qed.
Lemma length_DivTwoPower : forall l,
length (Sem DivTwoPower_e l) = length (hd nil l) - length (hd nil (tl l)).
Proof.
(* Goal: forall l : list (list bool), @eq nat (@length bool (Sem DivTwoPower_e l)) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
intro l.
(* Goal: @eq nat (@length bool (Sem DivTwoPower_e l)) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
simpl.
(* Goal: @eq nat (@length bool (Sem DivTwoPower'_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool)))))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
rewrite length_DivTwoPower'.
(* Goal: @eq nat (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))))) (@length bool (@hd (list bool) (@nil bool) (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
simpl.
(* Goal: @eq nat (Init.Nat.sub (@length bool (@nth (list bool) O l (@nil bool))) (@length bool (@nth (list bool) (S O) l (@nil bool)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
rewrite <- hd_nth_0, <- hd_nth_1.
(* Goal: @eq nat (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l)))) (Init.Nat.sub (@length bool (@hd (list bool) (@nil bool) l)) (@length bool (@hd (list bool) (@nil bool) (@tl (list bool) l)))) *)
trivial.
Qed.
Lemma skipn_tl : forall n (l : bs),
skipn (S n) l = tl (skipn n l).
Proof.
(* Goal: forall (n : nat) (l : list bool), @eq (list bool) (@skipn bool (S n) l) (@tl bool (@skipn bool n l)) *)
intros.
(* Goal: @eq (list bool) (@skipn bool (S n) l) (@tl bool (@skipn bool n l)) *)
destruct (le_lt_dec (length l) n).
(* Goal: @eq (list bool) (@skipn bool (S n) l) (@tl bool (@skipn bool n l)) *)
(* Goal: @eq (list bool) (@skipn bool (S n) l) (@tl bool (@skipn bool n l)) *)
rewrite skipn_nil; simpl.
(* Goal: @eq (list bool) (@skipn bool (S n) l) (@tl bool (@skipn bool n l)) *)
(* Goal: le (@length bool l) (S n) *)
(* Goal: @eq (list bool) (@nil bool) (@tl bool (@skipn bool n l)) *)
rewrite skipn_nil; simpl; auto.
(* Goal: @eq (list bool) (@skipn bool (S n) l) (@tl bool (@skipn bool n l)) *)
(* Goal: le (@length bool l) (S n) *)
omega.
(* Goal: @eq (list bool) (@skipn bool (S n) l) (@tl bool (@skipn bool n l)) *)
rewrite (skipn_hd n l true).
(* Goal: lt n (@length bool l) *)
(* Goal: @eq (list bool) (@skipn bool (S n) l) (@tl bool (@cons bool (@nth bool n l true) (@skipn bool (S n) l))) *)
reflexivity.
(* Goal: lt n (@length bool l) *)
trivial.
Qed.
Lemma DivTwoPower_correct : forall l,
Sem DivTwoPower_e l =
skipn (length (nth 1 l nil)) (nth 0 l nil).
Proof.
(* Goal: forall l : list (list bool), @eq (list bool) (Sem DivTwoPower_e l) (@skipn bool (@length bool (@nth (list bool) (S O) l (@nil bool))) (@nth (list bool) O l (@nil bool))) *)
intros l.
(* Goal: @eq (list bool) (Sem DivTwoPower_e l) (@skipn bool (@length bool (@nth (list bool) (S O) l (@nil bool))) (@nth (list bool) O l (@nil bool))) *)
simpl.
(* Goal: @eq (list bool) (Sem DivTwoPower'_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@nil (list bool))))) (@skipn bool (@length bool (@nth (list bool) (S O) l (@nil bool))) (@nth (list bool) O l (@nil bool))) *)
rewrite DivTwoPower'_correct_bs; simpl.
(* Goal: @eq (list bool) (@fun_power (list bool) (@length bool (@nth (list bool) (S O) l (@nil bool))) (@tl bool) (@nth (list bool) O l (@nil bool))) (@skipn bool (@length bool (@nth (list bool) (S O) l (@nil bool))) (@nth (list bool) O l (@nil bool))) *)
induction (nth 1 l nil); simpl; auto.
(* Goal: @eq (list bool) (@tl bool (@fun_power (list bool) (@length bool l0) (@tl bool) (@nth (list bool) O l (@nil bool)))) match @nth (list bool) O l (@nil bool) with | nil => @nil bool | cons a l => @skipn bool (@length bool l0) l end *)
rewrite IHl0.
(* Goal: @eq (list bool) (@tl bool (@skipn bool (@length bool l0) (@nth (list bool) O l (@nil bool)))) match @nth (list bool) O l (@nil bool) with | nil => @nil bool | cons a l => @skipn bool (@length bool l0) l end *)
destruct (nth 0 l nil); simpl.
(* Goal: @eq (list bool) (@tl bool (@skipn bool (@length bool l0) (@cons bool b l1))) (@skipn bool (@length bool l0) l1) *)
(* Goal: @eq (list bool) (@tl bool (@skipn bool (@length bool l0) (@nil bool))) (@nil bool) *)
rewrite skipn_nil; simpl; auto.
(* Goal: @eq (list bool) (@tl bool (@skipn bool (@length bool l0) (@cons bool b l1))) (@skipn bool (@length bool l0) l1) *)
(* Goal: le O (@length bool l0) *)
omega.
(* Goal: @eq (list bool) (@tl bool (@skipn bool (@length bool l0) (@cons bool b l1))) (@skipn bool (@length bool l0) l1) *)
rewrite <- skipn_tl.
(* Goal: @eq (list bool) (@skipn bool (S (@length bool l0)) (@cons bool b l1)) (@skipn bool (@length bool l0) l1) *)
simpl.
(* Goal: @eq (list bool) (@skipn bool (@length bool l0) l1) (@skipn bool (@length bool l0) l1) *)
trivial.
Qed.
Opaque DivTwoPower_e.
Definition DivDivTwoPower_e : Cobham :=
Comp 3 DivTwoPower_e [Proj 3 0; Comp 3 DivTwoPower_e [Proj 3 1; Proj 3 2] ].
Lemma arity_DivDivTwoPower :
arity DivDivTwoPower_e = ok_arity 3.
Proof.
(* Goal: @eq Arity (arity DivDivTwoPower_e) (ok_arity (S (S (S O)))) *)
trivial.
Qed.
Lemma rec_bounded_DivDivTwoPower :
rec_bounded DivDivTwoPower_e.
Proof.
(* Goal: rec_bounded DivDivTwoPower_e *)
simpl.
(* Goal: and (rec_bounded DivTwoPower_e) (and True (and (and (rec_bounded DivTwoPower_e) (and True (and True True))) True)) *)
intuition.
(* Goal: rec_bounded DivTwoPower_e *)
(* Goal: rec_bounded DivTwoPower_e *)
apply rec_bounded_DivTwoPower.
(* Goal: rec_bounded DivTwoPower_e *)
apply rec_bounded_DivTwoPower.
Qed.
Lemma DivDivTwoPower_correct : forall l,
Sem DivDivTwoPower_e l =
skipn (length (nth 1 l nil) - length (nth 2 l nil)) (nth 0 l nil).
Proof.
(* Goal: forall l : list (list bool), @eq (list bool) (Sem DivDivTwoPower_e l) (@skipn bool (Init.Nat.sub (@length bool (@nth (list bool) (S O) l (@nil bool))) (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (@nth (list bool) O l (@nil bool))) *)
intros l.
(* Goal: @eq (list bool) (Sem DivDivTwoPower_e l) (@skipn bool (Init.Nat.sub (@length bool (@nth (list bool) (S O) l (@nil bool))) (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (@nth (list bool) O l (@nil bool))) *)
simpl.
(* Goal: @eq (list bool) (Sem DivTwoPower_e (@cons (list bool) (@nth (list bool) O l (@nil bool)) (@cons (list bool) (Sem DivTwoPower_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) (S (S O)) l (@nil bool)) (@nil (list bool))))) (@nil (list bool))))) (@skipn bool (Init.Nat.sub (@length bool (@nth (list bool) (S O) l (@nil bool))) (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (@nth (list bool) O l (@nil bool))) *)
rewrite DivTwoPower_correct; simpl.
(* Goal: @eq (list bool) (@skipn bool (@length bool (Sem DivTwoPower_e (@cons (list bool) (@nth (list bool) (S O) l (@nil bool)) (@cons (list bool) (@nth (list bool) (S (S O)) l (@nil bool)) (@nil (list bool)))))) (@nth (list bool) O l (@nil bool))) (@skipn bool (Init.Nat.sub (@length bool (@nth (list bool) (S O) l (@nil bool))) (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (@nth (list bool) O l (@nil bool))) *)
rewrite DivTwoPower_correct; simpl.
(* Goal: @eq (list bool) (@skipn bool (@length bool (@skipn bool (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (@nth (list bool) (S O) l (@nil bool)))) (@nth (list bool) O l (@nil bool))) (@skipn bool (Init.Nat.sub (@length bool (@nth (list bool) (S O) l (@nil bool))) (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) (@nth (list bool) O l (@nil bool))) *)
f_equal.
(* Goal: @eq nat (@length bool (@skipn bool (@length bool (@nth (list bool) (S (S O)) l (@nil bool))) (@nth (list bool) (S O) l (@nil bool)))) (Init.Nat.sub (@length bool (@nth (list bool) (S O) l (@nil bool))) (@length bool (@nth (list bool) (S (S O)) l (@nil bool)))) *)
rewrite length_skipn; trivial.
Qed.
Opaque DivDivTwoPower_e.
Fixpoint Repeat_e (n l : nat) (b : bool) : Cobham :=
match l with
| 0 => Zero_e n
| S l' => Comp n (Succ b) [Repeat_e n l' b]
end.
Lemma arity_Repeat : forall n len b,
arity (Repeat_e n len b) = ok_arity n.
Proof.
(* Goal: forall (n len : nat) (b : bool), @eq Arity (arity (Repeat_e n len b)) (ok_arity n) *)
induction len as [ | len' IH]; simpl; trivial; intros [ | ]; rewrite IH; simpl; rewrite <- beq_nat_refl; trivial.
Qed.
Lemma rec_bounded_Repeat : forall n len b,
rec_bounded (Repeat_e n len b).
Proof.
(* Goal: forall (n len : nat) (b : bool), rec_bounded (Repeat_e n len b) *)
intros n len b.
(* Goal: rec_bounded (Repeat_e n len b) *)
induction len as [ | len' IH]; simpl.
(* Goal: and True (and (rec_bounded (Repeat_e n len' b)) True) *)
(* Goal: rec_bounded (Zero_e n) *)
apply rec_bounded_Zero.
(* Goal: and True (and (rec_bounded (Repeat_e n len' b)) True) *)
intuition.
Qed.
Lemma length_Repeat : forall n l b l',
length (Sem (Repeat_e n l b) l') = l.
Proof.
(* Goal: forall (n l : nat) (b : bool) (l' : list (list bool)), @eq nat (@length bool (Sem (Repeat_e n l b) l')) l *)
induction l; simpl; auto.
Qed.
Opaque Repeat_e.
Definition RoseS'_e : Cobham :=
Rec2
(Zero_e 2)
(Comp 4 PlusOneMinusMod2_e [
Comp 4 (Succ false) [Proj 4 1];
Comp 4 DivTwoPower_e [Comp 4 DivTwoPower_e [Proj 4 2; Proj 4 0]; Proj 4 3];
Comp 4 DivDivTwoPower_e [Proj 4 2; Proj 4 2; Comp 4 (Succ false) [Proj 4 0]]
])
(Comp 3 Smash [Proj 3 0; Repeat_e 3 2 true]).
Definition arity_RoseS' :
arity RoseS'_e = ok_arity 3.
Proof.
(* Goal: @eq Arity (arity RoseS'_e) (ok_arity (S (S (S O)))) *)
trivial.
Qed.
Lemma rec_bounded_RoseS' :
rec_bounded RoseS'_e.
Definition RoseS_e : Cobham :=
Comp 3 RoseS'_e [Proj 3 2; Proj 3 0; Proj 3 1].
Lemma arity_RoseS :
arity RoseS_e = ok_arity 3.
Proof.
(* Goal: @eq Arity (arity RoseS_e) (ok_arity (S (S (S O)))) *)
trivial.
Qed.
Opaque RoseS'_e.
Lemma rec_bounded_RoseS :
rec_bounded RoseS_e.
Proof.
(* Goal: rec_bounded RoseS_e *)
simpl.
(* Goal: and (rec_bounded RoseS'_e) (and True (and True (and True True))) *)
intuition.
(* Goal: rec_bounded RoseS'_e *)
apply rec_bounded_RoseS'.
Qed.
Transparent RoseS'_e.
Lemma bs2nat_firstn_false : forall n l,
bs2nat (firstn n (false :: l)) = 2 * bs2nat (firstn (n-1) l).
Proof.
(* Goal: forall (n : nat) (l : list bool), @eq nat (bs2nat (@firstn bool n (@cons bool false l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub n (S O)) l))) *)
intros.
(* Goal: @eq nat (bs2nat (@firstn bool n (@cons bool false l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub n (S O)) l))) *)
destruct n.
(* Goal: @eq nat (bs2nat (@firstn bool (S n) (@cons bool false l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub (S n) (S O)) l))) *)
(* Goal: @eq nat (bs2nat (@firstn bool O (@cons bool false l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub O (S O)) l))) *)
simpl.
(* Goal: @eq nat (bs2nat (@firstn bool (S n) (@cons bool false l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub (S n) (S O)) l))) *)
(* Goal: @eq nat (bs2nat (@nil bool)) (Init.Nat.add (bs2nat (@nil bool)) (Init.Nat.add (bs2nat (@nil bool)) O)) *)
rewrite bs2nat_nil; ring.
(* Goal: @eq nat (bs2nat (@firstn bool (S n) (@cons bool false l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub (S n) (S O)) l))) *)
simpl firstn.
(* Goal: @eq nat (bs2nat (@cons bool false (@firstn bool n l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub n O) l))) *)
rewrite bs2nat_false.
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool n l))) (Init.Nat.mul (S (S O)) (bs2nat (@firstn bool (Init.Nat.sub n O) l))) *)
f_equal.
(* Goal: @eq nat (bs2nat (@firstn bool n l)) (bs2nat (@firstn bool (Init.Nat.sub n O) l)) *)
f_equal.
(* Goal: @eq (list bool) (@firstn bool n l) (@firstn bool (Init.Nat.sub n O) l) *)
f_equal.
(* Goal: @eq nat n (Init.Nat.sub n O) *)
omega.
Qed.
Lemma bs2nat_app : forall l1 l2,
bs2nat (l1 ++ l2) = bs2nat l1 + bs2nat (repeat (length l1) false ++ l2).
Proof.
(* Goal: forall l1 l2 : list bool, @eq nat (bs2nat (@app bool l1 l2)) (Init.Nat.add (bs2nat l1) (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2))) *)
intros.
(* Goal: @eq nat (bs2nat (@app bool l1 l2)) (Init.Nat.add (bs2nat l1) (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2))) *)
induction l1; simpl.
(* Goal: @eq nat (bs2nat (@cons bool a (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool a l1)) (bs2nat (@cons bool false (@app bool (@repeat bool (@length bool l1) false) l2)))) *)
(* Goal: @eq nat (bs2nat l2) (Init.Nat.add (bs2nat (@nil bool)) (bs2nat l2)) *)
rewrite bs2nat_nil; auto.
(* Goal: @eq nat (bs2nat (@cons bool a (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool a l1)) (bs2nat (@cons bool false (@app bool (@repeat bool (@length bool l1) false) l2)))) *)
rewrite bs2nat_false; simpl.
(* Goal: @eq nat (bs2nat (@cons bool a (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool a l1)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
destruct a; simpl.
(* Goal: @eq nat (bs2nat (@cons bool false (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool false l1)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
(* Goal: @eq nat (bs2nat (@cons bool true (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool true l1)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
repeat rewrite bs2nat_true.
(* Goal: @eq nat (bs2nat (@cons bool false (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool false l1)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
(* Goal: @eq nat (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat (@app bool l1 l2)))) (Init.Nat.add (Init.Nat.add (S O) (Init.Nat.mul (S (S O)) (bs2nat l1))) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
rewrite IHl1; simpl.
(* Goal: @eq nat (bs2nat (@cons bool false (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool false l1)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
(* Goal: @eq nat (S (Init.Nat.add (Init.Nat.add (bs2nat l1) (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2))) (Init.Nat.add (Init.Nat.add (bs2nat l1) (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2))) O))) (S (Init.Nat.add (Init.Nat.add (bs2nat l1) (Init.Nat.add (bs2nat l1) O)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O)))) *)
simpl; ring.
(* Goal: @eq nat (bs2nat (@cons bool false (@app bool l1 l2))) (Init.Nat.add (bs2nat (@cons bool false l1)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
repeat rewrite bs2nat_false.
(* Goal: @eq nat (Init.Nat.mul (S (S O)) (bs2nat (@app bool l1 l2))) (Init.Nat.add (Init.Nat.mul (S (S O)) (bs2nat l1)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
rewrite IHl1; simpl.
(* Goal: @eq nat (Init.Nat.add (Init.Nat.add (bs2nat l1) (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2))) (Init.Nat.add (Init.Nat.add (bs2nat l1) (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2))) O)) (Init.Nat.add (Init.Nat.add (bs2nat l1) (Init.Nat.add (bs2nat l1) O)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) (Init.Nat.add (bs2nat (@app bool (@repeat bool (@length bool l1) false) l2)) O))) *)
simpl; ring.
Qed.
Lemma bs2nat_power : forall l n,
bs2nat (repeat n false ++ l) = (power 2 n) * (bs2nat l).
Proof.
(* Goal: forall (l : list bool) (n : nat), @eq nat (bs2nat (@app bool (@repeat bool n false) l)) (Init.Nat.mul (power (S (S O)) n) (bs2nat l)) *)
induction n; simpl; auto.
(* Goal: @eq nat (bs2nat (@cons bool false (@app bool (@repeat bool n false) l))) (Init.Nat.mul (Init.Nat.add (power (S (S O)) n) (Init.Nat.add (power (S (S O)) n) O)) (bs2nat l)) *)
rewrite bs2nat_false; simpl.
(* Goal: @eq nat (Init.Nat.add (bs2nat (@app bool (@repeat bool n false) l)) (Init.Nat.add (bs2nat (@app bool (@repeat bool n false) l)) O)) (Init.Nat.mul (Init.Nat.add (power (S (S O)) n) (Init.Nat.add (power (S (S O)) n) O)) (bs2nat l)) *)
rewrite IHn; ring.
Qed.
Fixpoint RoseS_spec (x y z : bs) :=
match z with
| nil => nil
| _ :: z' =>
if leb (length z) (length x - length y)
then false :: RoseS_spec x y z'
else hd false (skipn (length x - length z) x) :: RoseS_spec x y z'
end.
Lemma RoseS_spec2_false : forall x y z,
length z <= length x - length y ->
bs2nat (RoseS_spec x y z) = 0.
Proof.
(* Goal: forall (x y z : list bool) (_ : le (@length bool z) (Init.Nat.sub (@length bool x) (@length bool y))), @eq nat (bs2nat (RoseS_spec x y z)) O *)
induction z; simpl; intros.
(* Goal: @eq nat (bs2nat (if match Init.Nat.sub (@length bool x) (@length bool y) with | O => false | S m' => Nat.leb (@length bool z) m' end then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
(* Goal: @eq nat (bs2nat (@nil bool)) O *)
rewrite bs2nat_nil; trivial.
(* Goal: @eq nat (bs2nat (if match Init.Nat.sub (@length bool x) (@length bool y) with | O => false | S m' => Nat.leb (@length bool z) m' end then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
case_eq (length x - length y); intros.
(* Goal: @eq nat (bs2nat (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
(* Goal: @eq nat (bs2nat (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
rewrite H0 in H.
(* Goal: @eq nat (bs2nat (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
(* Goal: @eq nat (bs2nat (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
elimtype False; omega.
(* Goal: @eq nat (bs2nat (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
case_eq (leb (length z) n); intros.
(* Goal: @eq nat (bs2nat (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
(* Goal: @eq nat (bs2nat (@cons bool false (RoseS_spec x y z))) O *)
apply leb_complete in H1.
(* Goal: @eq nat (bs2nat (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
(* Goal: @eq nat (bs2nat (@cons bool false (RoseS_spec x y z))) O *)
rewrite bs2nat_false, IHz; auto.
(* Goal: @eq nat (bs2nat (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
(* Goal: le (@length bool z) (Init.Nat.sub (@length bool x) (@length bool y)) *)
omega.
(* Goal: @eq nat (bs2nat (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
apply leb_complete_conv in H1.
(* Goal: @eq nat (bs2nat (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z))) O *)
elimtype False; omega.
Qed.
Lemma skipn_roseS : forall x y z,
bs2nat (skipn (length z) (RoseS_spec x y z)) = 0.
Proof.
(* Goal: forall x y z : list bool, @eq nat (bs2nat (@skipn bool (@length bool z) (RoseS_spec x y z))) O *)
induction z; simpl.
(* Goal: @eq nat (bs2nat match (if match Init.Nat.sub (@length bool x) (@length bool y) with | O => false | S m' => Nat.leb (@length bool z) m' end then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) with | nil => @nil bool | cons a l => @skipn bool (@length bool z) l end) O *)
(* Goal: @eq nat (bs2nat (@nil bool)) O *)
rewrite bs2nat_nil; auto.
(* Goal: @eq nat (bs2nat match (if match Init.Nat.sub (@length bool x) (@length bool y) with | O => false | S m' => Nat.leb (@length bool z) m' end then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) with | nil => @nil bool | cons a l => @skipn bool (@length bool z) l end) O *)
case_eq (length x - length y); intros; auto.
(* Goal: @eq nat (bs2nat match (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) with | nil => @nil bool | cons a l => @skipn bool (@length bool z) l end) O *)
case_eq (leb (length z) n); intros; auto.
Qed.
Lemma RoseS_cons : forall x y z b1 b2,
length z <= length x ->
RoseS_spec (b1 :: x) (b2 :: y) z = RoseS_spec x y z.
Proof.
(* Goal: forall (x y z : list bool) (b1 b2 : bool) (_ : le (@length bool z) (@length bool x)), @eq (list bool) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) (RoseS_spec x y z) *)
induction z; simpl; trivial; intros.
(* Goal: @eq (list bool) (if match Init.Nat.sub (@length bool x) (@length bool y) with | O => false | S m' => Nat.leb (@length bool z) m' end then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if match Init.Nat.sub (@length bool x) (@length bool y) with | O => false | S m' => Nat.leb (@length bool z) m' end then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
case_eq (length x - length y); intros.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq (list bool) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
rewrite IHz;[ | omega ]; clear IHz.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq (list bool) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec x y z)) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
f_equal.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) *)
destruct x; simpl in *.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
(* Goal: @eq bool b1 false *)
elimtype False; omega.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
destruct y; simpl in *.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
discriminate.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
destruct z; simpl.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) (@cons bool b x))) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (@length bool x) (@cons bool b x))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) O) (@cons bool b x))) *)
rewrite <- minus_n_O; trivial.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) (@cons bool b x))) *)
simpl in *.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) (@cons bool b x))) *)
cutrewrite (length x - length z = S (length x - S (length z))).
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq nat (Init.Nat.sub (@length bool x) (@length bool z)) (S (Init.Nat.sub (@length bool x) (S (@length bool z)))) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (S (Init.Nat.sub (@length bool x) (S (@length bool z)))) (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) (@cons bool b x))) *)
simpl; trivial.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq nat (Init.Nat.sub (@length bool x) (@length bool z)) (S (Init.Nat.sub (@length bool x) (S (@length bool z)))) *)
omega.
(* Goal: @eq (list bool) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (if Nat.leb (@length bool z) n then @cons bool false (RoseS_spec x y z) else @cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
case_eq (leb (length z) n); intros.
(* Goal: @eq (list bool) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: @eq (list bool) (@cons bool false (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (@cons bool false (RoseS_spec x y z)) *)
rewrite IHz; auto.
(* Goal: @eq (list bool) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
(* Goal: le (@length bool z) (@length bool x) *)
omega.
(* Goal: @eq (list bool) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec (@cons bool b1 x) (@cons bool b2 y) z)) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
rewrite IHz.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq (list bool) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (RoseS_spec x y z)) (@cons bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) (RoseS_spec x y z)) *)
f_equal.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) *)
apply leb_complete_conv in H1.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 x))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) x)) *)
destruct x; simpl in *.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
(* Goal: @eq bool b1 false *)
discriminate.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
destruct y; simpl in *.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
elimtype False; omega.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool match @length bool z with | O => S (@length bool x) | S l => Init.Nat.sub (@length bool x) l end (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b x))) *)
destruct z; simpl.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) (@cons bool b x))) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (@length bool x) (@cons bool b x))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) O) (@cons bool b x))) *)
rewrite <- minus_n_O; trivial.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (@length bool z)) (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) (@cons bool b x))) *)
cutrewrite (length x - length z = S (length x - S (length z))).
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq nat (Init.Nat.sub (@length bool x) (@length bool z)) (S (Init.Nat.sub (@length bool x) (S (@length bool z)))) *)
(* Goal: @eq bool (@hd bool false (@skipn bool (S (Init.Nat.sub (@length bool x) (S (@length bool z)))) (@cons bool b1 (@cons bool b x)))) (@hd bool false (@skipn bool (Init.Nat.sub (@length bool x) (S (@length bool z))) (@cons bool b x))) *)
simpl; trivial.
(* Goal: le (@length bool z) (@length bool x) *)
(* Goal: @eq nat (Init.Nat.sub (@length bool x) (@length bool z)) (S (Init.Nat.sub (@length bool x) (S (@length bool z)))) *)
simpl in *; omega.
(* Goal: le (@length bool z) (@length bool x) *)
omega.
Qed.
Lemma bs2nat_cons_eq : forall b l1 l2,
bs2nat l1 = bs2nat l2 ->
bs2nat (b :: l1) = bs2nat (b :: l2).
Proof.
(* Goal: forall (b : bool) (l1 l2 : list bool) (_ : @eq nat (bs2nat l1) (bs2nat l2)), @eq nat (bs2nat (@cons bool b l1)) (bs2nat (@cons bool b l2)) *)
intros.
(* Goal: @eq nat (bs2nat (@cons bool b l1)) (bs2nat (@cons bool b l2)) *)
case b.
(* Goal: @eq nat (bs2nat (@cons bool false l1)) (bs2nat (@cons bool false l2)) *)
(* Goal: @eq nat (bs2nat (@cons bool true l1)) (bs2nat (@cons bool true l2)) *)
repeat rewrite bs2nat_true; ring [H].
(* Goal: @eq nat (bs2nat (@cons bool false l1)) (bs2nat (@cons bool false l2)) *)
repeat rewrite bs2nat_false; ring [H].
Qed.
Fixpoint RoseS_spec' (x : bs) (y z : nat) :=
match z with
| 0 => nil
| S z' =>
if leb z (length x - y)
then false :: RoseS_spec' x y z'
else hd false (skipn (length x - z) x) :: RoseS_spec' x y z'
end.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_NChelper.
Require Export GeoCoq.Elements.OriginalProofs.lemma_pointreflectionisometry.
Require Export GeoCoq.Elements.OriginalProofs.lemma_oppositesidesymmetric.
Require Export GeoCoq.Elements.OriginalProofs.proposition_27.
Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelflip.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma proposition_31 :
forall A B C D,
BetS B D C -> nCol B C A ->
exists X Y Z, BetS X A Y /\ CongA Y A D A D B /\ CongA Y A D B D A /\ CongA D A Y B D A /\ CongA X A D A D C /\ CongA X A D C D A /\ CongA D A X C D A /\ Par X Y B C /\ Cong X A D C /\ Cong A Y B D /\ Cong A Z Z D /\ Cong X Z Z C /\ Cong B Z Z Y /\ BetS X Z C /\ BetS B Z Y /\ BetS A Z D.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @BetS Ax0 B D C) (_ : @nCol Ax0 B C A), @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
intros.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col B D C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (~ eq A D).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
(* Goal: not (@eq Ax0 A D) *)
{
(* Goal: not (@eq Ax0 A D) *)
intro.
(* Goal: False *)
assert (Col B A C) by (conclude cn_equalitysub).
(* Goal: False *)
assert (Col B C A) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
let Tf:=fresh in assert (Tf:exists M, (BetS A M D /\ Cong M A M D)) by (conclude proposition_10);destruct Tf as [M];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong A M M D) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col C B D) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col C B B) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol C B A) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq B D) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol B D A) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col B D C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq D D) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col B D D) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq D C) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq C D) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol C D A) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol A D C) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col A M D) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col A D M) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col A D A) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq A M) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol A M C) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (~ eq C M).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
(* Goal: not (@eq Ax0 C M) *)
{
(* Goal: not (@eq Ax0 C M) *)
intro.
(* Goal: False *)
assert (Col A C M) by (conclude_def Col ).
(* Goal: False *)
assert (Col A M C) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq M C) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
let Tf:=fresh in assert (Tf:exists E, (BetS C M E /\ Cong M E M C)) by (conclude lemma_extension);destruct Tf as [E];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong M C M E) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong C M M E) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Midpoint C M E) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq A M) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol A D B) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol A M B) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (~ eq B M).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
(* Goal: not (@eq Ax0 B M) *)
{
(* Goal: not (@eq Ax0 B M) *)
intro.
(* Goal: False *)
assert (Col A B M) by (conclude_def Col ).
(* Goal: False *)
assert (Col A M B) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq M B) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
let Tf:=fresh in assert (Tf:exists F, (BetS B M F /\ Cong M F M B)) by (conclude lemma_extension);destruct Tf as [F];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong M F B M) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong B M M F) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Midpoint B M F) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong M D M A) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (BetS D M A) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong D M M A) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Midpoint D M A) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq B D) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq D C) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq B C) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong B D F A) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong D C A E) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong B C F E) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (BetS F A E) by (conclude lemma_betweennesspreserved).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (BetS E A F) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq F F) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq A F) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Out A F F) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq B B) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq B D) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq D B) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Out D B B) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq A A) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq D A) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Out D A A) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq D D) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq A D) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Out A D D) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol B M A) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col B M F) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq M M) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col B M M) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq M F) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq F M) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol F M A) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol A M F) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col A M A) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col A M D) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol A D F) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol F A D) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong D B A F) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Midpoint A M D) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq B A) by (forward_using lemma_NCdistinct).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong B A F D) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong F D B A) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong A F D B) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong A D D A) by (conclude cn_equalityreverse).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA F A D B D A) by (conclude_def CongA ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol B D A) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA B D A A D B) by (conclude lemma_ABCequalsCBA).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA F A D A D B) by (conclude lemma_equalanglestransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA A D B F A D) by (conclude lemma_equalanglessymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol D A B) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol F A D) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA F A D D A F) by (conclude lemma_ABCequalsCBA).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA A D B D A F) by (conclude lemma_equalanglestransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA D A F A D B) by (conclude lemma_equalanglessymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol A D B) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA A D B B D A) by (conclude lemma_ABCequalsCBA).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA D A F B D A) by (conclude lemma_equalanglestransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (TS B A D F) by (conclude_def TS ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (TS F A D B) by (conclude lemma_oppositesidesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (BetS C D B) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Par F E C B) by (conclude proposition_27).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Par E F B C) by (forward_using lemma_parallelflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong D C E A) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong E A D C) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong B D A F) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong A F B D) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong M C E M) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong E M M C) by (conclude lemma_congruencesymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq E A) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq A E) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq E E) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Out A E E) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq D C) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (eq C C) by (conclude cn_equalityreflexive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Out D C C) by (conclude lemma_ray4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong E M M C) by (forward_using lemma_congruenceflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (BetS E M C) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Midpoint E M C) by (conclude_def Midpoint ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (~ eq E D).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
(* Goal: not (@eq Ax0 E D) *)
{
(* Goal: not (@eq Ax0 E D) *)
intro.
(* Goal: False *)
assert (BetS C M D) by (conclude cn_equalitysub).
(* Goal: False *)
assert (Col C M D) by (conclude_def Col ).
(* Goal: False *)
assert (Col M D C) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col A M D) by (conclude_def Col ).
(* Goal: False *)
assert (Col M D A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq M D) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col D C A) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col D C B) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq D C) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col C A B) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col B C A) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq E D) by auto.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq D A) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (neq A D) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong E D C A) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Cong A E D C) by (conclude lemma_pointreflectionisometry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col E A F) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col F A E) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (Col F A A) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol E A D) by (conclude lemma_NChelper).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA E A D C D A) by (conclude_def CongA ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol C D A) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA C D A A D C) by (conclude lemma_ABCequalsCBA).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA E A D A D C) by (conclude lemma_equalanglestransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (nCol D A E) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA D A E E A D) by (conclude lemma_ABCequalsCBA).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
assert (CongA D A E C D A) by (conclude lemma_equalanglestransitive).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => @ex (@Point Ax0) (fun Z : @Point Ax0 => and (@BetS Ax0 X A Y) (and (@CongA Ax0 Y A D A D B) (and (@CongA Ax0 Y A D B D A) (and (@CongA Ax0 D A Y B D A) (and (@CongA Ax0 X A D A D C) (and (@CongA Ax0 X A D C D A) (and (@CongA Ax0 D A X C D A) (and (@Par Ax0 X Y B C) (and (@Cong Ax0 X A D C) (and (@Cong Ax0 A Y B D) (and (@Cong Ax0 A Z Z D) (and (@Cong Ax0 X Z Z C) (and (@Cong Ax0 B Z Z Y) (and (@BetS Ax0 X Z C) (and (@BetS Ax0 B Z Y) (@BetS Ax0 A Z D)))))))))))))))))) *)
remove_exists;eauto 20.
Qed.
End Euclid.
|
Require Import Arith.
Require Import Test.
Require Import Terms.
Require Import Reduction.
Inductive redexes : Set :=
| Var : nat -> redexes
| Fun : redexes -> redexes
| Ap : bool -> redexes -> redexes -> redexes.
Inductive sub : redexes -> redexes -> Prop :=
| Sub_Var : forall n : nat, sub (Var n) (Var n)
| Sub_Fun : forall U V : redexes, sub U V -> sub (Fun U) (Fun V)
| Sub_Ap1 :
forall U1 V1 : redexes,
sub U1 V1 ->
forall U2 V2 : redexes,
sub U2 V2 -> forall b : bool, sub (Ap false U1 U2) (Ap b V1 V2)
| Sub_Ap2 :
forall U1 V1 : redexes,
sub U1 V1 ->
forall U2 V2 : redexes,
sub U2 V2 -> forall b : bool, sub (Ap true U1 U2) (Ap true V1 V2).
Definition bool_max (b b' : bool) :=
match b return bool with
| true => true
| false => b'
end.
Lemma max_false : forall b : bool, bool_max b false = b.
Proof.
(* Goal: forall b : bool, @eq bool (bool_max b false) b *)
simple induction b; simpl in |- *; trivial.
Qed.
Inductive union : redexes -> redexes -> redexes -> Prop :=
| Union_Var : forall n : nat, union (Var n) (Var n) (Var n)
| Union_Fun :
forall U V W : redexes, union U V W -> union (Fun U) (Fun V) (Fun W)
| Union_Ap :
forall U1 V1 W1 : redexes,
union U1 V1 W1 ->
forall U2 V2 W2 : redexes,
union U2 V2 W2 ->
forall b1 b2 : bool,
union (Ap b1 U1 U2) (Ap b2 V1 V2) (Ap (bool_max b1 b2) W1 W2).
Lemma union_l : forall U V W : redexes, union U V W -> sub U W.
Proof.
(* Goal: forall (U V W : redexes) (_ : union U V W), sub U W *)
simple induction 1; intros.
(* Goal: sub (Ap b1 U1 U2) (Ap (bool_max b1 b2) W1 W2) *)
(* Goal: sub (Fun U0) (Fun W0) *)
(* Goal: sub (Var n) (Var n) *)
apply Sub_Var.
(* Goal: sub (Ap b1 U1 U2) (Ap (bool_max b1 b2) W1 W2) *)
(* Goal: sub (Fun U0) (Fun W0) *)
apply Sub_Fun; trivial.
(* Goal: sub (Ap b1 U1 U2) (Ap (bool_max b1 b2) W1 W2) *)
elim b1.
(* Goal: sub (Ap false U1 U2) (Ap (bool_max false b2) W1 W2) *)
(* Goal: sub (Ap true U1 U2) (Ap (bool_max true b2) W1 W2) *)
elim b2; simpl in |- *; apply Sub_Ap2; trivial.
(* Goal: sub (Ap false U1 U2) (Ap (bool_max false b2) W1 W2) *)
elim b2; simpl in |- *; apply Sub_Ap1; trivial.
Qed.
Lemma union_r : forall U V W : redexes, union U V W -> sub V W.
Proof.
(* Goal: forall (U V W : redexes) (_ : union U V W), sub V W *)
simple induction 1; intros.
(* Goal: sub (Ap b2 V1 V2) (Ap (bool_max b1 b2) W1 W2) *)
(* Goal: sub (Fun V0) (Fun W0) *)
(* Goal: sub (Var n) (Var n) *)
apply Sub_Var.
(* Goal: sub (Ap b2 V1 V2) (Ap (bool_max b1 b2) W1 W2) *)
(* Goal: sub (Fun V0) (Fun W0) *)
apply Sub_Fun; trivial.
(* Goal: sub (Ap b2 V1 V2) (Ap (bool_max b1 b2) W1 W2) *)
elim b2.
(* Goal: sub (Ap false V1 V2) (Ap (bool_max b1 false) W1 W2) *)
(* Goal: sub (Ap true V1 V2) (Ap (bool_max b1 true) W1 W2) *)
elim b1; simpl in |- *; apply Sub_Ap2; trivial.
(* Goal: sub (Ap false V1 V2) (Ap (bool_max b1 false) W1 W2) *)
elim b1; simpl in |- *; apply Sub_Ap1; trivial.
Qed.
Lemma bool_max_Sym : forall b b' : bool, bool_max b b' = bool_max b' b.
Proof.
(* Goal: forall b b' : bool, @eq bool (bool_max b b') (bool_max b' b) *)
simple induction b; simple induction b'; simpl in |- *; trivial.
Qed.
Lemma union_sym : forall U V W : redexes, union U V W -> union V U W.
Proof.
(* Goal: forall (U V W : redexes) (_ : union U V W), union V U W *)
simple induction 1; intros.
(* Goal: union (Ap b2 V1 V2) (Ap b1 U1 U2) (Ap (bool_max b1 b2) W1 W2) *)
(* Goal: union (Fun V0) (Fun U0) (Fun W0) *)
(* Goal: union (Var n) (Var n) (Var n) *)
apply Union_Var; trivial.
(* Goal: union (Ap b2 V1 V2) (Ap b1 U1 U2) (Ap (bool_max b1 b2) W1 W2) *)
(* Goal: union (Fun V0) (Fun U0) (Fun W0) *)
apply Union_Fun; trivial.
(* Goal: union (Ap b2 V1 V2) (Ap b1 U1 U2) (Ap (bool_max b1 b2) W1 W2) *)
rewrite (bool_max_Sym b1 b2); apply Union_Ap; trivial.
Qed.
Inductive comp : redexes -> redexes -> Prop :=
| Comp_Var : forall n : nat, comp (Var n) (Var n)
| Comp_Fun : forall U V : redexes, comp U V -> comp (Fun U) (Fun V)
| Comp_Ap :
forall U1 V1 : redexes,
comp U1 V1 ->
forall U2 V2 : redexes,
comp U2 V2 -> forall b1 b2 : bool, comp (Ap b1 U1 U2) (Ap b2 V1 V2).
Hint Resolve Comp_Var Comp_Fun Comp_Ap.
Lemma comp_refl : forall U : redexes, comp U U.
Proof.
(* Goal: forall U : redexes, comp U U *)
simple induction U; auto.
Qed.
Lemma comp_sym : forall U V : redexes, comp U V -> comp V U.
Proof.
(* Goal: forall (U V : redexes) (_ : comp U V), comp V U *)
simple induction 1; auto.
Qed.
Lemma comp_trans :
forall U V : redexes,
comp U V -> forall (W : redexes) (CVW : comp V W), comp U W.
Proof.
(* Goal: forall (U V : redexes) (_ : comp U V) (W : redexes) (_ : comp V W), comp U W *)
simple induction 1; intros; inversion_clear CVW; auto.
Qed.
Lemma union_defined :
forall U V : redexes, comp U V -> exists W : redexes, union U V W.
Proof.
(* Goal: forall (U V : redexes) (_ : comp U V), @ex redexes (fun W : redexes => union U V W) *)
simple induction 1.
(* Goal: forall (U1 V1 : redexes) (_ : comp U1 V1) (_ : @ex redexes (fun W : redexes => union U1 V1 W)) (U2 V2 : redexes) (_ : comp U2 V2) (_ : @ex redexes (fun W : redexes => union U2 V2 W)) (b1 b2 : bool), @ex redexes (fun W : redexes => union (Ap b1 U1 U2) (Ap b2 V1 V2) W) *)
(* Goal: forall (U V : redexes) (_ : comp U V) (_ : @ex redexes (fun W : redexes => union U V W)), @ex redexes (fun W : redexes => union (Fun U) (Fun V) W) *)
(* Goal: forall n : nat, @ex redexes (fun W : redexes => union (Var n) (Var n) W) *)
intro n; exists (Var n); apply Union_Var.
(* Goal: forall (U1 V1 : redexes) (_ : comp U1 V1) (_ : @ex redexes (fun W : redexes => union U1 V1 W)) (U2 V2 : redexes) (_ : comp U2 V2) (_ : @ex redexes (fun W : redexes => union U2 V2 W)) (b1 b2 : bool), @ex redexes (fun W : redexes => union (Ap b1 U1 U2) (Ap b2 V1 V2) W) *)
(* Goal: forall (U V : redexes) (_ : comp U V) (_ : @ex redexes (fun W : redexes => union U V W)), @ex redexes (fun W : redexes => union (Fun U) (Fun V) W) *)
simple induction 2; intros W0 H2; exists (Fun W0); apply Union_Fun; trivial.
(* Goal: forall (U1 V1 : redexes) (_ : comp U1 V1) (_ : @ex redexes (fun W : redexes => union U1 V1 W)) (U2 V2 : redexes) (_ : comp U2 V2) (_ : @ex redexes (fun W : redexes => union U2 V2 W)) (b1 b2 : bool), @ex redexes (fun W : redexes => union (Ap b1 U1 U2) (Ap b2 V1 V2) W) *)
intros U1 V1 H1 E1 U2 V2 H2 E2; elim E1; elim E2.
(* Goal: forall (x : redexes) (_ : union U2 V2 x) (x0 : redexes) (_ : union U1 V1 x0) (b1 b2 : bool), @ex redexes (fun W : redexes => union (Ap b1 U1 U2) (Ap b2 V1 V2) W) *)
intros W2 A W1 B b1 b2; exists (Ap (bool_max b1 b2) W1 W2).
(* Goal: union (Ap b1 U1 U2) (Ap b2 V1 V2) (Ap (bool_max b1 b2) W1 W2) *)
apply Union_Ap; trivial.
Qed.
Fixpoint regular (U : redexes) : Prop :=
match U with
| Var n => True
| Fun V => regular V
| Ap true (Fun _ as V) W => regular V /\ regular W
| Ap true _ W => False
| Ap false V W => regular V /\ regular W
end.
Lemma union_preserve_regular :
forall U V W : redexes, union U V W -> regular U -> regular V -> regular W.
Proof.
(* Goal: forall (U V W : redexes) (_ : union U V W) (_ : regular U) (_ : regular V), regular W *)
simple induction 1; simpl in |- *; trivial.
(* Goal: forall (U1 V1 W1 : redexes) (_ : union U1 V1 W1) (_ : forall (_ : regular U1) (_ : regular V1), regular W1) (U2 V2 W2 : redexes) (_ : union U2 V2 W2) (_ : forall (_ : regular U2) (_ : regular V2), regular W2) (b1 b2 : bool) (_ : if b1 then match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end else and (regular U1) (regular U2)) (_ : if b2 then match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end else and (regular V1) (regular V2)), if bool_max b1 b2 then match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end else and (regular W1) (regular W2) *)
simple induction b1; simple induction b2; simpl in |- *.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (_ : match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end) (_ : and (regular V1) (regular V2)), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (_ : match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
generalize H1.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (_ : match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end) (_ : and (regular V1) (regular V2)), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (_ : forall (_ : regular U1) (_ : regular V1), regular W1) (_ : match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
elim H0; try contradiction.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (_ : match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end) (_ : and (regular V1) (regular V2)), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (U V W : redexes) (_ : union U V W) (_ : forall (_ : forall (_ : regular U) (_ : regular V), regular W) (_ : match U with | Var n => False | Fun r => and (regular U) (regular U2) | Ap b r r0 => False end) (_ : match V with | Var n => False | Fun r => and (regular V) (regular V2) | Ap b r r0 => False end), match W with | Var n => False | Fun r => and (regular W) (regular W2) | Ap b r r0 => False end) (_ : forall (_ : regular (Fun U)) (_ : regular (Fun V)), regular (Fun W)) (_ : and (regular (Fun U)) (regular U2)) (_ : and (regular (Fun V)) (regular V2)), and (regular (Fun W)) (regular W2) *)
intros; elim H7; elim H8; auto.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (_ : match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end) (_ : and (regular V1) (regular V2)), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
generalize H1.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (_ : forall (_ : regular U1) (_ : regular V1), regular W1) (_ : match U1 with | Var n => False | Fun r => and (regular U1) (regular U2) | Ap b r r0 => False end) (_ : and (regular V1) (regular V2)), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
elim H0; try contradiction.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
(* Goal: forall (U V W : redexes) (_ : union U V W) (_ : forall (_ : forall (_ : regular U) (_ : regular V), regular W) (_ : match U with | Var n => False | Fun r => and (regular U) (regular U2) | Ap b r r0 => False end) (_ : and (regular V) (regular V2)), match W with | Var n => False | Fun r => and (regular W) (regular W2) | Ap b r r0 => False end) (_ : forall (_ : regular (Fun U)) (_ : regular (Fun V)), regular (Fun W)) (_ : and (regular (Fun U)) (regular U2)) (_ : and (regular (Fun V)) (regular V2)), and (regular (Fun W)) (regular W2) *)
intros; elim H7; elim H8; auto.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
simple induction 1.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : regular U1) (_ : regular U2) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
generalize H1.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (_ : forall (_ : regular U1) (_ : regular V1), regular W1) (_ : regular U1) (_ : regular U2) (_ : match V1 with | Var n => False | Fun r => and (regular V1) (regular V2) | Ap b r r0 => False end), match W1 with | Var n => False | Fun r => and (regular W1) (regular W2) | Ap b r r0 => False end *)
elim H0; try contradiction.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
(* Goal: forall (U V W : redexes) (_ : union U V W) (_ : forall (_ : forall (_ : regular U) (_ : regular V), regular W) (_ : regular U) (_ : regular U2) (_ : match V with | Var n => False | Fun r => and (regular V) (regular V2) | Ap b r r0 => False end), match W with | Var n => False | Fun r => and (regular W) (regular W2) | Ap b r r0 => False end) (_ : forall (_ : regular (Fun U)) (_ : regular (Fun V)), regular (Fun W)) (_ : regular (Fun U)) (_ : regular U2) (_ : and (regular (Fun V)) (regular V2)), and (regular (Fun W)) (regular W2) *)
intros; elim H10; auto.
(* Goal: forall (_ : and (regular U1) (regular U2)) (_ : and (regular V1) (regular V2)), and (regular W1) (regular W2) *)
simple induction 1; intros O1 O2; simple induction 1; auto.
Qed.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_30helper.
Require Export GeoCoq.Elements.OriginalProofs.lemma_crossimpliesopposite.
Require Export GeoCoq.Elements.OriginalProofs.proposition_30A.
Section Euclid.
Context `{Ax:euclidean_euclidean}.
Lemma parnotmeet: forall A B C D,
Par A B C D -> ~ Meet A B C D.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @Par Ax0 A B C D), not (@Meet Ax0 A B C D) *)
intros.
(* Goal: not (@Meet Ax0 A B C D) *)
conclude_def Par.
Qed.
Lemma proposition_30 :
forall A B C D E F G H K,
Par A B E F -> Par C D E F -> BetS G H K -> Col A B G -> Col E F H -> Col C D K -> neq A G -> neq E H -> neq C K ->
Par A B C D.
End Euclid.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_3_6a.
Section Euclid.
Context `{Ax:euclidean_neutral}.
Lemma lemma_betweennotequal :
forall A B C,
BetS A B C ->
neq B C /\ neq A B /\ neq A C.
Proof.
(* Goal: forall (A B C : @Point Ax) (_ : @BetS Ax A B C), and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
intros.
(* Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
assert (~ eq B C).
(* Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
(* Goal: not (@eq Ax B C) *)
{
(* Goal: not (@eq Ax B C) *)
intro.
(* Goal: False *)
assert (BetS A C B) by (conclude cn_equalitysub).
(* Goal: False *)
assert (BetS B C B) by (conclude lemma_3_6a).
(* Goal: False *)
assert (~ BetS B C B) by (conclude axiom_betweennessidentity).
(* Goal: False *)
contradict.
(* BG Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
}
(* Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
assert (~ eq A B).
(* Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
(* Goal: not (@eq Ax A B) *)
{
(* Goal: not (@eq Ax A B) *)
intro.
(* Goal: False *)
assert (BetS B A C) by (conclude cn_equalitysub).
(* Goal: False *)
assert (BetS A B A) by (conclude axiom_innertransitivity).
(* Goal: False *)
assert (~ BetS A B A) by (conclude axiom_betweennessidentity).
(* Goal: False *)
contradict.
(* BG Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
}
(* Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
assert (~ eq A C).
(* Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
(* Goal: not (@eq Ax A C) *)
{
(* Goal: not (@eq Ax A C) *)
intro.
(* Goal: False *)
assert (BetS A B A) by (conclude cn_equalitysub).
(* Goal: False *)
assert (~ BetS A B A) by (conclude axiom_betweennessidentity).
(* Goal: False *)
contradict.
(* BG Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
}
(* Goal: and (@neq Ax B C) (and (@neq Ax A B) (@neq Ax A C)) *)
close.
Qed.
End Euclid.
|
Require Import List.
Import ListNotations.
Require Import StructTact.StructTactics.
Require Import StructTact.ListUtil.
Require Import OrderedType.
Require Import OrderedTypeEx.
Set Implicit Arguments.
Fixpoint fin (n : nat) : Type :=
match n with
| 0 => False
| S n' => option (fin n')
end.
Fixpoint fin_eq_dec (n : nat) : forall (a b : fin n), {a = b} + {a <> b}.
Proof.
(* Goal: forall a b : fin n, sumbool (@eq (fin n) a b) (not (@eq (fin n) a b)) *)
refine (match n with | 0 => fun a b : fin 0 => right (match b with end) | S n' => fun a b : fin (S n') => match a, b with | Some a', Some b' => match fin_eq_dec n' a' b' with | left _ _ => left _ | right _ _ => right _ end | Some a', None => right _ | None, Some b' => right _ | None, None => left eq_refl end end); congruence.
Qed.
Fixpoint all_fin (n : nat) : list (fin n) :=
match n with
| 0 => []
| S n' => None :: map (fun x => Some x) (all_fin n')
end.
Lemma all_fin_all :
forall n (x : fin n),
In x (all_fin n).
Proof.
(* Goal: forall (n : nat) (x : fin n), @In (fin n) x (all_fin n) *)
induction n; intros.
(* Goal: @In (fin (S n)) x (all_fin (S n)) *)
(* Goal: @In (fin O) x (all_fin O) *)
-
(* Goal: @In (fin O) x (all_fin O) *)
solve_by_inversion.
(* BG Goal: @In (fin (S n)) x (all_fin (S n)) *)
-
(* Goal: @In (fin (S n)) x (all_fin (S n)) *)
simpl in *.
(* Goal: or (@eq (option (fin n)) (@None (fin n)) x) (@In (option (fin n)) x (@map (fin n) (option (fin n)) (fun x : fin n => @Some (fin n) x) (all_fin n))) *)
destruct x; auto using in_map.
Qed.
Lemma all_fin_NoDup :
forall n, NoDup (all_fin n).
Proof.
(* Goal: forall n : nat, @NoDup (fin n) (all_fin n) *)
induction n; intros; simpl; constructor.
(* Goal: @NoDup (option (fin n)) (@map (fin n) (option (fin n)) (fun x : fin n => @Some (fin n) x) (all_fin n)) *)
(* Goal: not (@In (option (fin n)) (@None (fin n)) (@map (fin n) (option (fin n)) (fun x : fin n => @Some (fin n) x) (all_fin n))) *)
-
(* Goal: not (@In (option (fin n)) (@None (fin n)) (@map (fin n) (option (fin n)) (fun x : fin n => @Some (fin n) x) (all_fin n))) *)
intro.
(* Goal: False *)
apply in_map_iff in H.
(* Goal: False *)
firstorder.
(* Goal: False *)
discriminate.
(* BG Goal: @NoDup (option (fin n)) (@map (fin n) (option (fin n)) (fun x : fin n => @Some (fin n) x) (all_fin n)) *)
-
(* Goal: @NoDup (option (fin n)) (@map (fin n) (option (fin n)) (fun x : fin n => @Some (fin n) x) (all_fin n)) *)
apply NoDup_map_injective; auto.
(* Goal: forall (x y : fin n) (_ : @In (fin n) x (all_fin n)) (_ : @In (fin n) y (all_fin n)) (_ : @eq (option (fin n)) (@Some (fin n) x) (@Some (fin n) y)), @eq (fin n) x y *)
congruence.
Qed.
Fixpoint fin_to_nat {n : nat} : fin n -> nat :=
match n with
| 0 => fun x : fin 0 => match x with end
| S n' => fun x : fin (S n') =>
match x with
| None => 0
| Some y => S (fin_to_nat y)
end
end.
Definition fin_lt {n : nat} (a b : fin n) : Prop := lt (fin_to_nat a) (fin_to_nat b).
Lemma fin_lt_Some_elim :
forall n (a b : fin n),
@fin_lt (S n) (Some a) (Some b) -> fin_lt a b.
Proof.
(* Goal: forall (n : nat) (a b : fin n) (_ : @fin_lt (S n) (@Some (fin n) a) (@Some (fin n) b)), @fin_lt n a b *)
intros.
(* Goal: @fin_lt n a b *)
unfold fin_lt.
(* Goal: lt (@fin_to_nat n a) (@fin_to_nat n b) *)
simpl.
(* Goal: lt (@fin_to_nat n a) (@fin_to_nat n b) *)
intuition.
Qed.
Lemma fin_lt_Some_intro :
forall n (a b : fin n),
fin_lt a b -> @fin_lt (S n) (Some a) (Some b).
Proof.
(* Goal: forall (n : nat) (a b : fin n) (_ : @fin_lt n a b), @fin_lt (S n) (@Some (fin n) a) (@Some (fin n) b) *)
intros.
(* Goal: @fin_lt (S n) (@Some (fin n) a) (@Some (fin n) b) *)
unfold fin_lt.
(* Goal: lt (@fin_to_nat (S n) (@Some (fin n) a)) (@fin_to_nat (S n) (@Some (fin n) b)) *)
simpl.
(* Goal: lt (S (@fin_to_nat n a)) (S (@fin_to_nat n b)) *)
intuition.
Qed.
Lemma None_lt_Some :
forall n (x : fin n),
@fin_lt (S n) None (Some x).
Proof.
(* Goal: forall (n : nat) (x : fin n), @fin_lt (S n) (@None ((fix fin (n0 : nat) : Type := match n0 with | O => False | S n' => option (fin n') end) n)) (@Some (fin n) x) *)
unfold fin_lt.
(* Goal: forall (n : nat) (x : fin n), lt (@fin_to_nat (S n) (@None ((fix fin (n0 : nat) : Type := match n0 with | O => False | S n' => option (fin n') end) n))) (@fin_to_nat (S n) (@Some (fin n) x)) *)
simpl.
(* Goal: forall (n : nat) (x : fin n), lt O (S (@fin_to_nat n x)) *)
auto with *.
Qed.
Lemma fin_lt_trans :
forall n (x y z : fin n),
fin_lt x y -> fin_lt y z -> fin_lt x z.
Proof.
(* Goal: forall (n : nat) (x y z : fin n) (_ : @fin_lt n x y) (_ : @fin_lt n y z), @fin_lt n x z *)
induction n; intros.
(* Goal: @fin_lt (S n) x z *)
(* Goal: @fin_lt O x z *)
-
(* Goal: @fin_lt O x z *)
destruct x.
(* BG Goal: @fin_lt (S n) x z *)
-
(* Goal: @fin_lt (S n) x z *)
destruct x, y, z; simpl in *; repeat match goal with | [ H : fin_lt (Some _) (Some _) |- _ ] => apply fin_lt_Some_elim in H | [ |- fin_lt (Some _) (Some _) ] => apply fin_lt_Some_intro end; eauto using None_lt_Some; solve_by_inversion.
Qed.
Lemma fin_lt_not_eq :
forall n (x y : fin n),
fin_lt x y -> x <> y.
Proof.
(* Goal: forall (n : nat) (x y : fin n) (_ : @fin_lt n x y), not (@eq (fin n) x y) *)
induction n; intros.
(* Goal: not (@eq (fin (S n)) x y) *)
(* Goal: not (@eq (fin O) x y) *)
-
(* Goal: not (@eq (fin O) x y) *)
destruct x.
(* BG Goal: not (@eq (fin (S n)) x y) *)
-
(* Goal: not (@eq (fin (S n)) x y) *)
destruct x, y; repeat match goal with | [ H : fin_lt (Some _) (Some _) |- _ ] => apply fin_lt_Some_elim in H | [ |- fin_lt (Some _) (Some _) ] => apply fin_lt_Some_intro end; try congruence.
(* Goal: not (@eq (fin (S n)) (@None (fin n)) (@None (fin n))) *)
(* Goal: not (@eq (fin (S n)) (@Some (fin n) f) (@Some (fin n) f0)) *)
+
(* Goal: not (@eq (fin (S n)) (@Some (fin n) f) (@Some (fin n) f0)) *)
specialize (IHn f f0).
(* Goal: not (@eq (fin (S n)) (@Some (fin n) f) (@Some (fin n) f0)) *)
concludes.
(* Goal: not (@eq (fin (S n)) (@Some (fin n) f) (@Some (fin n) f0)) *)
congruence.
(* BG Goal: not (@eq (fin (S n)) (@None (fin n)) (@None (fin n))) *)
+
(* Goal: not (@eq (fin (S n)) (@None (fin n)) (@None (fin n))) *)
solve_by_inversion.
Qed.
Fixpoint fin_compare_compat (n : nat) : forall (x y : fin n), Compare fin_lt eq x y :=
match n with
| 0 => fun x y : fin 0 => match x with end
| S n' => fun x y : fin (S n') =>
match x, y with
| Some x', Some y' =>
match fin_compare_compat n' x' y' with
| LT pf => LT (fin_lt_Some_intro pf)
| EQ pf => EQ (f_equal _ pf)
| GT pf => GT (fin_lt_Some_intro pf)
end
| Some x', None => GT (None_lt_Some n' x')
| None, Some y' => LT (None_lt_Some n' y')
| None, None => EQ eq_refl
end
end.
Module Type NatValue.
Parameter n : nat.
End NatValue.
Module fin_OT_compat (Import N : NatValue) <: UsualOrderedType.
Definition t := fin n.
Definition eq := @eq (fin n).
Definition lt := @fin_lt n.
Definition eq_refl := @eq_refl (fin n).
Definition eq_sym := @eq_sym (fin n).
Definition eq_trans := @eq_trans (fin n).
Definition lt_trans := @fin_lt_trans n.
Definition lt_not_eq := @fin_lt_not_eq n.
Definition compare := fin_compare_compat n.
Definition eq_dec := fin_eq_dec n.
End fin_OT_compat.
Require Import Orders.
Lemma fin_lt_irrefl :
forall n, Irreflexive (@fin_lt n).
Proof.
(* Goal: forall n : nat, @Irreflexive (fin n) (@fin_lt n) *)
intros.
(* Goal: @Irreflexive (fin n) (@fin_lt n) *)
unfold Irreflexive, complement, Reflexive, fin_lt.
(* Goal: forall (x : fin n) (_ : lt (@fin_to_nat n x) (@fin_to_nat n x)), False *)
intuition.
Qed.
Lemma fin_lt_strorder :
forall n, StrictOrder (@fin_lt n).
Proof.
(* Goal: forall n : nat, @StrictOrder (fin n) (@fin_lt n) *)
intros.
(* Goal: @StrictOrder (fin n) (@fin_lt n) *)
apply (Build_StrictOrder _ (@fin_lt_irrefl n) (@fin_lt_trans n)).
Qed.
Lemma fin_lt_lt_compat :
forall n, Proper (eq ==> eq ==> iff) (@fin_lt n).
Proof.
(* Goal: forall n : nat, @Proper (forall (_ : fin n) (_ : fin n), Prop) (@respectful (fin n) (forall _ : fin n, Prop) (@eq (fin n)) (@respectful (fin n) Prop (@eq (fin n)) iff)) (@fin_lt n) *)
intros; split; intros; repeat find_rewrite; assumption.
Qed.
Lemma CompSpec_Eq_Some :
forall n' (x' y' : fin n'),
CompSpec eq fin_lt x' y' Eq ->
Some x' = Some y'.
Proof.
(* Goal: forall (n' : nat) (x' y' : fin n') (_ : @CompSpec (fin n') (@eq (fin n')) (@fin_lt n') x' y' Eq), @eq (option (fin n')) (@Some (fin n') x') (@Some (fin n') y') *)
intros.
(* Goal: @eq (option (fin n')) (@Some (fin n') x') (@Some (fin n') y') *)
apply f_equal.
(* Goal: @eq (fin n') x' y' *)
solve_by_inversion.
Qed.
Lemma CompSpec_Lt :
forall n' (x' y' : fin n'),
CompSpec eq fin_lt x' y' Lt ->
fin_lt x' y'.
Proof.
(* Goal: forall (n' : nat) (x' y' : fin n') (_ : @CompSpec (fin n') (@eq (fin n')) (@fin_lt n') x' y' Lt), @fin_lt n' x' y' *)
intros.
(* Goal: @fin_lt n' x' y' *)
solve_by_inversion.
Qed.
Lemma CompSpec_Gt :
forall n' (x' y' : fin n'),
CompSpec eq fin_lt x' y' Gt ->
fin_lt y' x'.
Proof.
(* Goal: forall (n' : nat) (x' y' : fin n') (_ : @CompSpec (fin n') (@eq (fin n')) (@fin_lt n') x' y' Gt), @fin_lt n' y' x' *)
intros.
(* Goal: @fin_lt n' y' x' *)
solve_by_inversion.
Qed.
Fixpoint fin_compare (n : nat) :
forall (x y : fin n), { cmp : comparison | CompSpec eq fin_lt x y cmp } :=
match n with
| 0 => fun x y : fin 0 => match x with end
| S n' => fun x y : fin (S n') =>
match x, y with
| Some x', Some y' =>
match fin_compare n' x' y' with
| exist _ Lt Hc => exist _ Lt (CompLt _ _ (fin_lt_Some_intro (CompSpec_Lt Hc)))
| exist _ Eq Hc => exist _ Eq (CompEq _ _ (CompSpec_Eq_Some Hc))
| exist _ Gt Hc => exist _ Gt (CompGt _ _ (fin_lt_Some_intro (CompSpec_Gt Hc)))
end
| Some x', None => exist _ Gt (CompGt _ _ (None_lt_Some n' x'))
| None, Some y' => exist _ Lt (CompLt _ _ (None_lt_Some n' y'))
| None, None => exist _ Eq (CompEq _ _ eq_refl)
end
end.
Module fin_OT (Import N : NatValue) <: UsualOrderedType.
Definition t := fin n.
Definition eq := @eq (fin n).
Definition eq_equiv := @eq_equivalence (fin n).
Definition lt := @fin_lt n.
Definition lt_strorder := fin_lt_strorder n.
Definition lt_compat := fin_lt_lt_compat n.
Definition compare := fun x y => proj1_sig (fin_compare n x y).
Definition compare_spec := fun x y => proj2_sig (fin_compare n x y).
Definition eq_dec := fin_eq_dec n.
End fin_OT.
Fixpoint fin_of_nat (m n : nat) : fin n + {exists p, m = n + p} :=
match n with
| 0 => inright (ex_intro _ _ eq_refl)
| S n' =>
match m with
| 0 => inleft None
| S m' =>
match fin_of_nat m' n' with
| inleft f => inleft (Some f)
| inright pf =>
inright (match pf with
| ex_intro _ x H => ex_intro _ x (f_equal _ H)
end)
end
end
end.
Lemma fin_of_nat_fin_to_nat :
forall (n : nat) (a : fin n),
fin_of_nat (fin_to_nat a) n = inleft a.
Proof.
(* Goal: forall (n : nat) (a : fin n), @eq (sumor (fin n) (@ex nat (fun p : nat => @eq nat (@fin_to_nat n a) (Nat.add n p)))) (fin_of_nat (@fin_to_nat n a) n) (@inleft (fin n) (@ex nat (fun p : nat => @eq nat (@fin_to_nat n a) (Nat.add n p))) a) *)
induction n; simpl; intuition.
(* Goal: @eq (sumor (option (fin n)) (@ex nat (fun p : nat => @eq nat match a with | Some y => S (@fin_to_nat n y) | None => O end (S (Nat.add n p))))) (fin_of_nat match a with | Some y => S (@fin_to_nat n y) | None => O end (S n)) (@inleft (option (fin n)) (@ex nat (fun p : nat => @eq nat match a with | Some y => S (@fin_to_nat n y) | None => O end (S (Nat.add n p)))) a) *)
destruct a; simpl in *; auto.
(* Goal: @eq (sumor (option (fin n)) (@ex nat (fun p : nat => @eq nat (S (@fin_to_nat n f)) (S (Nat.add n p))))) match fin_of_nat (@fin_to_nat n f) n with | inleft f0 => @inleft (option (fin n)) (@ex nat (fun p : nat => @eq nat (S (@fin_to_nat n f)) (S (Nat.add n p)))) (@Some (fin n) f0) | inright pf => @inright (option (fin n)) (@ex nat (fun p : nat => @eq nat (S (@fin_to_nat n f)) (S (Nat.add n p)))) match pf with | ex_intro _ x H => @ex_intro nat (fun p : nat => @eq nat (S (@fin_to_nat n f)) (S (Nat.add n p))) x (@f_equal nat nat S (@fin_to_nat n f) (Nat.add n x) H) end end (@inleft (option (fin n)) (@ex nat (fun p : nat => @eq nat (S (@fin_to_nat n f)) (S (Nat.add n p)))) (@Some (fin n) f)) *)
now rewrite IHn.
Qed.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrfun ssrbool eqtype ssrnat seq path choice fintype.
From mathcomp
Require Import tuple finfun bigop finset binomial fingroup.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GroupScope.
Section PermDefSection.
Variable T : finType.
Inductive perm_type : predArgType :=
Perm (pval : {ffun T -> T}) & injectiveb pval.
Definition pval p := let: Perm f _ := p in f.
Definition perm_of of phant T := perm_type.
Identity Coercion type_of_perm : perm_of >-> perm_type.
Notation pT := (perm_of (Phant T)).
Canonical perm_subType := Eval hnf in [subType for pval].
Definition perm_eqMixin := Eval hnf in [eqMixin of perm_type by <:].
Canonical perm_eqType := Eval hnf in EqType perm_type perm_eqMixin.
Definition perm_choiceMixin := [choiceMixin of perm_type by <:].
Canonical perm_choiceType := Eval hnf in ChoiceType perm_type perm_choiceMixin.
Definition perm_countMixin := [countMixin of perm_type by <:].
Canonical perm_countType := Eval hnf in CountType perm_type perm_countMixin.
Canonical perm_subCountType := Eval hnf in [subCountType of perm_type].
Definition perm_finMixin := [finMixin of perm_type by <:].
Canonical perm_finType := Eval hnf in FinType perm_type perm_finMixin.
Canonical perm_subFinType := Eval hnf in [subFinType of perm_type].
Canonical perm_for_subType := Eval hnf in [subType of pT].
Canonical perm_for_eqType := Eval hnf in [eqType of pT].
Canonical perm_for_choiceType := Eval hnf in [choiceType of pT].
Canonical perm_for_countType := Eval hnf in [countType of pT].
Canonical perm_for_subCountType := Eval hnf in [subCountType of pT].
Canonical perm_for_finType := Eval hnf in [finType of pT].
Canonical perm_for_subFinType := Eval hnf in [subFinType of pT].
Lemma perm_proof (f : T -> T) : injective f -> injectiveb (finfun f).
Proof.
(* Goal: forall _ : @injective (Finite.sort T) (Finite.sort T) f, is_true (@injectiveb T (Finite.eqType T) (@FunFinfun.fun_of_fin T (Finite.sort T) (@FunFinfun.finfun T (Finite.sort T) f))) *)
by move=> f_inj; apply/injectiveP; apply: eq_inj f_inj _ => x; rewrite ffunE.
Qed.
End PermDefSection.
Notation "{ 'perm' T }" := (perm_of (Phant T))
(at level 0, format "{ 'perm' T }") : type_scope.
Arguments pval _ _%g.
Bind Scope group_scope with perm_type.
Bind Scope group_scope with perm_of.
Notation "''S_' n" := {perm 'I_n}
(at level 8, n at level 2, format "''S_' n").
Local Notation fun_of_perm_def := (fun T (u : perm_type T) => val u : T -> T).
Local Notation perm_def := (fun T f injf => Perm (@perm_proof T f injf)).
Module Type PermDefSig.
Parameter fun_of_perm : forall T, perm_type T -> T -> T.
Parameter perm : forall (T : finType) (f : T -> T), injective f -> {perm T}.
Axiom fun_of_permE : fun_of_perm = fun_of_perm_def.
Axiom permE : perm = perm_def.
End PermDefSig.
Module PermDef : PermDefSig.
Definition fun_of_perm := fun_of_perm_def.
Definition perm := perm_def.
Lemma fun_of_permE : fun_of_perm = fun_of_perm_def. Proof. by []. Qed.
Proof.
(* Goal: @eq (forall (T : Finite.type) (_ : perm_type T) (_ : Finite.sort T), Finite.sort T) fun_of_perm (fun (T : Finite.type) (u : perm_type T) => @FunFinfun.fun_of_fin T (Finite.sort T) (@val (@finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T))) (fun x : @finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T)) => @injectiveb T (Finite.eqType T) (@FunFinfun.fun_of_fin T (Finite.sort T) x)) (perm_subType T) u) : forall _ : Finite.sort T, Finite.sort T) *)
by [].
Qed.
End PermDef.
Notation fun_of_perm := PermDef.fun_of_perm.
Notation "@ 'perm'" := (@PermDef.perm) (at level 10, format "@ 'perm'").
Notation perm := (@PermDef.perm _ _).
Canonical fun_of_perm_unlock := Unlockable PermDef.fun_of_permE.
Canonical perm_unlock := Unlockable PermDef.permE.
Coercion fun_of_perm : perm_type >-> Funclass.
Section Theory.
Variable T : finType.
Implicit Types (x y : T) (s t : {perm T}) (S : {set T}).
Lemma permP s t : s =1 t <-> s = t.
Proof.
(* Goal: iff (@eqfun (Finite.sort T) (Finite.sort T) (@PermDef.fun_of_perm T s) (@PermDef.fun_of_perm T t)) (@eq (@perm_of T (Phant (Finite.sort T))) s t) *)
by split=> [| -> //]; rewrite unlock => eq_sv; apply/val_inj/ffunP.
Qed.
Lemma pvalE s : pval s = s :> (T -> T).
Proof.
(* Goal: @eq (forall _ : Finite.sort T, Finite.sort T) (@FunFinfun.fun_of_fin T (Finite.sort T) (@pval T s)) (@PermDef.fun_of_perm T s) *)
by rewrite [@fun_of_perm]unlock.
Qed.
Lemma permE f f_inj : @perm T f f_inj =1 f.
Proof.
(* Goal: @eq (forall (T : Finite.type) (f : forall _ : Finite.sort T, Finite.sort T) (_ : @injective (Finite.sort T) (Finite.sort T) f), perm_type T) perm (fun (T : Finite.type) (f : forall _ : Finite.sort T, Finite.sort T) (injf : @injective (Finite.sort T) (Finite.sort T) f) => @Perm T (@FunFinfun.finfun T (Finite.sort T) f) (@perm_proof T f injf)) *)
by [].
Qed.
Lemma perm_inj {s} : injective s.
Proof.
(* Goal: @injective (Finite.sort T) (Finite.sort T) (@PermDef.fun_of_perm T s) *)
by rewrite -!pvalE; apply: (injectiveP _ (valP s)).
Qed.
Hint Resolve perm_inj : core.
Lemma perm_onto s : codom s =i predT.
Proof.
(* Goal: @eq_mem (Equality.sort (Finite.eqType T)) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@codom T (Finite.sort T) (@PermDef.fun_of_perm T s))) (@mem (Equality.sort (Finite.eqType T)) (simplPredType (Equality.sort (Finite.eqType T))) (@predT (Equality.sort (Finite.eqType T)))) *)
by apply/subset_cardP; rewrite ?card_codom ?subset_predT.
Qed.
Definition perm_one := perm (@inj_id T).
Lemma perm_invK s : cancel (fun x => iinv (perm_onto s x)) s.
Proof.
(* Goal: @cancel (Finite.sort T) (Finite.sort T) (fun x : Finite.sort T => @iinv T (Finite.eqType T) (@PermDef.fun_of_perm T s) (@sort_of_simpl_pred (Equality.sort (Finite.eqType T)) (pred_of_argType (Equality.sort (Finite.eqType T)))) x (perm_onto s x)) (@PermDef.fun_of_perm T s) *)
by move=> x /=; rewrite f_iinv.
Qed.
Definition perm_inv s := perm (can_inj (perm_invK s)).
Definition perm_mul s t := perm (inj_comp (@perm_inj t) (@perm_inj s)).
Lemma perm_oneP : left_id perm_one perm_mul.
Proof.
(* Goal: @left_id (@perm_of T (Phant (Finite.sort T))) (@perm_of T (Phant (Finite.sort T))) perm_one perm_mul *)
by move=> s; apply/permP => x; rewrite permE /= permE.
Qed.
Lemma perm_invP : left_inverse perm_one perm_inv perm_mul.
Proof.
(* Goal: @left_inverse (@perm_of T (Phant (Finite.sort T))) (@perm_of T (Phant (Finite.sort T))) (@perm_of T (Phant (Finite.sort T))) perm_one perm_inv perm_mul *)
by move=> s; apply/permP=> x; rewrite !permE /= permE f_iinv.
Qed.
Lemma perm_mulP : associative perm_mul.
Proof.
(* Goal: @associative (@perm_of T (Phant (Finite.sort T))) perm_mul *)
by move=> s t u; apply/permP=> x; do !rewrite permE /=.
Qed.
Definition perm_of_baseFinGroupMixin : FinGroup.mixin_of (perm_type T) :=
FinGroup.Mixin perm_mulP perm_oneP perm_invP.
Canonical perm_baseFinGroupType :=
Eval hnf in BaseFinGroupType (perm_type T) perm_of_baseFinGroupMixin.
Canonical perm_finGroupType := @FinGroupType perm_baseFinGroupType perm_invP.
Canonical perm_of_baseFinGroupType :=
Eval hnf in [baseFinGroupType of {perm T}].
Canonical perm_of_finGroupType := Eval hnf in [finGroupType of {perm T} ].
Lemma perm1 x : (1 : {perm T}) x = x.
Proof.
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T (oneg perm_of_baseFinGroupType : @perm_of T (Phant (Finite.sort T))) x) x *)
by rewrite permE.
Qed.
Lemma permM s t x : (s * t) x = t (s x).
Proof.
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T (@mulg perm_of_baseFinGroupType s t) x) (@PermDef.fun_of_perm T t (@PermDef.fun_of_perm T s x)) *)
by rewrite permE.
Qed.
Lemma permK s : cancel s s^-1.
Proof.
(* Goal: @cancel (Finite.sort T) (Finite.sort T) (@PermDef.fun_of_perm T s) (@PermDef.fun_of_perm T (@invg perm_of_baseFinGroupType s)) *)
by move=> x; rewrite -permM mulgV perm1.
Qed.
Lemma permKV s : cancel s^-1 s.
Proof.
(* Goal: @cancel (Finite.sort T) (Finite.sort T) (@PermDef.fun_of_perm T (@invg perm_of_baseFinGroupType s)) (@PermDef.fun_of_perm T s) *)
by have:= permK s^-1; rewrite invgK.
Qed.
Lemma permJ s t x : (s ^ t) (t x) = t (s x).
Proof.
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T (@conjg perm_of_finGroupType s t) (@PermDef.fun_of_perm T t x)) (@PermDef.fun_of_perm T t (@PermDef.fun_of_perm T s x)) *)
by rewrite !permM permK.
Qed.
Lemma permX s x n : (s ^+ n) x = iter n s x.
Proof.
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T (@expgn perm_of_baseFinGroupType s n) x) (@iter (Finite.sort T) n (@PermDef.fun_of_perm T s) x) *)
by elim: n => [|n /= <-]; rewrite ?perm1 // -permM expgSr.
Qed.
Lemma im_permV s S : s^-1 @: S = s @^-1: S.
Proof.
(* Goal: @eq (@set_of T (Phant (Finite.sort T))) (@Imset.imset T T (@PermDef.fun_of_perm T (@invg perm_of_baseFinGroupType s)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) (@preimset T (Finite.sort T) (@PermDef.fun_of_perm T s) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) *)
exact: can2_imset_pre (permKV s) (permK s).
Qed.
Lemma preim_permV s S : s^-1 @^-1: S = s @: S.
Proof.
(* Goal: @eq (@set_of T (Phant (Finite.sort T))) (@preimset T (Finite.sort T) (@PermDef.fun_of_perm T (@invg perm_of_baseFinGroupType s)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) (@Imset.imset T T (@PermDef.fun_of_perm T s) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) *)
by rewrite -im_permV invgK.
Qed.
Definition perm_on S : pred {perm T} := fun s => [pred x | s x != x] \subset S.
Lemma perm_closed S s x : perm_on S s -> (s x \in S) = (x \in S).
Proof.
(* Goal: forall _ : is_true (perm_on S s), @eq bool (@in_mem (Finite.sort T) (@PermDef.fun_of_perm T s x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) *)
move/subsetP=> s_on_S; have [-> // | nfix_s_x] := eqVneq (s x) x.
(* Goal: @eq bool (@in_mem (Finite.sort T) (@PermDef.fun_of_perm T s x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) *)
by rewrite !s_on_S // inE /= ?(inj_eq perm_inj).
Qed.
Lemma perm_on1 H : perm_on H 1.
Proof.
(* Goal: is_true (perm_on H (oneg perm_of_baseFinGroupType)) *)
by apply/subsetP=> x; rewrite inE /= perm1 eqxx.
Qed.
Lemma perm_onM H s t : perm_on H s -> perm_on H t -> perm_on H (s * t).
Proof.
(* Goal: forall (_ : is_true (perm_on H s)) (_ : is_true (perm_on H t)), is_true (perm_on H (@mulg perm_of_baseFinGroupType s t)) *)
move/subsetP=> sH /subsetP tH; apply/subsetP => x; rewrite inE /= permM.
(* Goal: forall _ : is_true (negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T t (@PermDef.fun_of_perm T s x)) x)), is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T H))) *)
by have [-> /tH | /sH] := eqVneq (s x) x.
Qed.
Lemma out_perm S u x : perm_on S u -> x \notin S -> u x = x.
Proof.
(* Goal: forall (_ : is_true (perm_on S u)) (_ : is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))))), @eq (Finite.sort T) (@PermDef.fun_of_perm T u x) x *)
by move=> uS; apply: contraNeq (subsetP uS x).
Qed.
Lemma im_perm_on u S : perm_on S u -> u @: S = S.
Proof.
(* Goal: forall _ : is_true (perm_on S u), @eq (@set_of T (Phant (Finite.sort T))) (@Imset.imset T T (@PermDef.fun_of_perm T u) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) S *)
move=> Su; rewrite -preim_permV; apply/setP=> x.
(* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (@preimset T (Finite.sort T) (@PermDef.fun_of_perm T (@invg perm_of_baseFinGroupType u)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S)))))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T S))) *)
by rewrite !inE -(perm_closed _ Su) permKV.
Qed.
Lemma tperm_proof x y : involutive [fun z => z with x |-> y, y |-> x].
Proof.
(* Goal: @involutive (Finite.sort T) (@fun_of_simpl (Finite.sort T) (Finite.sort T) (@SimplFunDelta (Finite.sort T) (Finite.sort T) (fun z : Finite.sort T => @app_fdelta (Finite.eqType T) (Finite.sort T) (@FunDelta (Finite.eqType T) (Finite.sort T) x y) (@app_fdelta (Finite.eqType T) (Finite.sort T) (@FunDelta (Finite.eqType T) (Finite.sort T) y x) (fun _ : Equality.sort (Finite.eqType T) => z))))) *)
move=> z /=; case: (z =P x) => [-> | ne_zx]; first by rewrite eqxx; case: eqP.
(* Goal: @eq (Finite.sort T) (if @eq_op (Finite.eqType T) (if @eq_op (Finite.eqType T) z y then x else z) x then y else if @eq_op (Finite.eqType T) (if @eq_op (Finite.eqType T) z y then x else z) y then x else if @eq_op (Finite.eqType T) z y then x else z) z *)
by case: (z =P y) => [->| ne_zy]; [rewrite eqxx | do 2?case: eqP].
Qed.
Definition tperm x y := perm (can_inj (tperm_proof x y)).
Variant tperm_spec x y z : T -> Type :=
| TpermFirst of z = x : tperm_spec x y z y
| TpermSecond of z = y : tperm_spec x y z x
| TpermNone of z <> x & z <> y : tperm_spec x y z z.
Lemma tpermP x y z : tperm_spec x y z (tperm x y z).
Proof.
(* Goal: tperm_spec x y z (@PermDef.fun_of_perm T (tperm x y) z) *)
by rewrite permE /=; do 2?[case: eqP => /=]; constructor; auto.
Qed.
Lemma tpermL x y : tperm x y x = y.
Proof.
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T (tperm x y) x) y *)
by case: tpermP.
Qed.
Lemma tpermR x y : tperm x y y = x.
Proof.
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T (tperm x y) y) x *)
by case: tpermP.
Qed.
Lemma tpermD x y z : x != z -> y != z -> tperm x y z = z.
Proof.
(* Goal: forall (_ : is_true (negb (@eq_op (Finite.eqType T) x z))) (_ : is_true (negb (@eq_op (Finite.eqType T) y z))), @eq (Finite.sort T) (@PermDef.fun_of_perm T (tperm x y) z) z *)
by case: tpermP => // ->; rewrite eqxx.
Qed.
Lemma tpermC x y : tperm x y = tperm y x.
Proof.
(* Goal: @eq (@perm_of T (Phant (Finite.sort T))) (tperm x y) (tperm y x) *)
by apply/permP => z; do 2![case: tpermP => //] => ->.
Qed.
Lemma tperm1 x : tperm x x = 1.
Proof.
(* Goal: @eq (@perm_of T (Phant (Finite.sort T))) (tperm x x) (oneg perm_of_baseFinGroupType) *)
by apply/permP => z; rewrite perm1; case: tpermP.
Qed.
Lemma tpermK x y : involutive (tperm x y).
Proof.
(* Goal: @involutive (Finite.sort T) (@PermDef.fun_of_perm T (tperm x y)) *)
by move=> z; rewrite !permE tperm_proof.
Qed.
Lemma tpermKg x y : involutive (mulg (tperm x y)).
Proof.
(* Goal: @involutive (FinGroup.arg_sort perm_of_baseFinGroupType) (@mulg perm_of_baseFinGroupType (tperm x y)) *)
by move=> s; apply/permP=> z; rewrite !permM tpermK.
Qed.
Lemma tpermV x y : (tperm x y)^-1 = tperm x y.
Proof.
(* Goal: @eq (FinGroup.sort perm_of_baseFinGroupType) (@invg perm_of_baseFinGroupType (tperm x y)) (tperm x y) *)
by set t := tperm x y; rewrite -{2}(mulgK t t) -mulgA tpermKg.
Qed.
Lemma tperm2 x y : tperm x y * tperm x y = 1.
Proof.
(* Goal: @eq (FinGroup.sort perm_of_baseFinGroupType) (@mulg perm_of_baseFinGroupType (tperm x y) (tperm x y)) (oneg perm_of_baseFinGroupType) *)
by rewrite -{1}tpermV mulVg.
Qed.
Lemma card_perm A : #|perm_on A| = (#|A|)`!.
Proof.
(* Goal: @eq nat (@card (perm_for_finType T) (@mem (@perm_of T (Phant (Finite.sort T))) (predPredType (@perm_of T (Phant (Finite.sort T)))) (perm_on A))) (factorial (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) *)
pose ffA := {ffun {x | x \in A} -> T}.
(* Goal: @eq nat (@card (perm_for_finType T) (@mem (@perm_of T (Phant (Finite.sort T))) (predPredType (@perm_of T (Phant (Finite.sort T)))) (perm_on A))) (factorial (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) *)
rewrite -ffactnn -{2}(card_sig (mem A)) /= -card_inj_ffuns_on.
(* Goal: @eq nat (@card (perm_for_finType T) (@mem (@perm_of T (Phant (Finite.sort T))) (predPredType (@perm_of T (Phant (Finite.sort T)))) (perm_on A))) (@card (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@mem (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T)) (predPredType (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T))) (@SetDef.pred_of_set (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@SetDef.finset (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (fun f : @finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)) => andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))))))) *)
pose fT (f : ffA) := [ffun x => oapp f x (insub x)].
(* Goal: @eq nat (@card (perm_for_finType T) (@mem (@perm_of T (Phant (Finite.sort T))) (predPredType (@perm_of T (Phant (Finite.sort T)))) (perm_on A))) (@card (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@mem (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T)) (predPredType (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T))) (@SetDef.pred_of_set (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@SetDef.finset (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (fun f : @finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)) => andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))))))) *)
pose pfT f := insubd (1 : {perm T}) (fT f).
(* Goal: @eq nat (@card (perm_for_finType T) (@mem (@perm_of T (Phant (Finite.sort T))) (predPredType (@perm_of T (Phant (Finite.sort T)))) (perm_on A))) (@card (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@mem (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T)) (predPredType (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T))) (@SetDef.pred_of_set (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@SetDef.finset (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (fun f : @finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)) => andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))))))) *)
pose fA s : ffA := [ffun u => s (val u)].
(* Goal: @eq nat (@card (perm_for_finType T) (@mem (@perm_of T (Phant (Finite.sort T))) (predPredType (@perm_of T (Phant (Finite.sort T)))) (perm_on A))) (@card (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@mem (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T)) (predPredType (Finite.sort (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T))) (@SetDef.pred_of_set (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (@SetDef.finset (finfun_of_finType (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) T) (fun f : @finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)) => andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))))))) *)
rewrite -!sum1dep_card -sum1_card (reindex_onto fA pfT) => [|f].
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: @eq nat (@BigOp.bigop nat (Finite.sort (perm_for_finType T)) O (index_enum (perm_for_finType T)) (fun i : Finite.sort (perm_for_finType T) => @BigBody nat (Finite.sort (perm_for_finType T)) i addn (@in_mem (Finite.sort (perm_for_finType T)) i (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) (S O))) (@BigOp.bigop nat (Finite.sort (perm_for_finType T)) O (index_enum (perm_for_finType T)) (fun j : Finite.sort (perm_for_finType T) => @BigBody nat (Finite.sort (perm_for_finType T)) j (@Monoid.operator nat O (@Monoid.com_operator nat O addn_comoid)) (andb (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA j) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA j)))) (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA j)) j)) (S O))) *)
apply: eq_bigl => p; rewrite andbC; apply/idP/and3P=> [onA | []]; first split.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
(* Goal: is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) *)
(* Goal: is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p) *)
-
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
(* Goal: is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) *)
(* Goal: is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p) *)
apply/eqP; suffices fTAp: fT (fA p) = pval p.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
(* Goal: is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) *)
(* Goal: @eq (@finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T))) (fT (fA p)) (@pval T p) *)
(* Goal: @eq (Equality.sort (Finite.eqType (perm_for_finType T))) (pfT (fA p)) p *)
by apply/permP=> x; rewrite -!pvalE insubdK fTAp //; apply: (valP p).
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
(* Goal: is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) *)
(* Goal: @eq (@finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T))) (fT (fA p)) (@pval T p) *)
apply/ffunP=> x; rewrite ffunE pvalE.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
(* Goal: is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) *)
(* Goal: @eq (Finite.sort T) (@Option.apply (Finite.sort (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@FunFinfun.fun_of_fin (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) (Finite.sort T) (fA p)) x (@insub (Finite.sort T) (fun x : Choice.sort (Finite.choiceType T) => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))) (@subFin_sort (Finite.choiceType T) (fun x : Choice.sort (Finite.choiceType T) => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))) (@sig_subFinType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) x)) (@PermDef.fun_of_perm T p x) *)
by case: insubP => [u _ <- | /out_perm->] //=; rewrite ffunE.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
(* Goal: is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) *)
-
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
(* Goal: is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) *)
by apply/forallP=> [[x Ax]]; rewrite ffunE /= perm_closed.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
-
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
(* Goal: is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p))) *)
by apply/injectiveP=> u v; rewrite !ffunE => /perm_inj; apply: val_inj.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall (_ : is_true (@eq_op (Finite.eqType (perm_for_finType T)) (pfT (fA p)) p)) (_ : is_true (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (fA p) (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))))) (_ : is_true (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (fA p)))), is_true (@in_mem (Finite.sort (perm_for_finType T)) p (@mem (Finite.sort (perm_for_finType T)) (predPredType (Finite.sort (perm_for_finType T))) (perm_on A))) *)
move/eqP=> <- _ _; apply/subsetP=> x; rewrite !inE -pvalE val_insubd fun_if.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
(* Goal: forall _ : is_true (negb (@eq_op (Finite.eqType T) ((if @injectiveb T (Finite.eqType T) (@FunFinfun.fun_of_fin T (Finite.sort T) (fT (fA p))) then @FunFinfun.fun_of_fin T (Finite.sort T) (fT (fA p)) else @FunFinfun.fun_of_fin T (Finite.sort T) (@val (@finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T))) (fun x : @finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T)) => @injectiveb T (Finite.eqType T) (@FunFinfun.fun_of_fin T (Finite.sort T) x)) (perm_subType T) (oneg perm_of_baseFinGroupType))) x) x)), is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))) *)
by rewrite if_arg ffunE; case: insubP; rewrite // pvalE perm1 if_same eqxx.
(* Goal: forall _ : is_true (andb (@in_mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) f (@mem (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T))) (simplPredType (@finfun_of (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (Phant (forall _ : Finite.sort (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))), Finite.sort T)))) (@ffun_on_mem (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (@injectiveb (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.eqType T) (@FunFinfun.fun_of_fin (@sig_finType T (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) f))), @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
case/andP=> /forallP-onA /injectiveP-f_inj.
(* Goal: @eq (Finite.sort (finfun_of_finType (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) T)) (fA (pfT f)) f *)
apply/ffunP=> u; rewrite ffunE -pvalE insubdK; first by rewrite ffunE valK.
(* Goal: is_true (@in_mem (@finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T))) (fT f) (@mem (@finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T))) (predPredType (@finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T)))) (fun x : @finfun_of T (Finite.sort T) (Phant (forall _ : Finite.sort T, Finite.sort T)) => @injectiveb T (Finite.eqType T) (@FunFinfun.fun_of_fin T (Finite.sort T) x)))) *)
apply/injectiveP=> {u} x y; rewrite !ffunE.
(* Goal: forall _ : @eq (Equality.sort (Finite.eqType T)) (@Option.apply (Finite.sort (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@FunFinfun.fun_of_fin (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) (Finite.sort T) f) x (@insub (Finite.sort T) (fun x : Choice.sort (Finite.choiceType T) => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))) (@subFin_sort (Finite.choiceType T) (fun x : Choice.sort (Finite.choiceType T) => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))) (@sig_subFinType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) x)) (@Option.apply (Finite.sort (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (Finite.sort T) (@FunFinfun.fun_of_fin (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) (Finite.sort T) f) y (@insub (Finite.sort T) (fun x : Choice.sort (Finite.choiceType T) => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))) (@subFin_sort (Finite.choiceType T) (fun x : Choice.sort (Finite.choiceType T) => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))) (@sig_subFinType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) y)), @eq (Finite.sort T) x y *)
case: insubP => [u _ <-|]; case: insubP => [v _ <-|] //=; first by move/f_inj->.
(* Goal: forall (_ : is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (_ : @eq (Finite.sort T) x (@FunFinfun.fun_of_fin (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) (Finite.sort T) f v)), @eq (Finite.sort T) x (@proj1_sig (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) v) *)
(* Goal: forall (_ : is_true (negb (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (_ : @eq (Finite.sort T) (@FunFinfun.fun_of_fin (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) (Finite.sort T) f u) y), @eq (Finite.sort T) (@proj1_sig (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) u) y *)
by move=> Ay' def_y; rewrite -def_y [_ \in A]onA in Ay'.
(* Goal: forall (_ : is_true (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A))))) (_ : @eq (Finite.sort T) x (@FunFinfun.fun_of_fin (@sig_finType T (fun x : Finite.sort T => @in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) (Finite.sort T) f v)), @eq (Finite.sort T) x (@proj1_sig (Finite.sort T) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T A)))) v) *)
by move=> Ax' def_x; rewrite def_x [_ \in A]onA in Ax'.
Qed.
End Theory.
Prenex Implicits tperm permK permKV tpermK.
Arguments perm_inj {T s} [x1 x2] eq_sx12.
Notation reindex_perm s := (reindex_inj (@perm_inj _ s)).
Lemma inj_tperm (T T' : finType) (f : T -> T') x y z :
injective f -> f (tperm x y z) = tperm (f x) (f y) (f z).
Proof.
(* Goal: forall _ : @injective (Finite.sort T') (Finite.sort T) f, @eq (Finite.sort T') (f (@PermDef.fun_of_perm T (@tperm T x y) z)) (@PermDef.fun_of_perm T' (@tperm T' (f x) (f y)) (f z)) *)
by move=> injf; rewrite !permE /= !(inj_eq injf) !(fun_if f).
Qed.
Lemma tpermJ (T : finType) x y (s : {perm T}) :
(tperm x y) ^ s = tperm (s x) (s y).
Proof.
(* Goal: @eq (FinGroup.sort (FinGroup.base (perm_of_finGroupType T))) (@conjg (perm_of_finGroupType T) (@tperm T x y) s) (@tperm T (@PermDef.fun_of_perm T s x) (@PermDef.fun_of_perm T s y)) *)
by apply/permP => z; rewrite -(permKV s z) permJ; apply/inj_tperm/perm_inj.
Qed.
Lemma tuple_perm_eqP {T : eqType} {n} {s : seq T} {t : n.-tuple T} :
Section PermutationParity.
Variable T : finType.
Implicit Types (s t u v : {perm T}) (x y z a b : T).
Definition aperm x s := s x.
Definition pcycle s x := aperm x @: <[s]>.
Definition pcycles s := pcycle s @: T.
Definition odd_perm (s : perm_type T) := odd #|T| (+) odd #|pcycles s|.
Lemma mem_pcycle s i x : (s ^+ i) x \in pcycle s x.
Proof.
(* Goal: is_true (@in_mem (Finite.sort T) (@PermDef.fun_of_perm T (@expgn (perm_of_baseFinGroupType T) s i) x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s x)))) *)
by rewrite (mem_imset (aperm x)) ?mem_cycle.
Qed.
Lemma pcycle_id s x : x \in pcycle s x.
Proof.
(* Goal: is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s x)))) *)
by rewrite -{1}[x]perm1 (mem_pcycle s 0).
Qed.
Lemma uniq_traject_pcycle s x : uniq (traject s x #|pcycle s x|).
Proof.
(* Goal: is_true (@uniq (Finite.eqType T) (@traject (Finite.sort T) (@PermDef.fun_of_perm T s) x (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s x)))))) *)
case def_n: #|_| => // [n]; rewrite looping_uniq.
(* Goal: is_true (negb (@looping (Finite.eqType T) (@PermDef.fun_of_perm T s) x n)) *)
apply: contraL (card_size (traject s x n)) => /loopingP t_sx.
(* Goal: is_true (negb (leq (@card T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@traject (Finite.sort T) (@PermDef.fun_of_perm T s) x n))) (@size (Finite.sort T) (@traject (Finite.sort T) (@PermDef.fun_of_perm T s) x n)))) *)
rewrite -ltnNge size_traject -def_n ?subset_leq_card //.
(* Goal: is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s x))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_eq_seq (Finite.eqType T) (@traject (Finite.sort T) (@PermDef.fun_of_perm T s) x n)))) *)
by apply/subsetP=> _ /imsetP[_ /cycleP[i ->] ->]; rewrite /aperm permX t_sx.
Qed.
Lemma pcycle_traject s x : pcycle s x =i traject s x #|pcycle s x|.
Lemma iter_pcycle s x : iter #|pcycle s x| s x = x.
Proof.
(* Goal: @eq (Finite.sort T) (@iter (Finite.sort T) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s x)))) (@PermDef.fun_of_perm T s) x) x *)
case def_n: #|_| (uniq_traject_pcycle s x) => [//|n] Ut.
(* Goal: @eq (Finite.sort T) (@iter (Finite.sort T) (S n) (@PermDef.fun_of_perm T s) x) x *)
have: looping s x n.+1.
(* Goal: forall _ : is_true (@looping (Finite.eqType T) (@PermDef.fun_of_perm T s) x (S n)), @eq (Finite.sort T) (@iter (Finite.sort T) (S n) (@PermDef.fun_of_perm T s) x) x *)
(* Goal: is_true (@looping (Finite.eqType T) (@PermDef.fun_of_perm T s) x (S n)) *)
by rewrite -def_n -[looping _ _ _]pcycle_traject -permX mem_pcycle.
(* Goal: forall _ : is_true (@looping (Finite.eqType T) (@PermDef.fun_of_perm T s) x (S n)), @eq (Finite.sort T) (@iter (Finite.sort T) (S n) (@PermDef.fun_of_perm T s) x) x *)
rewrite /looping => /trajectP[[|i] //= lt_i_n /perm_inj eq_i_n_sx].
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T s (@iter (Finite.sort T) n (@PermDef.fun_of_perm T s) x)) x *)
move: lt_i_n; rewrite ltnS ltn_neqAle andbC => /andP[le_i_n /negP[]].
(* Goal: is_true (@eq_op nat_eqType i n) *)
by rewrite -(nth_uniq x _ _ Ut) ?size_traject ?nth_traject // eq_i_n_sx.
Qed.
Lemma eq_pcycle_mem s x y : (pcycle s x == pcycle s y) = (x \in pcycle s y).
Proof.
(* Goal: @eq bool (@eq_op (set_of_eqType T) (pcycle s x) (pcycle s y)) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s y)))) *)
apply/eqP/idP=> [<- | /imsetP[si s_si ->]]; first exact: pcycle_id.
(* Goal: @eq (Equality.sort (set_of_eqType T)) (pcycle s (aperm y si)) (pcycle s y) *)
apply/setP => z; apply/imsetP/imsetP=> [] [sj s_sj ->].
(* Goal: @ex2 (Finite.sort (perm_for_finType T)) (fun x : Finite.sort (perm_for_finType T) => is_true (@in_mem (Finite.sort (perm_for_finType T)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T))) (@cycle (perm_of_finGroupType T) s))))) (fun x : Finite.sort (perm_for_finType T) => @eq (Finite.sort T) (aperm y sj) (aperm (aperm y si) x)) *)
(* Goal: @ex2 (Finite.sort (perm_for_finType T)) (fun x : Finite.sort (perm_for_finType T) => is_true (@in_mem (Finite.sort (perm_for_finType T)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T))) (@cycle (perm_of_finGroupType T) s))))) (fun x : Finite.sort (perm_for_finType T) => @eq (Finite.sort T) (aperm (aperm y si) sj) (aperm y x)) *)
by exists (si * sj); rewrite ?groupM /aperm ?permM.
(* Goal: @ex2 (Finite.sort (perm_for_finType T)) (fun x : Finite.sort (perm_for_finType T) => is_true (@in_mem (Finite.sort (perm_for_finType T)) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (perm_of_finGroupType T))) (@cycle (perm_of_finGroupType T) s))))) (fun x : Finite.sort (perm_for_finType T) => @eq (Finite.sort T) (aperm y sj) (aperm (aperm y si) x)) *)
exists (si^-1 * sj); first by rewrite groupM ?groupV.
(* Goal: @eq (Finite.sort T) (aperm y sj) (aperm (aperm y si) (@mulg (perm_of_baseFinGroupType T) (@invg (perm_of_baseFinGroupType T) si) sj)) *)
by rewrite /aperm permM permK.
Qed.
Lemma pcycle_sym s x y : (x \in pcycle s y) = (y \in pcycle s x).
Proof.
(* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s y)))) (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s x)))) *)
by rewrite -!eq_pcycle_mem eq_sym.
Qed.
Lemma pcycle_perm s i x : pcycle s ((s ^+ i) x) = pcycle s x.
Proof.
(* Goal: @eq (@set_of T (Phant (Finite.sort T))) (pcycle s (@PermDef.fun_of_perm T (@expgn (perm_of_baseFinGroupType T) s i) x)) (pcycle s x) *)
by apply/eqP; rewrite eq_pcycle_mem mem_pcycle.
Qed.
Lemma ncycles_mul_tperm s x y : let t := tperm x y in
#|pcycles (t * s)| + (x \notin pcycle s y).*2 = #|pcycles s| + (x != y).
Lemma odd_perm1 : odd_perm 1 = false.
Proof.
(* Goal: @eq bool (odd_perm (oneg (perm_baseFinGroupType T))) false *)
rewrite /odd_perm card_imset ?addbb // => x y; move/eqP.
(* Goal: forall _ : is_true (@eq_op (Finite.eqType (set_of_finType T)) (pcycle (oneg (perm_baseFinGroupType T)) x) (pcycle (oneg (perm_baseFinGroupType T)) y)), @eq (Finite.sort T) x y *)
by rewrite eq_pcycle_mem /pcycle cycle1 imset_set1 /aperm perm1; move/set1P.
Qed.
Lemma odd_mul_tperm x y s : odd_perm (tperm x y * s) = (x != y) (+) odd_perm s.
Proof.
(* Goal: @eq bool (odd_perm (@mulg (perm_of_baseFinGroupType T) (@tperm T x y) s)) (addb (negb (@eq_op (Finite.eqType T) x y)) (odd_perm s)) *)
rewrite addbC -addbA -[~~ _]oddb -odd_add -ncycles_mul_tperm.
(* Goal: @eq bool (odd_perm (@mulg (perm_of_baseFinGroupType T) (@tperm T x y) s)) (addb (odd (@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))))))) (odd (addn (@card (set_of_finType T) (@mem (Finite.sort (set_of_finType T)) (predPredType (Finite.sort (set_of_finType T))) (@SetDef.pred_of_set (set_of_finType T) (pcycles (@mulg (perm_of_baseFinGroupType T) (@tperm T x y) s))))) (double (nat_of_bool (negb (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@SetDef.pred_of_set T (pcycle s y)))))))))) *)
by rewrite odd_add odd_double addbF.
Qed.
Lemma odd_tperm x y : odd_perm (tperm x y) = (x != y).
Proof.
(* Goal: @eq bool (odd_perm (@tperm T x y)) (negb (@eq_op (Finite.eqType T) x y)) *)
by rewrite -[_ y]mulg1 odd_mul_tperm odd_perm1 addbF.
Qed.
Definition dpair (eT : eqType) := [pred t | t.1 != t.2 :> eT].
Arguments dpair {eT}.
Lemma prod_tpermP s :
{ts : seq (T * T) | s = \prod_(t <- ts) tperm t.1 t.2 & all dpair ts}.
Proof.
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
elim: {s}_.+1 {-2}s (ltnSn #|[pred x | s x != x]|) => // n IHn s.
(* Goal: forall _ : is_true (leq (S (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@SimplPred (Finite.sort T) (fun x : Finite.sort T => negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s x) x)))))) (S n)), @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
rewrite ltnS => le_s_n; case: (pickP (fun x => s x != x)) => [x s_x | s_id].
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
have [|ts def_s ne_ts] := IHn (tperm x (s^-1 x) * s).
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: is_true (leq (S (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@SimplPred (Finite.sort T) (fun x0 : Finite.sort T => negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T (@mulg (perm_of_baseFinGroupType T) (@tperm T x (@PermDef.fun_of_perm T (@invg (perm_of_baseFinGroupType T) s) x)) s) x0) x0)))))) n) *)
rewrite (cardD1 x) !inE s_x in le_s_n; apply: leq_ltn_trans le_s_n.
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: is_true (leq (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@SimplPred (Finite.sort T) (fun x0 : Finite.sort T => negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T (@mulg (perm_of_baseFinGroupType T) (@tperm T x (@PermDef.fun_of_perm T (@invg (perm_of_baseFinGroupType T) s) x)) s) x0) x0))))) (@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)) (@pred_of_simpl (Finite.sort T) (@SimplPred (Finite.sort T) (fun x : Finite.sort T => negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s x) x))))))) x)))) *)
apply: subset_leq_card; apply/subsetP=> y.
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: forall _ : is_true (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@SimplPred (Finite.sort T) (fun x0 : Finite.sort T => negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T (@mulg (perm_of_baseFinGroupType T) (@tperm T x (@PermDef.fun_of_perm T (@invg (perm_of_baseFinGroupType T) s) x)) s) x0) x0)))))), is_true (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (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)) (@pred_of_simpl (Finite.sort T) (@SimplPred (Finite.sort T) (fun x : Finite.sort T => negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s x) x))))))) x)))) *)
rewrite !inE permM permE /= -(canF_eq (permK _)).
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: forall _ : is_true (negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s (if @eq_op (Finite.eqType T) y x then @PermDef.fun_of_perm T (@invg (perm_of_baseFinGroupType T) s) x else if @eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s y) x then x else y)) y)), is_true (andb (negb (@eq_op (Finite.eqType T) y x)) (negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s y) y))) *)
have [-> | ne_yx] := altP (y =P x); first by rewrite permKV eqxx.
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: forall _ : is_true (negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s (if @eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s y) x then x else y)) y)), is_true (andb (negb false) (negb (@eq_op (Finite.eqType T) (@PermDef.fun_of_perm T s y) y))) *)
by case: (s y =P x) => // -> _; rewrite eq_sym.
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
exists ((x, s^-1 x) :: ts); last by rewrite /= -(canF_eq (permK _)) s_x.
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
(* Goal: @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) (@cons (prod (Finite.sort T) (Finite.sort T)) (@pair (Finite.sort T) (Finite.sort T) x (@PermDef.fun_of_perm T (@invg (perm_of_baseFinGroupType T) s) x)) ts) (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t)))) *)
by rewrite big_cons -def_s mulgA tperm2 mul1g.
(* Goal: @sig2 (list (prod (Finite.sort T) (Finite.sort T))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => @eq (@perm_of T (Phant (Finite.sort T))) s (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (fun ts : list (prod (Finite.sort T) (Finite.sort T)) => is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts)) *)
exists nil; rewrite // big_nil; apply/permP=> x.
(* Goal: @eq (Finite.sort T) (@PermDef.fun_of_perm T s x) (@PermDef.fun_of_perm T (oneg (perm_of_baseFinGroupType T)) x) *)
by apply/eqP/idPn; rewrite perm1 s_id.
Qed.
Lemma odd_perm_prod ts :
all dpair ts -> odd_perm (\prod_(t <- ts) tperm t.1 t.2) = odd (size ts).
Proof.
(* Goal: forall _ : is_true (@all (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@pred_of_simpl (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (@dpair (Finite.eqType T))) ts), @eq bool (odd_perm (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) (oneg (perm_of_baseFinGroupType T)) ts (fun t : prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T)) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T)) t) (@snd (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T)) t))))) (odd (@size (prod (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T))) ts)) *)
elim: ts => [_|t ts IHts] /=; first by rewrite big_nil odd_perm1.
(* Goal: forall _ : is_true (andb (negb (@eq_op (Finite.eqType T) (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))) (@all (prod (Finite.sort T) (Finite.sort T)) (@pred_of_simpl (prod (Finite.sort T) (Finite.sort T)) (@dpair (Finite.eqType T))) ts)), @eq bool (odd_perm (@BigOp.bigop (@perm_of T (Phant (Finite.sort T))) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) (@cons (prod (Finite.sort T) (Finite.sort T)) t ts) (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (@perm_of T (Phant (Finite.sort T))) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (negb (odd (@size (prod (Finite.sort T) (Finite.sort T)) ts))) *)
by case/andP=> dt12 dts; rewrite big_cons odd_mul_tperm dt12 IHts.
Qed.
Lemma odd_permM : {morph odd_perm : s1 s2 / s1 * s2 >-> s1 (+) s2}.
Proof.
(* Goal: @morphism_2 (perm_type T) bool odd_perm (fun s1 s2 : perm_type T => @mulg (perm_baseFinGroupType T) s1 s2) (fun s1 s2 : bool => addb s1 s2) *)
move=> s1 s2; case: (prod_tpermP s1) => ts1 ->{s1} dts1.
(* Goal: @eq bool (odd_perm (@mulg (perm_baseFinGroupType T) (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts1 (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t)))) s2)) (addb (odd_perm (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts1 (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (odd_perm s2)) *)
case: (prod_tpermP s2) => ts2 ->{s2} dts2.
(* Goal: @eq bool (odd_perm (@mulg (perm_baseFinGroupType T) (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts1 (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t)))) (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts2 (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t)))))) (addb (odd_perm (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts1 (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t))))) (odd_perm (@BigOp.bigop (FinGroup.sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) (oneg (perm_of_baseFinGroupType T)) ts2 (fun t : prod (Finite.sort T) (Finite.sort T) => @BigBody (FinGroup.arg_sort (perm_of_baseFinGroupType T)) (prod (Finite.sort T) (Finite.sort T)) t (@mulg (perm_of_baseFinGroupType T)) true (@tperm T (@fst (Finite.sort T) (Finite.sort T) t) (@snd (Finite.sort T) (Finite.sort T) t)))))) *)
by rewrite -big_cat !odd_perm_prod ?all_cat ?dts1 // size_cat odd_add.
Qed.
Lemma odd_permV s : odd_perm s^-1 = odd_perm s.
Proof.
(* Goal: @eq bool (odd_perm (@invg (perm_of_baseFinGroupType T) s)) (odd_perm s) *)
by rewrite -{2}(mulgK s s) !odd_permM -addbA addKb.
Qed.
Lemma odd_permJ s1 s2 : odd_perm (s1 ^ s2) = odd_perm s1.
Proof.
(* Goal: @eq bool (odd_perm (@conjg (perm_of_finGroupType T) s1 s2)) (odd_perm s1) *)
by rewrite !odd_permM odd_permV addbC addbK.
Qed.
End PermutationParity.
Coercion odd_perm : perm_type >-> bool.
Arguments dpair {eT}.
Prenex Implicits pcycle dpair pcycles aperm.
Section LiftPerm.
Variable n : nat.
Implicit Types i j : 'I_n.+1.
Implicit Types s t : 'S_n.
Definition lift_perm_fun i j s k :=
if unlift i k is Some k' then lift j (s k') else j.
Lemma lift_permK i j s :
cancel (lift_perm_fun i j s) (lift_perm_fun j i s^-1).
Proof.
(* Goal: @cancel (ordinal (S n)) (ordinal (S n)) (lift_perm_fun i j s) (lift_perm_fun j i (@invg (perm_of_baseFinGroupType (ordinal_finType n)) s)) *)
rewrite /lift_perm_fun => k.
(* Goal: @eq (ordinal (S n)) match @unlift (S n) j match @unlift (S n) i k with | Some k' => @lift (S n) j (@PermDef.fun_of_perm (ordinal_finType n) s k') | None => j end with | Some k' => @lift (S n) i (@PermDef.fun_of_perm (ordinal_finType n) (@invg (perm_of_baseFinGroupType (ordinal_finType n)) s) k') | None => i end k *)
by case: (unliftP i k) => [j'|] ->; rewrite (liftK, unlift_none) ?permK.
Qed.
Definition lift_perm i j s := perm (can_inj (lift_permK i j s)).
Lemma lift_perm_id i j s : lift_perm i j s i = j.
Proof.
(* Goal: @eq (Finite.sort (ordinal_finType (S n))) (@PermDef.fun_of_perm (ordinal_finType (S n)) (lift_perm i j s) i) j *)
by rewrite permE /lift_perm_fun unlift_none.
Qed.
Lemma lift_perm_lift i j s k' :
lift_perm i j s (lift i k') = lift j (s k') :> 'I_n.+1.
Proof.
(* Goal: @eq (ordinal (S n)) (@PermDef.fun_of_perm (ordinal_finType (S n)) (lift_perm i j s) (@lift (S n) i k')) (@lift (S n) j (@PermDef.fun_of_perm (ordinal_finType n) s k')) *)
by rewrite permE /lift_perm_fun liftK.
Qed.
Lemma lift_permM i j k s t :
lift_perm i j s * lift_perm j k t = lift_perm i k (s * t).
Proof.
(* Goal: @eq (FinGroup.sort (perm_of_baseFinGroupType (ordinal_finType (S n)))) (@mulg (perm_of_baseFinGroupType (ordinal_finType (S n))) (lift_perm i j s) (lift_perm j k t)) (lift_perm i k (@mulg (perm_of_baseFinGroupType (ordinal_finType n)) s t)) *)
apply/permP=> i1; case: (unliftP i i1) => [i2|] ->{i1}.
(* Goal: @eq (Finite.sort (ordinal_finType (S n))) (@PermDef.fun_of_perm (ordinal_finType (S n)) (@mulg (perm_of_baseFinGroupType (ordinal_finType (S n))) (lift_perm i j s) (lift_perm j k t)) i) (@PermDef.fun_of_perm (ordinal_finType (S n)) (lift_perm i k (@mulg (perm_of_baseFinGroupType (ordinal_finType n)) s t)) i) *)
(* Goal: @eq (Finite.sort (ordinal_finType (S n))) (@PermDef.fun_of_perm (ordinal_finType (S n)) (@mulg (perm_of_baseFinGroupType (ordinal_finType (S n))) (lift_perm i j s) (lift_perm j k t)) (@lift (S n) i i2)) (@PermDef.fun_of_perm (ordinal_finType (S n)) (lift_perm i k (@mulg (perm_of_baseFinGroupType (ordinal_finType n)) s t)) (@lift (S n) i i2)) *)
by rewrite !(permM, lift_perm_lift).
(* Goal: @eq (Finite.sort (ordinal_finType (S n))) (@PermDef.fun_of_perm (ordinal_finType (S n)) (@mulg (perm_of_baseFinGroupType (ordinal_finType (S n))) (lift_perm i j s) (lift_perm j k t)) i) (@PermDef.fun_of_perm (ordinal_finType (S n)) (lift_perm i k (@mulg (perm_of_baseFinGroupType (ordinal_finType n)) s t)) i) *)
by rewrite permM !lift_perm_id.
Qed.
Lemma lift_perm1 i : lift_perm i i 1 = 1.
Proof.
(* Goal: @eq (@perm_of (ordinal_finType (S n)) (Phant (Finite.sort (ordinal_finType (S n))))) (lift_perm i i (oneg (perm_of_baseFinGroupType (ordinal_finType n)))) (oneg (perm_of_baseFinGroupType (ordinal_finType (S n)))) *)
by apply: (mulgI (lift_perm i i 1)); rewrite lift_permM !mulg1.
Qed.
Lemma lift_permV i j s : (lift_perm i j s)^-1 = lift_perm j i s^-1.
Proof.
(* Goal: @eq (FinGroup.sort (perm_of_baseFinGroupType (ordinal_finType (S n)))) (@invg (perm_of_baseFinGroupType (ordinal_finType (S n))) (lift_perm i j s)) (lift_perm j i (@invg (perm_of_baseFinGroupType (ordinal_finType n)) s)) *)
by apply/eqP; rewrite eq_invg_mul lift_permM mulgV lift_perm1.
Qed.
Lemma odd_lift_perm i j s : lift_perm i j s = odd i (+) odd j (+) s :> bool.
End LiftPerm.
Prenex Implicits lift_perm lift_permK.
|
Require Export GeoCoq.Tarski_dev.Ch07_midpoint.
Require Export GeoCoq.Tactics.Coinc.ColR.
Ltac not_exist_hyp_perm_ncol 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_diffs_by_cases :=
repeat match goal with
| A: Tpoint, B: Tpoint |- _ => not_exist_hyp_comm A B;induction (eq_dec_points A B);[treat_equalities;solve [finish|trivial] |idtac]
end.
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)
| H:Midpoint ?X1 ?X2 ?X3 |- _ =>
not_exist_hyp_perm_col X1 X2 X3;let N := fresh in assert (N := midpoint_col X2 X1 X3 H)
| H:Out ?X1 ?X2 ?X3 |- _ =>
not_exist_hyp_perm_col X1 X2 X3;let N := fresh in assert (N := out_col X1 X2 X3 H)
end.
Ltac assert_bets :=
repeat
match goal with
| H:Midpoint ?B ?A ?C |- _ => let T := fresh in not_exist_hyp (Bet A B C); assert (T := midpoint_bet A B C H)
end.
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:(?A<>?B), H2 : (?B<>?A) |- _ => 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: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: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:(Midpoint ?X1 ?X1 ?X1) |- _ => clear H
end.
Ltac clean := clean_trivial_hyps;clean_reap_hyps.
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;clean_reap_hyps
| H:(Cong ?X1 ?X2 ?X3 ?X3) |- _ =>
apply cong_identity in H;smart_subst X2;clean_reap_hyps
| H:(Bet ?X1 ?X2 ?X1) |- _ =>
apply between_identity in H;smart_subst X2;clean_reap_hyps
| H:(Midpoint ?X ?Y ?Y) |- _ => apply l7_3 in H; smart_subst Y;clean_reap_hyps
| H : Bet ?A ?B ?C, H2 : Bet ?B ?A ?C |- _ =>
let T := fresh in not_exist_hyp (A=B); assert (T : A=B) by (apply (between_equality A B C); finish);
smart_subst A;clean_reap_hyps
| H : Bet ?A ?B ?C, H2 : Bet ?A ?C ?B |- _ =>
let T := fresh in not_exist_hyp (B=C); assert (T : B=C) by (apply (between_equality_2 A B C); finish);
smart_subst B;clean_reap_hyps
| H : Bet ?A ?B ?C, H2 : Bet ?C ?A ?B |- _ =>
let T := fresh in not_exist_hyp (A=B); assert (T : A=B) by (apply (between_equality A B C); finish);
smart_subst A;clean_reap_hyps
| H : Bet ?A ?B ?C, H2 : Bet ?B ?C ?A |- _ =>
let T := fresh in not_exist_hyp (B=C); assert (T : B=C) by (apply (between_equality_2 A B C); finish);
smart_subst A;clean_reap_hyps
| H:(Le ?X1 ?X2 ?X3 ?X3) |- _ =>
apply le_zero in H;smart_subst X2;clean_reap_hyps
| H : Midpoint ?P ?A ?P1, H2 : Midpoint ?P ?A ?P2 |- _ =>
let T := fresh in not_exist_hyp (P1=P2);
assert (T := symmetric_point_uniqueness A P P1 P2 H H2);
smart_subst P1;clean_reap_hyps
| H : Midpoint ?A ?P ?X, H2 : Midpoint ?A ?Q ?X |- _ =>
let T := fresh in not_exist_hyp (P=Q); assert (T := l7_9 P Q A X H H2);
smart_subst P;clean_reap_hyps
| H : Midpoint ?A ?P ?X, H2 : Midpoint ?A ?X ?Q |- _ =>
let T := fresh in not_exist_hyp (P=Q); assert (T := l7_9_bis P Q A X H H2);
smart_subst P;clean_reap_hyps
| H : Midpoint ?M ?A ?A |- _ =>
let T := fresh in not_exist_hyp (M=A); assert (T : l7_3 M A H);
smart_subst M;clean_reap_hyps
| H : Midpoint ?A ?P ?P', H2 : Midpoint ?B ?P ?P' |- _ =>
let T := fresh in not_exist_hyp (A=B); assert (T := l7_17 P P' A B H H2);
smart_subst A;clean_reap_hyps
| H : Midpoint ?A ?P ?P', H2 : Midpoint ?B ?P' ?P |- _ =>
let T := fresh in not_exist_hyp (A=B); assert (T := l7_17_bis P P' A B H H2);
smart_subst A;clean_reap_hyps
| H : Midpoint ?A ?B ?A |- _ =>
let T := fresh in not_exist_hyp (A=B); assert (T := is_midpoint_id_2 A B H);
smart_subst A;clean_reap_hyps
| H : Midpoint ?A ?A ?B |- _ =>
let T := fresh in not_exist_hyp (A=B); assert (T := is_midpoint_id A B H);
smart_subst A;clean_reap_hyps
end.
Ltac ColR :=
let tpoint := constr:(Tpoint) in
let col := constr:(Col) in
treat_equalities; assert_cols; assert_diffs; try (solve [Col]); Col_refl tpoint col.
Ltac search_contradiction :=
match goal with
| H: ?A <> ?A |- _ => exfalso;apply H;reflexivity
| H: ~ Col ?A ?B ?C |- _ => exfalso;apply H;ColR
| H: ~ ?P, H2 : ?P |- _ => exfalso;apply (H H2)
end.
Ltac show_distinct' X Y :=
assert (X<>Y);
[intro;treat_equalities; (solve [search_contradiction])|idtac].
Ltac assert_all_diffs_by_contradiction :=
repeat match goal with
| A: Tpoint, B: Tpoint |- _ => not_exist_hyp_comm A B;show_distinct' A B
end.
Section T8_1.
Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.
Lemma per_dec : forall A B C, Per A B C \/ ~ Per A B C.
Proof.
(* Goal: forall A B C : @Tpoint Tn, or (@Per Tn A B C) (not (@Per Tn A B C)) *)
intros.
(* Goal: or (@Per Tn A B C) (not (@Per Tn A B C)) *)
unfold Per.
(* Goal: or (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')))) *)
elim (symmetric_point_construction C B);intros C' HC'.
(* Goal: or (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')))) *)
elim (cong_dec A C A C');intro.
(* Goal: or (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')))) *)
(* Goal: or (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')))) *)
left.
(* Goal: or (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')))) *)
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')) *)
exists C'.
(* Goal: or (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')))) *)
(* Goal: and (@Midpoint Tn B C C') (@Cong Tn A C A C') *)
intuition.
(* Goal: or (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C')))) *)
right.
(* Goal: not (@ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) *)
intro.
(* Goal: False *)
decompose [ex and] H0;clear H0.
(* Goal: False *)
assert (C'=x) by (apply symmetric_point_uniqueness with C B;assumption).
(* Goal: False *)
subst.
(* Goal: False *)
intuition.
Qed.
Lemma l8_2 : forall A B C, Per A B C -> Per C B A.
End T8_1.
Hint Resolve l8_2 : perp.
Ltac Perp := auto with perp.
Section T8_2.
Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.
Lemma Per_cases :
forall A B C,
Per A B C \/ Per C B A ->
Per A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : or (@Per Tn A B C) (@Per Tn C B A)), @Per Tn A B C *)
intros.
(* Goal: @Per Tn A B C *)
decompose [or] H;Perp.
Qed.
Lemma Per_perm :
forall A B C,
Per A B C ->
Per A B C /\ Per C B A.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Per Tn A B C), and (@Per Tn A B C) (@Per Tn C B A) *)
intros.
(* Goal: and (@Per Tn A B C) (@Per Tn C B A) *)
split; Perp.
Qed.
Lemma l8_3 : forall A B C A',
Per A B C -> A<>B -> Col B A A' -> Per A' B C.
Proof.
(* Goal: forall (A B C A' : @Tpoint Tn) (_ : @Per Tn A B C) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Col Tn B A A'), @Per Tn A' B C *)
unfold Per.
(* Goal: forall (A B C A' : @Tpoint Tn) (_ : @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Col Tn B A A'), @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A' C A' C')) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A' C A' C')) *)
ex_and H C'.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A' C A' C')) *)
exists C'.
(* Goal: and (@Midpoint Tn B C C') (@Cong Tn A' C A' C') *)
split.
(* Goal: @Cong Tn A' C A' C' *)
(* Goal: @Midpoint Tn B C C' *)
assumption.
(* Goal: @Cong Tn A' C A' C' *)
unfold Midpoint in *;spliter.
(* Goal: @Cong Tn A' C A' C' *)
eapply l4_17 with A B;finish.
Qed.
Lemma l8_4 : forall A B C C', Per A B C -> Midpoint B C C' -> Per A B C'.
Proof.
(* Goal: forall (A B C C' : @Tpoint Tn) (_ : @Per Tn A B C) (_ : @Midpoint Tn B C C'), @Per Tn A B C' *)
unfold Per.
(* Goal: forall (A B C C' : @Tpoint Tn) (_ : @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Midpoint Tn B C C'0) (@Cong Tn A C A C'0))) (_ : @Midpoint Tn B C C'), @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Midpoint Tn B C' C'0) (@Cong Tn A C' A C'0)) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Midpoint Tn B C' C'0) (@Cong Tn A C' A C'0)) *)
ex_and H B'.
(* Goal: @ex (@Tpoint Tn) (fun C'0 : @Tpoint Tn => and (@Midpoint Tn B C' C'0) (@Cong Tn A C' A C'0)) *)
exists C.
(* Goal: and (@Midpoint Tn B C' C) (@Cong Tn A C' A C) *)
split.
(* Goal: @Cong Tn A C' A C *)
(* Goal: @Midpoint Tn B C' C *)
apply l7_2.
(* Goal: @Cong Tn A C' A C *)
(* Goal: @Midpoint Tn B C C' *)
assumption.
(* Goal: @Cong Tn A C' A C *)
assert (B' = C') by (eapply symmetric_point_uniqueness;eauto).
(* Goal: @Cong Tn A C' A C *)
subst B'.
(* Goal: @Cong Tn A C' A C *)
Cong.
Qed.
Lemma l8_5 : forall A B, Per A B B.
Proof.
(* Goal: forall A B : @Tpoint Tn, @Per Tn A B B *)
unfold Per.
(* Goal: forall A B : @Tpoint Tn, @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B B C') (@Cong Tn A B A C')) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B B C') (@Cong Tn A B A C')) *)
exists B.
(* Goal: and (@Midpoint Tn B B B) (@Cong Tn A B A B) *)
split.
(* Goal: @Cong Tn A B A B *)
(* Goal: @Midpoint Tn B B B *)
apply l7_3_2.
(* Goal: @Cong Tn A B A B *)
Cong.
Qed.
Lemma l8_6 : forall A B C A', Per A B C -> Per A' B C -> Bet A C A' -> B=C.
Proof.
(* Goal: forall (A B C A' : @Tpoint Tn) (_ : @Per Tn A B C) (_ : @Per Tn A' B C) (_ : @Bet Tn A C A'), @eq (@Tpoint Tn) B C *)
unfold Per.
(* Goal: forall (A B C A' : @Tpoint Tn) (_ : @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A C A C'))) (_ : @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => and (@Midpoint Tn B C C') (@Cong Tn A' C A' C'))) (_ : @Bet Tn A C A'), @eq (@Tpoint Tn) B C *)
intros.
(* Goal: @eq (@Tpoint Tn) B C *)
ex_and H C'.
(* Goal: @eq (@Tpoint Tn) B C *)
ex_and H0 C''.
(* Goal: @eq (@Tpoint Tn) B C *)
assert (C'=C'') by (eapply symmetric_point_uniqueness;eauto).
(* Goal: @eq (@Tpoint Tn) B C *)
subst C''.
(* Goal: @eq (@Tpoint Tn) B C *)
assert (C = C') by (eapply l4_19;eauto).
(* Goal: @eq (@Tpoint Tn) B C *)
subst C'.
(* Goal: @eq (@Tpoint Tn) B C *)
apply l7_3.
(* Goal: @Midpoint Tn B C C *)
assumption.
Qed.
End T8_2.
Hint Resolve l8_5 : perp.
Ltac let_symmetric C P A :=
let id1:=fresh in (assert (id1:(exists A', Midpoint P A A'));
[apply symmetric_point_construction|ex_and id1 C]).
Ltac symmetric B' A B :=
assert(sp:= symmetric_point_construction B A); ex_and sp B'.
Section T8_3.
Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.
Lemma l8_7 : forall A B C, Per A B C -> Per A C B -> B=C.
Lemma l8_8 : forall A B, Per A B A -> A=B.
Proof.
(* Goal: forall (A B : @Tpoint Tn) (_ : @Per Tn A B A), @eq (@Tpoint Tn) A B *)
intros.
(* Goal: @eq (@Tpoint Tn) A B *)
apply l8_7 with A.
(* Goal: @Per Tn A B A *)
(* Goal: @Per Tn A A B *)
apply l8_2.
(* Goal: @Per Tn A B A *)
(* Goal: @Per Tn B A A *)
apply l8_5.
(* Goal: @Per Tn A B A *)
assumption.
Qed.
Lemma per_distinct : forall A B C, Per A B C -> A <> B -> A <> C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Per Tn A B C) (_ : not (@eq (@Tpoint Tn) A B)), not (@eq (@Tpoint Tn) A C) *)
intros.
(* Goal: not (@eq (@Tpoint Tn) A C) *)
intro.
(* Goal: False *)
subst C.
(* Goal: False *)
apply H0.
(* Goal: @eq (@Tpoint Tn) A B *)
apply (l8_8).
(* Goal: @Per Tn A B A *)
assumption.
Qed.
Lemma per_distinct_1 : forall A B C, Per A B C -> B <> C -> A <> C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Per Tn A B C) (_ : not (@eq (@Tpoint Tn) B C)), not (@eq (@Tpoint Tn) A C) *)
intros.
(* Goal: not (@eq (@Tpoint Tn) A C) *)
intro.
(* Goal: False *)
subst C.
(* Goal: False *)
apply H0.
(* Goal: @eq (@Tpoint Tn) B A *)
apply eq_sym.
(* Goal: @eq (@Tpoint Tn) A B *)
apply (l8_8).
(* Goal: @Per Tn A B A *)
assumption.
Qed.
Lemma l8_9 : forall A B C, Per A B C -> Col A B C -> A=B \/ C=B.
Lemma l8_10 : forall A B C A' B' C', Per A B C -> Cong_3 A B C A' B' C' -> Per A' B' C'.
Lemma col_col_per_per : forall A X C U V,
A<>X -> C<>X ->
Col U A X ->
Col V C X ->
Per A X C ->
Per U X V.
Proof.
(* Goal: forall (A X C U V : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A X)) (_ : not (@eq (@Tpoint Tn) C X)) (_ : @Col Tn U A X) (_ : @Col Tn V C X) (_ : @Per Tn A X C), @Per Tn U X V *)
intros.
(* Goal: @Per Tn U X V *)
assert (Per U X C) by (apply (l8_3 A X C U);Col).
(* Goal: @Per Tn U X V *)
apply l8_2 in H4.
(* Goal: @Per Tn U X V *)
apply l8_2 .
(* Goal: @Per Tn V X U *)
apply (l8_3 C X U V);Col.
Qed.
Lemma perp_in_dec : forall X A B C D, Perp_at X A B C D \/ ~ Perp_at X A B C D.
Proof.
(* Goal: forall X A B C D : @Tpoint Tn, or (@Perp_at Tn X A B C D) (not (@Perp_at Tn X A B C D)) *)
intros.
(* Goal: or (@Perp_at Tn X A B C D) (not (@Perp_at Tn X A B C D)) *)
unfold Perp_at.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
elim (eq_dec_points A B);intro; elim (eq_dec_points C D);intro; elim (col_dec X A B);intro; elim (col_dec X C D);intro; try tauto.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
elim (eq_dec_points B X);intro; elim (eq_dec_points D X);intro;subst;treat_equalities.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
elim (per_dec A X C);intro.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
left;repeat split;Col;intros; apply col_col_per_per with A C;Col.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A X) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
right;intro;spliter;apply H3;apply H8;Col.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
elim (per_dec A X D);intro.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
left;repeat split;Col;intros; apply col_col_per_per with A D;Col;ColR.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A X)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A X) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A X) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
right;intro;spliter;apply H3;apply H9;Col.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
elim (per_dec B X C);intro.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
left;repeat split;Col;intros; apply col_col_per_per with B C;Col;ColR.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C X)) (and (@Col Tn X A B) (and (@Col Tn X C X) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C X), @Per Tn U X V)))))) *)
right;intro;spliter;apply H4;apply H9;Col.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
elim (per_dec B X D);intro.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
left;repeat split;Col;intros; apply col_col_per_per with B D;Col;ColR.
(* Goal: or (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))) (not (and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V)))))) *)
right;intro;spliter;apply H5;apply H10;Col.
Qed.
Lemma perp_distinct : forall A B C D, Perp A B C D -> A <> B /\ C <> D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
unfold Perp in H.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
ex_elim H X.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
unfold Perp_at in H0.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
tauto.
Qed.
Lemma l8_12 : forall A B C D X, Perp_at X A B C D -> Perp_at X C D A B.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Perp_at Tn X C D A B *)
unfold Perp_at.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))), and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn X C D) (and (@Col Tn X A B) (forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V)))) *)
intros.
(* Goal: and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn X C D) (and (@Col Tn X A B) (forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V)))) *)
spliter.
(* Goal: and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn X C D) (and (@Col Tn X A B) (forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V)))) *)
repeat split;try assumption.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V *)
intros;eapply l8_2;eauto.
Qed.
Lemma per_col : forall A B C D,
B <> C -> Per A B C -> Col B C D -> Per A B D.
Lemma l8_13_2 : forall A B C D X,
A <> B -> C <> D -> Col X A B -> Col X C D ->
(exists U, exists V :Tpoint, Col U A B /\ Col V C D /\ U<>X /\ V<>X /\ Per U X V) ->
Perp_at X A B C D.
Lemma l8_14_1 : forall A B, ~ Perp A B A B.
Lemma l8_14_2_1a : forall X A B C D, Perp_at X A B C D -> Perp A B C D.
Proof.
(* Goal: forall (X A B C D : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Perp Tn A B C D *)
intros.
(* Goal: @Perp Tn A B C D *)
unfold Perp.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B C D) *)
exists X.
(* Goal: @Perp_at Tn X A B C D *)
assumption.
Qed.
Lemma perp_in_distinct : forall X A B C D , Perp_at X A B C D -> A <> B /\ C <> D.
Proof.
(* Goal: forall (X A B C D : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
intros.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
apply l8_14_2_1a in H.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C D)) *)
apply perp_distinct.
(* Goal: @Perp Tn A B C D *)
assumption.
Qed.
Lemma l8_14_2_1b : forall X A B C D Y, Perp_at X A B C D -> Col Y A B -> Col Y C D -> X=Y.
Proof.
(* Goal: forall (X A B C D Y : @Tpoint Tn) (_ : @Perp_at Tn X A B C D) (_ : @Col Tn Y A B) (_ : @Col Tn Y C D), @eq (@Tpoint Tn) X Y *)
intros.
(* Goal: @eq (@Tpoint Tn) X Y *)
unfold Perp_at in H.
(* Goal: @eq (@Tpoint Tn) X Y *)
spliter.
(* Goal: @eq (@Tpoint Tn) X Y *)
apply (H5 Y Y) in H1.
(* Goal: @Col Tn Y A B *)
(* Goal: @eq (@Tpoint Tn) X Y *)
apply eq_sym, l8_8; assumption.
(* Goal: @Col Tn Y A B *)
assumption.
Qed.
Lemma l8_14_2_1b_bis : forall A B C D X, Perp A B C D -> Col X A B -> Col X C D -> Perp_at X A B C D.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp Tn A B C D) (_ : @Col Tn X A B) (_ : @Col Tn X C D), @Perp_at Tn X A B C D *)
intros.
(* Goal: @Perp_at Tn X A B C D *)
unfold Perp in H.
(* Goal: @Perp_at Tn X A B C D *)
ex_and H Y.
(* Goal: @Perp_at Tn X A B C D *)
assert (Y = X) by (eapply (l8_14_2_1b Y _ _ _ _ X) in H2;assumption).
(* Goal: @Perp_at Tn X A B C D *)
subst Y.
(* Goal: @Perp_at Tn X A B C D *)
assumption.
Qed.
Lemma l8_14_2_2 : forall X A B C D,
Perp A B C D -> (forall Y, Col Y A B -> Col Y C D -> X=Y) -> Perp_at X A B C D.
Proof.
(* Goal: forall (X A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D) (_ : forall (Y : @Tpoint Tn) (_ : @Col Tn Y A B) (_ : @Col Tn Y C D), @eq (@Tpoint Tn) X Y), @Perp_at Tn X A B C D *)
intros.
(* Goal: @Perp_at Tn X A B C D *)
eapply l8_14_2_1b_bis.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
(* Goal: @Perp Tn A B C D *)
assumption.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
unfold Perp in H.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
ex_and H Y.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
unfold Perp_at in H1.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
spliter.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
assert (Col Y C D) by assumption.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
apply (H0 Y H2) in H3.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
subst Y.
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn X A B *)
assumption.
(* Goal: @Col Tn X C D *)
unfold Perp in H.
(* Goal: @Col Tn X C D *)
ex_and H Y.
(* Goal: @Col Tn X C D *)
unfold Perp_at in H1.
(* Goal: @Col Tn X C D *)
spliter.
(* Goal: @Col Tn X C D *)
assert (Col Y C D).
(* Goal: @Col Tn X C D *)
(* Goal: @Col Tn Y C D *)
assumption.
(* Goal: @Col Tn X C D *)
apply (H0 Y H2) in H3.
(* Goal: @Col Tn X C D *)
subst Y.
(* Goal: @Col Tn X C D *)
assumption.
Qed.
Lemma l8_14_3 : forall A B C D X Y, Perp_at X A B C D -> Perp_at Y A B C D -> X=Y.
Lemma l8_15_1 : forall A B C X, Col A B X -> Perp A B C X -> Perp_at X A B C X.
Proof.
(* Goal: forall (A B C X : @Tpoint Tn) (_ : @Col Tn A B X) (_ : @Perp Tn A B C X), @Perp_at Tn X A B C X *)
intros.
(* Goal: @Perp_at Tn X A B C X *)
eapply l8_14_2_1b_bis;Col.
Qed.
Lemma l8_15_2 : forall A B C X, Col A B X -> Perp_at X A B C X -> Perp A B C X.
Lemma perp_in_per : forall A B C, Perp_at B A B B C-> Per A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Perp_at Tn B A B B C), @Per Tn A B C *)
intros.
(* Goal: @Per Tn A B C *)
unfold Perp_at in H.
(* Goal: @Per Tn A B C *)
spliter.
(* Goal: @Per Tn A B C *)
apply H3;Col.
Qed.
Lemma perp_sym : forall A B C D, Perp A B C D -> Perp C D A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), @Perp Tn C D A B *)
unfold Perp.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B C D)), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X C D A B) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X C D A B) *)
ex_and H X.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X C D A B) *)
exists X.
(* Goal: @Perp_at Tn X C D A B *)
apply l8_12.
(* Goal: @Perp_at Tn X A B C D *)
assumption.
Qed.
Lemma perp_col0 : forall A B C D X Y, Perp A B C D -> X <> Y -> Col A B X -> Col A B Y -> Perp C D X Y.
Lemma per_perp_in : forall A B C, A <> B -> B <> C -> Per A B C -> Perp_at B A B B C.
Lemma per_perp : forall A B C, A <> B -> B <> C -> Per A B C -> Perp A B B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Per Tn A B C), @Perp Tn A B B C *)
intros.
(* Goal: @Perp Tn A B B C *)
apply per_perp_in in H1.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Perp Tn A B B C *)
eapply l8_14_2_1a with B;assumption.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
assumption.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
assumption.
Qed.
Lemma perp_left_comm : forall A B C D, Perp A B C D -> Perp B A C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), @Perp Tn B A C D *)
unfold Perp.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B C D)), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X B A C D) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X B A C D) *)
ex_and H X.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X B A C D) *)
exists X.
(* Goal: @Perp_at Tn X B A C D *)
unfold Perp_at in *.
(* Goal: and (not (@eq (@Tpoint Tn) B A)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X B A) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U B A) (_ : @Col Tn V C D), @Per Tn U X V)))) *)
intuition.
Qed.
Lemma perp_right_comm : forall A B C D, Perp A B C D -> Perp A B D C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), @Perp Tn A B D C *)
unfold Perp.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B C D)), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B D C) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B D C) *)
ex_and H X.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B D C) *)
exists X.
(* Goal: @Perp_at Tn X A B D C *)
unfold Perp_at in *.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) D C)) (and (@Col Tn X A B) (and (@Col Tn X D C) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V D C), @Per Tn U X V)))) *)
intuition.
Qed.
Lemma perp_comm : forall A B C D, Perp A B C D -> Perp B A D C.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), @Perp Tn B A D C *)
intros.
(* Goal: @Perp Tn B A D C *)
apply perp_left_comm.
(* Goal: @Perp Tn A B D C *)
apply perp_right_comm.
(* Goal: @Perp Tn A B C D *)
assumption.
Qed.
Lemma perp_in_sym :
forall A B C D X,
Perp_at X A B C D -> Perp_at X C D A B.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Perp_at Tn X C D A B *)
unfold Perp_at.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))), and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn X C D) (and (@Col Tn X A B) (forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V)))) *)
intros.
(* Goal: and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn X C D) (and (@Col Tn X A B) (forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V)))) *)
spliter.
(* Goal: and (not (@eq (@Tpoint Tn) C D)) (and (not (@eq (@Tpoint Tn) A B)) (and (@Col Tn X C D) (and (@Col Tn X A B) (forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V)))) *)
repeat split.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V *)
(* Goal: @Col Tn X A B *)
(* Goal: @Col Tn X C D *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: not (@eq (@Tpoint Tn) C D) *)
assumption.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V *)
(* Goal: @Col Tn X A B *)
(* Goal: @Col Tn X C D *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
assumption.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V *)
(* Goal: @Col Tn X A B *)
(* Goal: @Col Tn X C D *)
assumption.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V *)
(* Goal: @Col Tn X A B *)
assumption.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U C D) (_ : @Col Tn V A B), @Per Tn U X V *)
intros.
(* Goal: @Per Tn U X V *)
apply l8_2.
(* Goal: @Per Tn V X U *)
apply H3;assumption.
Qed.
Lemma perp_in_left_comm :
forall A B C D X,
Perp_at X A B C D -> Perp_at X B A C D.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Perp_at Tn X B A C D *)
unfold Perp_at.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))), and (not (@eq (@Tpoint Tn) B A)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X B A) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U B A) (_ : @Col Tn V C D), @Per Tn U X V)))) *)
intuition.
Qed.
Lemma perp_in_right_comm : forall A B C D X, Perp_at X A B C D -> Perp_at X A B D C.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Perp_at Tn X A B D C *)
intros.
(* Goal: @Perp_at Tn X A B D C *)
apply perp_in_sym.
(* Goal: @Perp_at Tn X D C A B *)
apply perp_in_left_comm.
(* Goal: @Perp_at Tn X C D A B *)
apply perp_in_sym.
(* Goal: @Perp_at Tn X A B C D *)
assumption.
Qed.
Lemma perp_in_comm : forall A B C D X, Perp_at X A B C D -> Perp_at X B A D C.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Perp_at Tn X B A D C *)
intros.
(* Goal: @Perp_at Tn X B A D C *)
apply perp_in_left_comm.
(* Goal: @Perp_at Tn X A B D C *)
apply perp_in_right_comm.
(* Goal: @Perp_at Tn X A B C D *)
assumption.
Qed.
End T8_3.
Hint Resolve perp_sym perp_left_comm perp_right_comm perp_comm per_perp_in per_perp
perp_in_per perp_in_left_comm perp_in_right_comm perp_in_comm perp_in_sym : perp.
Ltac double A B A' :=
assert (mp:= symmetric_point_construction A B);
elim mp; intros A' ; intro; clear mp.
Section T8_4.
Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.
Lemma Perp_cases :
forall A B C D,
Perp A B C D \/ Perp B A C D \/ Perp A B D C \/ Perp B A D C \/
Perp C D A B \/ Perp C D B A \/ Perp D C A B \/ Perp D C B A ->
Perp A B C D.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : or (@Perp Tn A B C D) (or (@Perp Tn B A C D) (or (@Perp Tn A B D C) (or (@Perp Tn B A D C) (or (@Perp Tn C D A B) (or (@Perp Tn C D B A) (or (@Perp Tn D C A B) (@Perp Tn D C B A)))))))), @Perp Tn A B C D *)
intros.
(* Goal: @Perp Tn A B C D *)
decompose [or] H; Perp.
Qed.
Lemma Perp_perm :
forall A B C D,
Perp A B C D ->
Perp A B C D /\ Perp B A C D /\ Perp A B D C /\ Perp B A D C /\
Perp C D A B /\ Perp C D B A /\ Perp D C A B /\ Perp D C B A.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), and (@Perp Tn A B C D) (and (@Perp Tn B A C D) (and (@Perp Tn A B D C) (and (@Perp Tn B A D C) (and (@Perp Tn C D A B) (and (@Perp Tn C D B A) (and (@Perp Tn D C A B) (@Perp Tn D C B A))))))) *)
intros.
(* Goal: and (@Perp Tn A B C D) (and (@Perp Tn B A C D) (and (@Perp Tn A B D C) (and (@Perp Tn B A D C) (and (@Perp Tn C D A B) (and (@Perp Tn C D B A) (and (@Perp Tn D C A B) (@Perp Tn D C B A))))))) *)
repeat split; Perp.
Qed.
Lemma Perp_in_cases :
forall X A B C D,
Perp_at X A B C D \/ Perp_at X B A C D \/ Perp_at X A B D C \/ Perp_at X B A D C \/
Perp_at X C D A B \/ Perp_at X C D B A \/ Perp_at X D C A B \/ Perp_at X D C B A ->
Perp_at X A B C D.
Proof.
(* Goal: forall (X A B C D : @Tpoint Tn) (_ : or (@Perp_at Tn X A B C D) (or (@Perp_at Tn X B A C D) (or (@Perp_at Tn X A B D C) (or (@Perp_at Tn X B A D C) (or (@Perp_at Tn X C D A B) (or (@Perp_at Tn X C D B A) (or (@Perp_at Tn X D C A B) (@Perp_at Tn X D C B A)))))))), @Perp_at Tn X A B C D *)
intros.
(* Goal: @Perp_at Tn X A B C D *)
decompose [or] H; Perp.
Qed.
Lemma Perp_in_perm :
forall X A B C D,
Perp_at X A B C D ->
Perp_at X A B C D /\ Perp_at X B A C D /\ Perp_at X A B D C /\ Perp_at X B A D C /\
Perp_at X C D A B /\ Perp_at X C D B A /\ Perp_at X D C A B /\ Perp_at X D C B A.
Proof.
(* Goal: forall (X A B C D : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), and (@Perp_at Tn X A B C D) (and (@Perp_at Tn X B A C D) (and (@Perp_at Tn X A B D C) (and (@Perp_at Tn X B A D C) (and (@Perp_at Tn X C D A B) (and (@Perp_at Tn X C D B A) (and (@Perp_at Tn X D C A B) (@Perp_at Tn X D C B A))))))) *)
intros.
(* Goal: and (@Perp_at Tn X A B C D) (and (@Perp_at Tn X B A C D) (and (@Perp_at Tn X A B D C) (and (@Perp_at Tn X B A D C) (and (@Perp_at Tn X C D A B) (and (@Perp_at Tn X C D B A) (and (@Perp_at Tn X D C A B) (@Perp_at Tn X D C B A))))))) *)
do 7 (split; Perp).
Qed.
Lemma perp_in_col : forall A B C D X, Perp_at X A B C D -> Col A B X /\ Col C D X.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), and (@Col Tn A B X) (@Col Tn C D X) *)
unfold Perp_at.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C D)) (and (@Col Tn X A B) (and (@Col Tn X C D) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C D), @Per Tn U X V))))), and (@Col Tn A B X) (@Col Tn C D X) *)
intuition.
Qed.
Lemma perp_perp_in : forall A B C, Perp A B C A -> Perp_at A A B C A.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Perp Tn A B C A), @Perp_at Tn A A B C A *)
intros.
(* Goal: @Perp_at Tn A A B C A *)
apply l8_15_1.
(* Goal: @Perp Tn A B C A *)
(* Goal: @Col Tn A B A *)
unfold Perp in H.
(* Goal: @Perp Tn A B C A *)
(* Goal: @Col Tn A B A *)
ex_and H X.
(* Goal: @Perp Tn A B C A *)
(* Goal: @Col Tn A B A *)
unfold Perp_at in H0.
(* Goal: @Perp Tn A B C A *)
(* Goal: @Col Tn A B A *)
intuition.
(* Goal: @Perp Tn A B C A *)
assumption.
Qed.
Lemma perp_per_1 : forall A B C, Perp A B C A -> Per B A C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Perp Tn A B C A), @Per Tn B A C *)
intros.
(* Goal: @Per Tn B A C *)
assert (Perp_at A A B C A).
(* Goal: @Per Tn B A C *)
(* Goal: @Perp_at Tn A A B C A *)
apply perp_perp_in.
(* Goal: @Per Tn B A C *)
(* Goal: @Perp Tn A B C A *)
assumption.
(* Goal: @Per Tn B A C *)
unfold Perp_at in H0.
(* Goal: @Per Tn B A C *)
spliter.
(* Goal: @Per Tn B A C *)
apply H4.
(* Goal: @Col Tn C C A *)
(* Goal: @Col Tn B A B *)
Col.
(* Goal: @Col Tn C C A *)
Col.
Qed.
Lemma perp_per_2 : forall A B C, Perp A B A C -> Per B A C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : @Perp Tn A B A C), @Per Tn B A C *)
intros.
(* Goal: @Per Tn B A C *)
apply perp_right_comm in H.
(* Goal: @Per Tn B A C *)
apply perp_per_1; assumption.
Qed.
Lemma perp_col : forall A B C D E, A<>E -> Perp A B C D -> Col A B E -> Perp A E C D.
Proof.
(* Goal: forall (A B C D E : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A E)) (_ : @Perp Tn A B C D) (_ : @Col Tn A B E), @Perp Tn A E C D *)
intros.
(* Goal: @Perp Tn A E C D *)
apply perp_sym.
(* Goal: @Perp Tn C D A E *)
apply perp_col0 with A B;finish.
Qed.
Lemma perp_col2 : forall A B C D X Y,
Perp A B X Y ->
C <> D -> Col A B C -> Col A B D -> Perp C D X Y.
Proof.
(* Goal: forall (A B C D X Y : @Tpoint Tn) (_ : @Perp Tn A B X Y) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn A B C) (_ : @Col Tn A B D), @Perp Tn C D X Y *)
intros.
(* Goal: @Perp Tn C D X Y *)
assert(HH:=H).
(* Goal: @Perp Tn C D X Y *)
apply perp_distinct in HH.
(* Goal: @Perp Tn C D X Y *)
spliter.
(* Goal: @Perp Tn C D X Y *)
induction (eq_dec_points A C).
(* Goal: @Perp Tn C D X Y *)
(* Goal: @Perp Tn C D X Y *)
subst A.
(* Goal: @Perp Tn C D X Y *)
(* Goal: @Perp Tn C D X Y *)
apply perp_col with B;finish.
(* Goal: @Perp Tn C D X Y *)
assert(Perp A C X Y) by (eapply perp_col;eauto).
(* Goal: @Perp Tn C D X Y *)
eapply perp_col with A;finish.
(* Goal: @Col Tn C A D *)
Perp.
(* Goal: @Col Tn C A D *)
ColR.
Qed.
Lemma perp_not_eq_1 : forall A B C D, Perp A B C D -> A<>B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : @Perp Tn A B C D), not (@eq (@Tpoint Tn) A B) *)
intros.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
unfold Perp in H.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
ex_elim H X.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
unfold Perp_at in H0.
(* Goal: not (@eq (@Tpoint Tn) A B) *)
tauto.
Qed.
Lemma perp_not_eq_2 : forall A B C D, Perp A B C D -> C<>D.
Lemma diff_per_diff : forall A B P R ,
A <> B -> Cong A P B R -> Per B A P -> Per A B R -> P <> R.
Lemma per_not_colp : forall A B P R, A <> B -> A <> P -> B <> R -> Per B A P -> Per A B R -> ~Col P A R.
Lemma per_not_col : forall A B C, A <> B -> B <> C -> Per A B C -> ~Col A B C.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : @Per Tn A B C), not (@Col Tn A B C) *)
intros.
(* Goal: not (@Col Tn A B C) *)
intro.
(* Goal: False *)
unfold Per in H1.
(* Goal: False *)
ex_and H1 C'.
(* Goal: False *)
assert (C = C' \/ Midpoint A C C').
(* Goal: False *)
(* Goal: or (@eq (@Tpoint Tn) C C') (@Midpoint Tn A C C') *)
eapply l7_20.
(* Goal: False *)
(* Goal: @Cong Tn A C A C' *)
(* Goal: @Col Tn C A C' *)
assert_cols;ColR.
(* Goal: False *)
(* Goal: @Cong Tn A C A C' *)
assumption.
(* Goal: False *)
induction H4;treat_equalities; intuition.
Qed.
Lemma perp_not_col2 : forall A B C D, Perp A B C D -> ~ Col A B C \/ ~ Col A B D.
Lemma perp_not_col : forall A B P, Perp A B P A -> ~ Col A B P.
Proof.
(* Goal: forall (A B P : @Tpoint Tn) (_ : @Perp Tn A B P A), not (@Col Tn A B P) *)
intros.
(* Goal: not (@Col Tn A B P) *)
assert (Perp_at A A B P A).
(* Goal: not (@Col Tn A B P) *)
(* Goal: @Perp_at Tn A A B P A *)
apply perp_perp_in.
(* Goal: not (@Col Tn A B P) *)
(* Goal: @Perp Tn A B P A *)
assumption.
(* Goal: not (@Col Tn A B P) *)
assert (Per P A B).
(* Goal: not (@Col Tn A B P) *)
(* Goal: @Per Tn P A B *)
apply perp_in_per.
(* Goal: not (@Col Tn A B P) *)
(* Goal: @Perp_at Tn A P A A B *)
apply perp_in_sym.
(* Goal: not (@Col Tn A B P) *)
(* Goal: @Perp_at Tn A A B P A *)
assumption.
(* Goal: not (@Col Tn A B P) *)
apply perp_in_left_comm in H0.
(* Goal: not (@Col Tn A B P) *)
assert (~ Col B A P -> ~ Col A B P).
(* Goal: not (@Col Tn A B P) *)
(* Goal: forall _ : not (@Col Tn B A P), not (@Col Tn A B P) *)
intro.
(* Goal: not (@Col Tn A B P) *)
(* Goal: not (@Col Tn A B P) *)
intro.
(* Goal: not (@Col Tn A B P) *)
(* Goal: False *)
apply H2.
(* Goal: not (@Col Tn A B P) *)
(* Goal: @Col Tn B A P *)
apply col_permutation_4.
(* Goal: not (@Col Tn A B P) *)
(* Goal: @Col Tn A B P *)
assumption.
(* Goal: not (@Col Tn A B P) *)
apply H2.
(* Goal: not (@Col Tn B A P) *)
apply perp_distinct in H.
(* Goal: not (@Col Tn B A P) *)
spliter.
(* Goal: not (@Col Tn B A P) *)
apply per_not_col.
(* Goal: @Per Tn B A P *)
(* Goal: not (@eq (@Tpoint Tn) A P) *)
(* Goal: not (@eq (@Tpoint Tn) B A) *)
auto.
(* Goal: @Per Tn B A P *)
(* Goal: not (@eq (@Tpoint Tn) A P) *)
auto.
(* Goal: @Per Tn B A P *)
apply perp_in_per.
(* Goal: @Perp_at Tn A B A A P *)
apply perp_in_right_comm.
(* Goal: @Perp_at Tn A B A P A *)
assumption.
Qed.
Lemma perp_in_col_perp_in : forall A B C D E P, C <> E -> Col C D E -> Perp_at P A B C D -> Perp_at P A B C E.
Proof.
(* Goal: forall (A B C D E P : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) C E)) (_ : @Col Tn C D E) (_ : @Perp_at Tn P A B C D), @Perp_at Tn P A B C E *)
intros.
(* Goal: @Perp_at Tn P A B C E *)
unfold Perp_at in *.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C E)) (and (@Col Tn P A B) (and (@Col Tn P C E) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C E), @Per Tn U P V)))) *)
spliter.
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (and (not (@eq (@Tpoint Tn) C E)) (and (@Col Tn P A B) (and (@Col Tn P C E) (forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C E), @Per Tn U P V)))) *)
repeat split; auto.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C E), @Per Tn U P V *)
(* Goal: @Col Tn P C E *)
ColR.
(* Goal: forall (U V : @Tpoint Tn) (_ : @Col Tn U A B) (_ : @Col Tn V C E), @Per Tn U P V *)
intros.
(* Goal: @Per Tn U P V *)
apply H5.
(* Goal: @Col Tn V C D *)
(* Goal: @Col Tn U A B *)
assumption.
(* Goal: @Col Tn V C D *)
ColR.
Qed.
Lemma perp_col2_bis : forall A B C D P Q,
Perp A B P Q ->
Col C D P ->
Col C D Q ->
C <> D ->
Perp A B C D.
Proof.
(* Goal: forall (A B C D P Q : @Tpoint Tn) (_ : @Perp Tn A B P Q) (_ : @Col Tn C D P) (_ : @Col Tn C D Q) (_ : not (@eq (@Tpoint Tn) C D)), @Perp Tn A B C D *)
intros A B C D P Q HPerp HCol1 HCol2 HCD.
(* Goal: @Perp Tn A B C D *)
apply perp_sym.
(* Goal: @Perp Tn C D A B *)
apply perp_col2 with P Q; Perp; ColR.
Qed.
Lemma perp_in_perp_bis : forall A B C D X,
Perp_at X A B C D -> Perp X B C D \/ Perp A X C D.
Lemma col_per_perp : forall A B C D,
A <> B -> B <> C -> D <> B -> D <> C ->
Col B C D -> Per A B C -> Perp C D A B.
Proof.
(* Goal: forall (A B C D : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) D B)) (_ : not (@eq (@Tpoint Tn) D C)) (_ : @Col Tn B C D) (_ : @Per Tn A B C), @Perp Tn C D A B *)
intros.
(* Goal: @Perp Tn C D A B *)
apply per_perp_in in H4.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Perp Tn C D A B *)
apply perp_in_perp_bis in H4.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Perp Tn C D A B *)
induction H4.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Perp Tn C D A B *)
(* Goal: @Perp Tn C D A B *)
apply perp_distinct in H4.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Perp Tn C D A B *)
(* Goal: @Perp Tn C D A B *)
spliter.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Perp Tn C D A B *)
(* Goal: @Perp Tn C D A B *)
absurde.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Perp Tn C D A B *)
eapply (perp_col _ B).
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Col Tn C B D *)
(* Goal: @Perp Tn C B A B *)
(* Goal: not (@eq (@Tpoint Tn) C D) *)
auto.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Col Tn C B D *)
(* Goal: @Perp Tn C B A B *)
apply perp_sym.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Col Tn C B D *)
(* Goal: @Perp Tn A B C B *)
apply perp_right_comm.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Col Tn C B D *)
(* Goal: @Perp Tn A B B C *)
assumption.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Col Tn C B D *)
apply col_permutation_4.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
(* Goal: @Col Tn B C D *)
assumption.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
assumption.
(* Goal: not (@eq (@Tpoint Tn) B C) *)
assumption.
Qed.
Lemma per_cong_mid : forall A B C H,
B <> C -> Bet A B C -> Cong A H C H -> Per H B C ->
Midpoint B A C.
Lemma per_double_cong : forall A B C C',
Per A B C -> Midpoint B C C' -> Cong A C A C'.
Lemma cong_perp_or_mid : forall A B M X, A <> B -> Midpoint M A B -> Cong A X B X ->
X = M \/ ~Col A B X /\ Perp_at M X M A B.
Proof.
(* Goal: forall (A B M X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Midpoint Tn M A B) (_ : @Cong Tn A X B X), or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
intros.
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
induction(col_dec A B X).
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
left.
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
(* Goal: @eq (@Tpoint Tn) X M *)
assert(A = B \/ Midpoint X A B).
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
(* Goal: @eq (@Tpoint Tn) X M *)
(* Goal: or (@eq (@Tpoint Tn) A B) (@Midpoint Tn X A B) *)
apply l7_20; Col.
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
(* Goal: @eq (@Tpoint Tn) X M *)
(* Goal: @Cong Tn X A X B *)
Cong.
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
(* Goal: @eq (@Tpoint Tn) X M *)
induction H3.
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
(* Goal: @eq (@Tpoint Tn) X M *)
(* Goal: @eq (@Tpoint Tn) X M *)
contradiction.
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
(* Goal: @eq (@Tpoint Tn) X M *)
apply (l7_17 A B); auto.
(* Goal: or (@eq (@Tpoint Tn) X M) (and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B)) *)
right.
(* Goal: and (not (@Col Tn A B X)) (@Perp_at Tn M X M A B) *)
split; auto.
(* Goal: @Perp_at Tn M X M A B *)
assert(Col M A B).
(* Goal: @Perp_at Tn M X M A B *)
(* Goal: @Col Tn M A B *)
unfold Midpoint in *.
(* Goal: @Perp_at Tn M X M A B *)
(* Goal: @Col Tn M A B *)
spliter; Col.
(* Goal: @Perp_at Tn M X M A B *)
assert_diffs.
(* Goal: @Perp_at Tn M X M A B *)
assert(Per X M A) by (unfold Per;exists B;split; Cong).
(* Goal: @Perp_at Tn M X M A B *)
apply per_perp_in in H4.
(* Goal: not (@eq (@Tpoint Tn) M A) *)
(* Goal: not (@eq (@Tpoint Tn) X M) *)
(* Goal: @Perp_at Tn M X M A B *)
apply perp_in_right_comm in H4.
(* Goal: not (@eq (@Tpoint Tn) M A) *)
(* Goal: not (@eq (@Tpoint Tn) X M) *)
(* Goal: @Perp_at Tn M X M A B *)
apply(perp_in_col_perp_in X M A M B M); Col.
(* Goal: not (@eq (@Tpoint Tn) M A) *)
(* Goal: not (@eq (@Tpoint Tn) X M) *)
intro;treat_equalities.
(* Goal: not (@eq (@Tpoint Tn) M A) *)
(* Goal: False *)
apply H2; Col.
(* Goal: not (@eq (@Tpoint Tn) M A) *)
auto.
Qed.
Lemma col_per2_cases : forall A B C D B',
B <> C -> B' <> C -> C <> D -> Col B C D -> Per A B C -> Per A B' C ->
B = B' \/ ~Col B' C D.
Proof.
(* Goal: forall (A B C D B' : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) B C)) (_ : not (@eq (@Tpoint Tn) B' C)) (_ : not (@eq (@Tpoint Tn) C D)) (_ : @Col Tn B C D) (_ : @Per Tn A B C) (_ : @Per Tn A B' C), or (@eq (@Tpoint Tn) B B') (not (@Col Tn B' C D)) *)
intros.
(* Goal: or (@eq (@Tpoint Tn) B B') (not (@Col Tn B' C D)) *)
induction(eq_dec_points B B').
(* Goal: or (@eq (@Tpoint Tn) B B') (not (@Col Tn B' C D)) *)
(* Goal: or (@eq (@Tpoint Tn) B B') (not (@Col Tn B' C D)) *)
left; auto.
(* Goal: or (@eq (@Tpoint Tn) B B') (not (@Col Tn B' C D)) *)
right.
(* Goal: not (@Col Tn B' C D) *)
intro.
(* Goal: False *)
assert(Col C B B').
(* Goal: False *)
(* Goal: @Col Tn C B B' *)
ColR.
(* Goal: False *)
assert(Per A B' B).
(* Goal: False *)
(* Goal: @Per Tn A B' B *)
apply(per_col A B' C B H0 H4); Col.
(* Goal: False *)
assert(Per A B B').
(* Goal: False *)
(* Goal: @Per Tn A B B' *)
apply(per_col A B C B' H H3); Col.
(* Goal: False *)
apply H5.
(* Goal: @eq (@Tpoint Tn) B B' *)
apply (l8_7 A); auto.
Qed.
Lemma l8_16_1 : forall A B C U X,
Col A B X -> Col A B U -> Perp A B C X -> ~ Col A B C /\ Per C X U.
Lemma l8_16_2 : forall A B C U X,
Col A B X -> Col A B U -> U<>X -> ~ Col A B C -> Per C X U -> Perp A B C X.
Proof.
(* Goal: forall (A B C U X : @Tpoint Tn) (_ : @Col Tn A B X) (_ : @Col Tn A B U) (_ : not (@eq (@Tpoint Tn) U X)) (_ : not (@Col Tn A B C)) (_ : @Per Tn C X U), @Perp Tn A B C X *)
intros.
(* Goal: @Perp Tn A B C X *)
assert (C <> X).
(* Goal: @Perp Tn A B C X *)
(* Goal: not (@eq (@Tpoint Tn) C X) *)
intro.
(* Goal: @Perp Tn A B C X *)
(* Goal: False *)
subst X.
(* Goal: @Perp Tn A B C X *)
(* Goal: False *)
apply H2.
(* Goal: @Perp Tn A B C X *)
(* Goal: @Col Tn A B C *)
assumption.
(* Goal: @Perp Tn A B C X *)
unfold Perp.
(* Goal: @ex (@Tpoint Tn) (fun X0 : @Tpoint Tn => @Perp_at Tn X0 A B C X) *)
exists X.
(* Goal: @Perp_at Tn X A B C X *)
eapply l8_13_2.
(* Goal: @ex (@Tpoint Tn) (fun U : @Tpoint Tn => @ex (@Tpoint Tn) (fun V : @Tpoint Tn => and (@Col Tn U A B) (and (@Col Tn V C X) (and (not (@eq (@Tpoint Tn) U X)) (and (not (@eq (@Tpoint Tn) V X)) (@Per Tn U X V)))))) *)
(* Goal: @Col Tn X C X *)
(* Goal: @Col Tn X A B *)
(* Goal: not (@eq (@Tpoint Tn) C X) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
assert_diffs; auto.
(* Goal: @ex (@Tpoint Tn) (fun U : @Tpoint Tn => @ex (@Tpoint Tn) (fun V : @Tpoint Tn => and (@Col Tn U A B) (and (@Col Tn V C X) (and (not (@eq (@Tpoint Tn) U X)) (and (not (@eq (@Tpoint Tn) V X)) (@Per Tn U X V)))))) *)
(* Goal: @Col Tn X C X *)
(* Goal: @Col Tn X A B *)
(* Goal: not (@eq (@Tpoint Tn) C X) *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun U : @Tpoint Tn => @ex (@Tpoint Tn) (fun V : @Tpoint Tn => and (@Col Tn U A B) (and (@Col Tn V C X) (and (not (@eq (@Tpoint Tn) U X)) (and (not (@eq (@Tpoint Tn) V X)) (@Per Tn U X V)))))) *)
(* Goal: @Col Tn X C X *)
(* Goal: @Col Tn X A B *)
Col.
(* Goal: @ex (@Tpoint Tn) (fun U : @Tpoint Tn => @ex (@Tpoint Tn) (fun V : @Tpoint Tn => and (@Col Tn U A B) (and (@Col Tn V C X) (and (not (@eq (@Tpoint Tn) U X)) (and (not (@eq (@Tpoint Tn) V X)) (@Per Tn U X V)))))) *)
(* Goal: @Col Tn X C X *)
Col.
(* Goal: @ex (@Tpoint Tn) (fun U : @Tpoint Tn => @ex (@Tpoint Tn) (fun V : @Tpoint Tn => and (@Col Tn U A B) (and (@Col Tn V C X) (and (not (@eq (@Tpoint Tn) U X)) (and (not (@eq (@Tpoint Tn) V X)) (@Per Tn U X V)))))) *)
exists U.
(* Goal: @ex (@Tpoint Tn) (fun V : @Tpoint Tn => and (@Col Tn U A B) (and (@Col Tn V C X) (and (not (@eq (@Tpoint Tn) U X)) (and (not (@eq (@Tpoint Tn) V X)) (@Per Tn U X V))))) *)
exists C.
(* Goal: and (@Col Tn U A B) (and (@Col Tn C C X) (and (not (@eq (@Tpoint Tn) U X)) (and (not (@eq (@Tpoint Tn) C X)) (@Per Tn U X C)))) *)
repeat split; Col.
(* Goal: @Per Tn U X C *)
apply l8_2.
(* Goal: @Per Tn C X U *)
assumption.
Qed.
Lemma l8_18_uniqueness : forall A B C X Y,
~ Col A B C -> Col A B X -> Perp A B C X -> Col A B Y -> Perp A B C Y -> X=Y.
Proof.
(* Goal: forall (A B C X Y : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Col Tn A B X) (_ : @Perp Tn A B C X) (_ : @Col Tn A B Y) (_ : @Perp Tn A B C Y), @eq (@Tpoint Tn) X Y *)
intros.
(* Goal: @eq (@Tpoint Tn) X Y *)
show_distinct A B.
(* Goal: @eq (@Tpoint Tn) X Y *)
(* Goal: False *)
solve [intuition].
(* Goal: @eq (@Tpoint Tn) X Y *)
assert (Perp_at X A B C X) by (eapply l8_15_1;assumption).
(* Goal: @eq (@Tpoint Tn) X Y *)
assert (Perp_at Y A B C Y) by (eapply l8_15_1;assumption).
(* Goal: @eq (@Tpoint Tn) X Y *)
unfold Perp_at in *.
(* Goal: @eq (@Tpoint Tn) X Y *)
spliter.
(* Goal: @eq (@Tpoint Tn) X Y *)
apply l8_7 with C;apply l8_2;[apply H14 |apply H10];Col.
Qed.
Lemma midpoint_distinct : forall A B X C C', ~ Col A B C -> Col A B X -> Midpoint X C C' -> C <> C'.
Proof.
(* Goal: forall (A B X C C' : @Tpoint Tn) (_ : not (@Col Tn A B C)) (_ : @Col Tn A B X) (_ : @Midpoint Tn X C C'), not (@eq (@Tpoint Tn) C C') *)
intros.
(* Goal: not (@eq (@Tpoint Tn) C C') *)
intro.
(* Goal: False *)
subst C'.
(* Goal: False *)
apply H.
(* Goal: @Col Tn A B C *)
unfold Midpoint in H1.
(* Goal: @Col Tn A B C *)
spliter.
(* Goal: @Col Tn A B C *)
treat_equalities.
(* Goal: @Col Tn A B C *)
assumption.
Qed.
Lemma l8_20_1 : forall A B C C' D P,
Per A B C -> Midpoint P C' D -> Midpoint A C' C -> Midpoint B D C -> Per B A P.
Lemma l8_20_2 : forall A B C C' D P,
Per A B C -> Midpoint P C' D -> Midpoint A C' C -> Midpoint B D C -> B<>C -> A<>P.
Lemma perp_col1 : forall A B C D X,
C <> X -> Perp A B C D -> Col C D X -> Perp A B C X.
Lemma l8_18_existence : forall A B C, ~ Col A B C -> exists X, Col A B X /\ Perp A B C X.
Lemma l8_21_aux : forall A B C,
~ Col A B C -> exists P, exists T, Perp A B P A /\ Col A B T /\ Bet C T P.
Lemma l8_21 : forall A B C,
A <> B -> exists P, exists T, Perp A B P A /\ Col A B T /\ Bet C T P.
Proof.
(* Goal: forall (A B C : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)), @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
induction(col_dec A B C).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
assert (exists C', ~ Col A B C').
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun C' : @Tpoint Tn => not (@Col Tn A B C')) *)
eapply not_col_exists.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
ex_elim H1 C'.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
assert ( exists P : Tpoint, (exists T : Tpoint, Perp A B P A /\ Col A B T /\ Bet C' T P)).
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C' T P)))) *)
eapply l8_21_aux.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: not (@Col Tn A B C') *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
ex_elim H1 P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
ex_and H3 T.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
exists P.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P))) *)
exists C.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: and (@Perp Tn A B P A) (and (@Col Tn A B C) (@Bet Tn C C P)) *)
repeat split.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @Bet Tn C C P *)
(* Goal: @Col Tn A B C *)
(* Goal: @Perp Tn A B P A *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @Bet Tn C C P *)
(* Goal: @Col Tn A B C *)
assumption.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
(* Goal: @Bet Tn C C P *)
apply between_trivial2.
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn C T P)))) *)
eapply l8_21_aux.
(* Goal: not (@Col Tn A B C) *)
assumption.
Qed.
Lemma per_cong : forall A B P R X ,
A <> B -> A <> P ->
Per B A P -> Per A B R ->
Cong A P B R -> Col A B X -> Bet P X R ->
Cong A R P B.
Lemma perp_cong : forall A B P R X,
A <> B -> A <> P ->
Perp A B P A -> Perp A B R B ->
Cong A P B R -> Col A B X -> Bet P X R ->
Cong A R P B.
Proof.
(* Goal: forall (A B P R X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A P)) (_ : @Perp Tn A B P A) (_ : @Perp Tn A B R B) (_ : @Cong Tn A P B R) (_ : @Col Tn A B X) (_ : @Bet Tn P X R), @Cong Tn A R P B *)
intros.
(* Goal: @Cong Tn A R P B *)
apply (per_cong A B P R X).
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
(* Goal: @Per Tn A B R *)
(* Goal: @Per Tn B A P *)
(* Goal: not (@eq (@Tpoint Tn) A P) *)
(* Goal: not (@eq (@Tpoint Tn) A B) *)
assumption.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
(* Goal: @Per Tn A B R *)
(* Goal: @Per Tn B A P *)
(* Goal: not (@eq (@Tpoint Tn) A P) *)
assumption.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
(* Goal: @Per Tn A B R *)
(* Goal: @Per Tn B A P *)
apply perp_per_1.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
(* Goal: @Per Tn A B R *)
(* Goal: @Perp Tn A B P A *)
assumption.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
(* Goal: @Per Tn A B R *)
eapply perp_per_1.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
(* Goal: @Perp Tn B A R B *)
auto.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
(* Goal: @Perp Tn B A R B *)
apply perp_left_comm;auto.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
(* Goal: @Cong Tn A P B R *)
assumption.
(* Goal: @Bet Tn P X R *)
(* Goal: @Col Tn A B X *)
assumption.
(* Goal: @Bet Tn P X R *)
assumption.
Qed.
Lemma perp_exists : forall O A B, A <> B -> exists X, Perp O X A B.
Proof.
(* Goal: forall (O A B : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
induction(col_dec A B O).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
destruct (diff_col_ex3 A B O H0) as [C].
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
destruct (l8_21 O C O H3) as [P [T]].
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
exists P.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @Perp Tn O P A B *)
apply perp_comm.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @Perp Tn P O B A *)
apply perp_sym.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
(* Goal: @Perp Tn B A P O *)
apply (perp_col2 O C); ColR.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
destruct (l8_18_existence A B O H0) as [X []].
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp Tn O X A B) *)
exists X.
(* Goal: @Perp Tn O X A B *)
apply perp_sym.
(* Goal: @Perp Tn A B O X *)
apply H2.
Qed.
Lemma perp_vector : forall A B, A <> B -> (exists X, exists Y, Perp A B X Y).
Proof.
(* Goal: forall (A B : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Perp Tn A B X Y)) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Perp Tn A B X Y)) *)
exists A.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Perp Tn A B A Y) *)
destruct (perp_exists A A B) as [Y]; auto.
(* Goal: @ex (@Tpoint Tn) (fun Y : @Tpoint Tn => @Perp Tn A B A Y) *)
exists Y; Perp.
Qed.
Lemma midpoint_existence_aux : forall A B P Q T,
A<>B -> Perp A B Q B -> Perp A B P A ->
Col A B T -> Bet Q T P -> Le A P B Q ->
exists X : Tpoint, Midpoint X A B.
Lemma midpoint_existence : forall A B, exists X, Midpoint X A B.
Proof.
(* Goal: forall A B : @Tpoint Tn, @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
induction (eq_dec_points A B).
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
subst B.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A A) *)
exists A.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
(* Goal: @Midpoint Tn A A A *)
apply l7_3_2.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
cut(exists Q, Perp A B B Q).
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: forall _ : @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
intro.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
ex_elim H0 Q.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
cut(exists P, exists T, Perp A B P A /\ Col A B T /\ Bet Q T P).
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: forall _ : @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))), @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
ex_elim H0 P.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
ex_and H2 T.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
assert (Le A P B Q \/ Le B Q A P) by (apply le_cases).
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
induction H4.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
apply midpoint_existence_aux with P Q T;finish;Perp.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
assert (exists X : Tpoint, Midpoint X B A) by (apply (midpoint_existence_aux B A Q P T);finish;Perp;Between).
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
ex_elim H5 X.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Midpoint Tn X A B) *)
exists X.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
(* Goal: @Midpoint Tn X A B *)
finish.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
(* Goal: @ex (@Tpoint Tn) (fun P : @Tpoint Tn => @ex (@Tpoint Tn) (fun T : @Tpoint Tn => and (@Perp Tn A B P A) (and (@Col Tn A B T) (@Bet Tn Q T P)))) *)
apply l8_21;assumption.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
assert (exists P : Tpoint, (exists T : Tpoint, Perp B A P B /\ Col B A T /\ Bet A T P)) by (apply (l8_21 B A);auto).
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
ex_elim H0 P.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
ex_elim H1 T.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
spliter.
(* Goal: @ex (@Tpoint Tn) (fun Q : @Tpoint Tn => @Perp Tn A B B Q) *)
exists P.
(* Goal: @Perp Tn A B B P *)
Perp.
Qed.
Lemma perp_in_id : forall A B C X, Perp_at X A B C A -> X = A.
Proof.
(* Goal: forall (A B C X : @Tpoint Tn) (_ : @Perp_at Tn X A B C A), @eq (@Tpoint Tn) X A *)
intros.
(* Goal: @eq (@Tpoint Tn) X A *)
assert (Perp A B C A).
(* Goal: @eq (@Tpoint Tn) X A *)
(* Goal: @Perp Tn A B C A *)
unfold Perp.
(* Goal: @eq (@Tpoint Tn) X A *)
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B C A) *)
exists X.
(* Goal: @eq (@Tpoint Tn) X A *)
(* Goal: @Perp_at Tn X A B C A *)
assumption.
(* Goal: @eq (@Tpoint Tn) X A *)
assert (A <> B /\ C <> A).
(* Goal: @eq (@Tpoint Tn) X A *)
(* Goal: and (not (@eq (@Tpoint Tn) A B)) (not (@eq (@Tpoint Tn) C A)) *)
apply perp_distinct.
(* Goal: @eq (@Tpoint Tn) X A *)
(* Goal: @Perp Tn A B C A *)
assumption.
(* Goal: @eq (@Tpoint Tn) X A *)
spliter.
(* Goal: @eq (@Tpoint Tn) X A *)
assert (HH:=H0).
(* Goal: @eq (@Tpoint Tn) X A *)
apply perp_perp_in in HH.
(* Goal: @eq (@Tpoint Tn) X A *)
assert (l8_16_1:=l8_16_1 A B C B A).
(* Goal: @eq (@Tpoint Tn) X A *)
assert (~Col A B C /\ Per C A B).
(* Goal: @eq (@Tpoint Tn) X A *)
(* Goal: and (not (@Col Tn A B C)) (@Per Tn C A B) *)
apply l8_16_1;Col.
(* Goal: @eq (@Tpoint Tn) X A *)
spliter.
(* Goal: @eq (@Tpoint Tn) X A *)
unfold Perp_at in H.
(* Goal: @eq (@Tpoint Tn) X A *)
spliter.
(* Goal: @eq (@Tpoint Tn) X A *)
eapply l8_18_uniqueness with A B C;finish.
(* Goal: @Perp Tn A B C X *)
apply perp_sym.
(* Goal: @Perp Tn C X A B *)
eapply perp_col with A;finish.
(* Goal: not (@eq (@Tpoint Tn) C X) *)
intro.
(* Goal: False *)
subst X.
(* Goal: False *)
Col.
Qed.
Lemma l8_22 : forall A B P R X ,
A <> B -> A <> P ->
Per B A P -> Per A B R ->
Cong A P B R -> Col A B X -> Bet P X R ->
Cong A R P B /\ Midpoint X A B /\ Midpoint X P R.
Proof.
(* Goal: forall (A B P R X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A P)) (_ : @Per Tn B A P) (_ : @Per Tn A B R) (_ : @Cong Tn A P B R) (_ : @Col Tn A B X) (_ : @Bet Tn P X R), and (@Cong Tn A R P B) (and (@Midpoint Tn X A B) (@Midpoint Tn X P R)) *)
intros.
(* Goal: and (@Cong Tn A R P B) (and (@Midpoint Tn X A B) (@Midpoint Tn X P R)) *)
assert (Cong A R P B).
(* Goal: and (@Cong Tn A R P B) (and (@Midpoint Tn X A B) (@Midpoint Tn X P R)) *)
(* Goal: @Cong Tn A R P B *)
apply (per_cong A B P R X); assumption.
(* Goal: and (@Cong Tn A R P B) (and (@Midpoint Tn X A B) (@Midpoint Tn X P R)) *)
split.
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
(* Goal: @Cong Tn A R P B *)
assumption.
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
assert (~ Col B A P).
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
(* Goal: not (@Col Tn B A P) *)
eapply per_not_col.
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
(* Goal: @Per Tn B A P *)
(* Goal: not (@eq (@Tpoint Tn) A P) *)
(* Goal: not (@eq (@Tpoint Tn) B A) *)
auto.
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
(* Goal: @Per Tn B A P *)
(* Goal: not (@eq (@Tpoint Tn) A P) *)
assumption.
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
(* Goal: @Per Tn B A P *)
assumption.
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
assert_all_diffs_by_contradiction.
(* Goal: and (@Midpoint Tn X A B) (@Midpoint Tn X P R) *)
apply l7_21;finish.
Qed.
Lemma l8_22_bis : forall A B P R X,
A <> B -> A <> P ->
Perp A B P A -> Perp A B R B ->
Cong A P B R -> Col A B X -> Bet P X R ->
Cong A R P B /\ Midpoint X A B /\ Midpoint X P R.
Proof.
(* Goal: forall (A B P R X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : not (@eq (@Tpoint Tn) A P)) (_ : @Perp Tn A B P A) (_ : @Perp Tn A B R B) (_ : @Cong Tn A P B R) (_ : @Col Tn A B X) (_ : @Bet Tn P X R), and (@Cong Tn A R P B) (and (@Midpoint Tn X A B) (@Midpoint Tn X P R)) *)
intros.
(* Goal: and (@Cong Tn A R P B) (and (@Midpoint Tn X A B) (@Midpoint Tn X P R)) *)
apply l8_22;finish.
(* Goal: @Per Tn A B R *)
(* Goal: @Per Tn B A P *)
apply perp_per_1;finish.
(* Goal: @Per Tn A B R *)
apply perp_per_1;finish;Perp.
Qed.
Lemma perp_in_perp : forall A B C D X, Perp_at X A B C D -> Perp A B C D.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Perp Tn A B C D *)
intros.
(* Goal: @Perp Tn A B C D *)
unfold Perp.
(* Goal: @ex (@Tpoint Tn) (fun X : @Tpoint Tn => @Perp_at Tn X A B C D) *)
exists X.
(* Goal: @Perp_at Tn X A B C D *)
assumption.
Qed.
End T8_4.
Hint Resolve perp_per_1 perp_per_2 perp_col perp_perp_in perp_in_perp : perp.
Section T8_5.
Context `{TnEQD:Tarski_neutral_dimensionless_with_decidable_point_equality}.
Lemma perp_proj : forall A B C D, Perp A B C D -> ~Col A C D -> exists X, Col A B X /\ Perp A X C D.
Lemma l8_24 : forall A B P Q R T,
Perp P A A B ->
Perp Q B A B ->
Col A B T ->
Bet P T Q ->
Bet B R Q ->
Cong A P B R ->
exists X, Midpoint X A B /\ Midpoint X P R.
Lemma col_per2__per : forall A B C P X, A <> B -> Col A B C -> Per A X P -> Per B X P -> Per C X P.
Proof.
(* Goal: forall (A B C P X : @Tpoint Tn) (_ : not (@eq (@Tpoint Tn) A B)) (_ : @Col Tn A B C) (_ : @Per Tn A X P) (_ : @Per Tn B X P), @Per Tn C X P *)
intros.
(* Goal: @Per Tn C X P *)
destruct (symmetric_point_construction P X) as [Q].
(* Goal: @Per Tn C X P *)
exists Q; split.
(* Goal: @Cong Tn C P C Q *)
(* Goal: @Midpoint Tn X P Q *)
assumption.
(* Goal: @Cong Tn C P C Q *)
apply (l4_17 A B); try apply per_double_cong with X; assumption.
Qed.
Lemma perp_in_per_1 :
forall A B C D X,
Perp_at X A B C D ->
Per A X C.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Per Tn A X C *)
intros.
(* Goal: @Per Tn A X C *)
unfold Perp_at in *.
(* Goal: @Per Tn A X C *)
decompose [and] H.
(* Goal: @Per Tn A X C *)
apply H5; Col.
Qed.
Lemma perp_in_per_2 :
forall A B C D X,
Perp_at X A B C D ->
Per A X D.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Per Tn A X D *)
intros.
(* Goal: @Per Tn A X D *)
unfold Perp_at in *.
(* Goal: @Per Tn A X D *)
decompose [and] H.
(* Goal: @Per Tn A X D *)
apply H5; Col.
Qed.
Lemma perp_in_per_3 :
forall A B C D X,
Perp_at X A B C D ->
Per B X C.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Per Tn B X C *)
intros.
(* Goal: @Per Tn B X C *)
unfold Perp_at in *.
(* Goal: @Per Tn B X C *)
decompose [and] H.
(* Goal: @Per Tn B X C *)
apply H5; Col.
Qed.
Lemma perp_in_per_4 :
forall A B C D X,
Perp_at X A B C D ->
Per B X D.
Proof.
(* Goal: forall (A B C D X : @Tpoint Tn) (_ : @Perp_at Tn X A B C D), @Per Tn B X D *)
intros.
(* Goal: @Per Tn B X D *)
unfold Perp_at in *.
(* Goal: @Per Tn B X D *)
decompose [and] H.
(* Goal: @Per Tn B X D *)
apply H5; Col.
Qed.
End T8_5.
Hint Resolve perp_in_per_1 perp_in_per_2 perp_in_per_3 perp_in_per_4 : perp.
Ltac midpoint M A B :=
let T:= fresh in assert (T:= midpoint_existence A B);
ex_and T M.
Tactic Notation "Name" ident(M) "the" "midpoint" "of" ident(A) "and" ident(B) :=
midpoint M A B.
|
Require Import securite.
Lemma POinv1rel8 :
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) ->
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) ->
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)) (_ : 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)), 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)) (_ : 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)), inv1 (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 and1.
(* Goal: inv1 (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: inv1 (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.Tarski_dev.Ch16_coordinates.
Section PythagoreanFun.
Context `{T2D:Tarski_2D}.
Context `{TE:@Tarski_euclidean Tn TnEQD}.
Lemma Ps_Col : forall O E A, Ps O E A -> Col O E A.
Proof.
(* Goal: forall (O E A : @Tpoint Tn) (_ : @Ps Tn O E A), @Col Tn O E A *)
intros.
(* Goal: @Col Tn O E A *)
unfold Ps in H.
(* Goal: @Col Tn O E A *)
apply out_col in H;Col.
Qed.
Lemma PythRel_exists : forall O E E', ~ Col O E E' -> forall A B,
Col O E A -> Col O E B ->
exists C, PythRel O E E' A B C.
Proof.
(* Goal: forall (O E E' : @Tpoint Tn) (_ : not (@Col Tn O E E')) (A B : @Tpoint Tn) (_ : @Col Tn O E A) (_ : @Col Tn O E B), @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
intros.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
assert_diffs.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
destruct (eq_dec_points O B).
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
-
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
subst.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn B E E' A B C) *)
exists A.
(* Goal: @PythRel Tn B E E' A B A *)
unfold PythRel.
(* Goal: and (@Ar2 Tn B E E' A B A) (or (and (@eq (@Tpoint Tn) B B) (or (@eq (@Tpoint Tn) A A) (@Opp Tn B E E' A A))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn B B' B B) (and (@Cong Tn B B' B B) (@Cong Tn B A A B'))))) *)
split.
(* Goal: or (and (@eq (@Tpoint Tn) B B) (or (@eq (@Tpoint Tn) A A) (@Opp Tn B E E' A A))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn B B' B B) (and (@Cong Tn B B' B B) (@Cong Tn B A A B')))) *)
(* Goal: @Ar2 Tn B E E' A B A *)
unfold Ar2;auto.
(* Goal: or (and (@eq (@Tpoint Tn) B B) (or (@eq (@Tpoint Tn) A A) (@Opp Tn B E E' A A))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn B B' B B) (and (@Cong Tn B B' B B) (@Cong Tn B A A B')))) *)
left;auto.
(* BG Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
-
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
destruct (perp_exists O E O) as [X HX].
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
(* Goal: not (@eq (@Tpoint Tn) E O) *)
auto.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
destruct (segment_construction_2 X O O B) as [B' [HB1 HB2]].
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
(* Goal: not (@eq (@Tpoint Tn) X O) *)
assert_diffs;auto.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
destruct (segment_construction_2 E O A B') as [C [HC1 HC2]].
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
(* Goal: not (@eq (@Tpoint Tn) E O) *)
auto.
(* Goal: @ex (@Tpoint Tn) (fun C : @Tpoint Tn => @PythRel Tn O E E' A B C) *)
exists C.
(* Goal: @PythRel Tn O E E' A B C *)
unfold PythRel.
(* Goal: and (@Ar2 Tn O E E' A B C) (or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B'))))) *)
split.
(* Goal: or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')))) *)
(* Goal: @Ar2 Tn O E E' A B C *)
unfold Ar2.
(* Goal: or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')))) *)
(* 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;auto.
(* Goal: or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')))) *)
(* Goal: @Col Tn O E C *)
destruct HC1.
(* Goal: or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')))) *)
(* Goal: @Col Tn O E C *)
(* Goal: @Col Tn O E C *)
auto using bet_col .
(* Goal: or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')))) *)
(* Goal: @Col Tn O E C *)
apply bet_col in H3.
(* Goal: or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')))) *)
(* Goal: @Col Tn O E C *)
Col.
(* Goal: or (and (@eq (@Tpoint Tn) O B) (or (@eq (@Tpoint Tn) A C) (@Opp Tn O E E' A C))) (@ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')))) *)
right.
(* Goal: @ex (@Tpoint Tn) (fun B' : @Tpoint Tn => and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B'))) *)
exists B'.
(* Goal: and (@Perp Tn O B' O B) (and (@Cong Tn O B' O B) (@Cong Tn O C A B')) *)
split.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
assert (Perp O X O B).
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Perp Tn O X O B *)
apply (perp_col1 O X O E B);Col.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Perp Tn O X O E *)
Perp.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
assert (Perp O B O B').
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Perp Tn O B O B' *)
apply (perp_col1 O B O X B').
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
(* Goal: @Perp Tn O B O X *)
(* Goal: not (@eq (@Tpoint Tn) O B') *)
intro;treat_equalities.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
(* Goal: @Perp Tn O B O X *)
(* Goal: False *)
intuition.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
(* Goal: @Perp Tn O B O X *)
Perp.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
destruct HB1.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
(* Goal: @Col Tn O X B' *)
apply bet_col in H6.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
(* Goal: @Col Tn O X B' *)
Col.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
apply bet_col in H6.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
(* Goal: @Col Tn O X B' *)
Col.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
(* Goal: @Perp Tn O B' O B *)
Perp.
(* Goal: and (@Cong Tn O B' O B) (@Cong Tn O C A B') *)
split.
(* Goal: @Cong Tn O C A B' *)
(* Goal: @Cong Tn O B' O B *)
Cong.
(* Goal: @Cong Tn O C A B' *)
Cong.
Qed.
Lemma opp_same_square : forall O E E' A B A2, Opp O E E' A B -> Prod O E E' A A A2 -> Prod O E E' B B A2.
Proof.
(* Goal: forall (O E E' A B A2 : @Tpoint Tn) (_ : @Opp Tn O E E' A B) (_ : @Prod Tn O E E' A A A2), @Prod Tn O E E' B B A2 *)
intros.
(* Goal: @Prod Tn O E E' B B A2 *)
assert(~Col O E E').
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: not (@Col Tn O E E') *)
unfold Prod in H0.
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: not (@Col Tn O E E') *)
spliter.
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: not (@Col Tn O E E') *)
unfold Ar2 in H0.
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: not (@Col Tn O E E') *)
tauto.
(* Goal: @Prod Tn O E E' B B A2 *)
assert(exists ME : Tpoint, Opp O E E' E ME).
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: @ex (@Tpoint Tn) (fun ME : @Tpoint Tn => @Opp Tn O E E' E ME) *)
apply(opp_exists O E E' H1 E); Col; assert(HH:= opp_prod O E E').
(* Goal: @Prod Tn O E E' B B A2 *)
ex_and H2 ME.
(* Goal: @Prod Tn O E E' B B A2 *)
assert(HH:= opp_prod O E E' ME A B H3 H).
(* Goal: @Prod Tn O E E' B B A2 *)
assert(Prod O E E' B ME A).
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: @Prod Tn O E E' B ME A *)
apply(opp_prod O E E' ME B A H3).
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: @Opp Tn O E E' B A *)
apply opp_comm; auto.
(* Goal: @Prod Tn O E E' B B A2 *)
assert(Prod O E E' ME B A).
(* Goal: @Prod Tn O E E' B B A2 *)
(* Goal: @Prod Tn O E E' ME B A *)
apply prod_comm; auto.
(* Goal: @Prod Tn O E E' B B A2 *)
assert(HP:=(prod_assoc O E E' A ME B B A A2 HH H4)).
(* Goal: @Prod Tn O E E' B B A2 *)
destruct HP.
(* Goal: @Prod Tn O E E' B B A2 *)
apply H5.
(* Goal: @Prod Tn O E E' A A A2 *)
assumption.
Qed.
Lemma PythOK : forall O E E' A B C A2 B2 C2, PythRel O E E' A B C ->
Prod O E E' A A A2 ->
Prod O E E' B B B2 ->
Prod O E E' C C C2 ->
Sum O E E' A2 B2 C2.
Proof.
(* Goal: forall (O E E' A B C A2 B2 C2 : @Tpoint Tn) (_ : @PythRel Tn O E E' A B C) (_ : @Prod Tn O E E' A A A2) (_ : @Prod Tn O E E' B B B2) (_ : @Prod Tn O E E' C C C2), @Sum Tn O E E' A2 B2 C2 *)
intros.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
unfold PythRel in H.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
unfold Ar2 in H.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
induction H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
subst B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(B2=O).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @eq (@Tpoint Tn) B2 O *)
apply (prod_O_l_eq O E E' O); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
subst B2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
assert(A2 = C2).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
induction H7.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
subst C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
apply (prod_uniqueness O E E' A A); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
assert(Prod O E E' C C A2).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
(* Goal: @Prod Tn O E E' C C A2 *)
apply(opp_same_square O E E' A); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
(* Goal: @eq (@Tpoint Tn) A2 C2 *)
apply (prod_uniqueness O E E' C C); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O C2 *)
subst C2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 O A2 *)
apply (sum_A_O O E E' ); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E A2 *)
unfold Prod in H0.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E A2 *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E A2 *)
unfold Ar2 in H0; tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(O <> E).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: not (@eq (@Tpoint Tn) O E) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: False *)
subst E.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: False *)
apply H.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O O E' *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H3 B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Per A O B').
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Per Tn A O B' *)
apply l8_2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Per Tn B' O A *)
apply (per_col _ _ B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Per Tn B' O B *)
(* Goal: not (@eq (@Tpoint Tn) O B) *)
apply perp_distinct in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Per Tn B' O B *)
(* Goal: not (@eq (@Tpoint Tn) O B) *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Per Tn B' O B *)
apply perp_in_per.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Perp_at Tn O B' O O B *)
apply perp_in_comm.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Perp_at Tn O O B' B O *)
apply perp_perp_in.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Perp Tn O B' B O *)
Perp.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O B A *)
ColR.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
induction(eq_dec_points A O).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
subst A.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Cong O B O C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Cong Tn O B O C *)
apply cong_transitivity with O B'; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(B = C \/ Midpoint O B C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: or (@eq (@Tpoint Tn) B C) (@Midpoint Tn O B C) *)
apply l7_20; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O C *)
ColR.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
induction H12.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
subst C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(B2 = C2).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @eq (@Tpoint Tn) B2 C2 *)
apply(prod_uniqueness O E E' B B); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
subst C2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 B2 *)
assert(A2=O).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 B2 *)
(* Goal: @eq (@Tpoint Tn) A2 O *)
apply(prod_uniqueness O E E' O O); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 B2 *)
(* Goal: @Prod Tn O E E' O O O *)
apply prod_0_l; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 B2 *)
subst A2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' O B2 B2 *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B2 *)
unfold Prod in H2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B2 *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B2 *)
unfold Ar2 in H2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B2 *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(A2=O).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @eq (@Tpoint Tn) A2 O *)
apply(prod_uniqueness O E E' O O); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' O O O *)
apply prod_0_l; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
subst A2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' O B2 C2 *)
apply (midpoint_opp O E E') in H12; unfold Midpoint in H12.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Sum Tn O E E' O B2 C2 *)
assert(C2 = B2).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Sum Tn O E E' O B2 C2 *)
(* Goal: @eq (@Tpoint Tn) C2 B2 *)
apply(prod_uniqueness O E E' C C);auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Sum Tn O E E' O B2 C2 *)
(* Goal: @Prod Tn O E E' C C B2 *)
apply (opp_same_square O E E' B C); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Sum Tn O E E' O B2 C2 *)
subst C2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Sum Tn O E E' O B2 B2 *)
apply sum_O_B; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Col Tn O E B2 *)
unfold Prod in H2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Col Tn O E B2 *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Col Tn O E B2 *)
unfold Ar2 in H2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
(* Goal: @Col Tn O E B2 *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ar2 Tn O E E' O B C *)
unfold Ar2.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@Col Tn O E E')) (and (@Col Tn O E O) (and (@Col Tn O E B) (@Col Tn O E C))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
induction(out_dec O A E); induction(out_dec O B E);induction(out_dec O C E).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O A B C A2 B2 C2); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Length Tn O E E' A B' C *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E C) (and (@LeP Tn O E E' O C) (@Cong Tn O C A B'))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @LeP Tn O E E' O C *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: or (@LtP Tn O E E' O C) (@eq (@Tpoint Tn) O C) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @LtP Tn O E E' O C *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' C O D) (@Ps Tn O E D)) *)
exists C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: and (@Diff Tn O E E' C O C) (@Ps Tn O E C) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Ps Tn O E C *)
(* Goal: @Diff Tn O E E' C O C *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Ps Tn O E C *)
(* Goal: @Sum Tn O E E' O C C *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Ps Tn O E C *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Out Tn O C E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E A) (and (@LeP Tn O E E' O A) (@Cong Tn O A A O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @LeP Tn O E E' O A *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: or (@LtP Tn O E E' O A) (@eq (@Tpoint Tn) O A) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @LtP Tn O E E' O A *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' A O D) (@Ps Tn O E D)) *)
exists A.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: and (@Diff Tn O E E' A O A) (@Ps Tn O E A) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Diff Tn O E E' A O A *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Sum Tn O E E' O A A *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Ps Tn O E A *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Out Tn O A E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Length Tn O E E' B' O B *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E B) (and (@LeP Tn O E E' O B) (@Cong Tn O B B' O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @LeP Tn O E E' O B *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: or (@LtP Tn O E E' O B) (@eq (@Tpoint Tn) O B) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @LtP Tn O E E' O B *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' B O D) (@Ps Tn O E D)) *)
exists B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (@Diff Tn O E E' B O B) (@Ps Tn O E B) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Diff Tn O E E' B O B *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Sum Tn O E E' O B B *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E B *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Out Tn O B E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OC : Tpoint, Opp O E E' C OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OC : @Tpoint Tn => @Opp Tn O E E' C OC) *)
apply(opp_exists O E E' H C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E C *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H15 OC.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E C *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) C O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn C O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: not (@eq (@Tpoint Tn) C O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_symmetry in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_identity in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_right_comm in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_not_col in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: @Col Tn O A B *)
ColR.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
apply not_out_bet in H14.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
(* Goal: @Bet Tn C O E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OC *)
apply(opp_neg_pos O E E' C OC); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O A B OC A2 B2 C2); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Length Tn O E E' A B' OC *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OC) (and (@LeP Tn O E E' O OC) (@Cong Tn O OC A B'))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
apply out_col in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: or (@LtP Tn O E E' O OC) (@eq (@Tpoint Tn) O OC) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LtP Tn O E E' O OC *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OC O D) (@Ps Tn O E D)) *)
exists OC.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: and (@Diff Tn O E E' OC O OC) (@Ps Tn O E OC) *)
split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Diff Tn O E E' OC O OC *)
apply diff_A_O; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
apply opp_midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
unfold Midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
apply cong_transitivity with O C; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O A *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E A) (and (@LeP Tn O E E' O A) (@Cong Tn O A A O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @LeP Tn O E E' O A *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: or (@LtP Tn O E E' O A) (@eq (@Tpoint Tn) O A) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @LtP Tn O E E' O A *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' A O D) (@Ps Tn O E D)) *)
exists A.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: and (@Diff Tn O E E' A O A) (@Ps Tn O E A) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Diff Tn O E E' A O A *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Sum Tn O E E' O A A *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Ps Tn O E A *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Out Tn O A E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Length Tn O E E' B' O B *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E B) (and (@LeP Tn O E E' O B) (@Cong Tn O B B' O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @LeP Tn O E E' O B *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: or (@LtP Tn O E E' O B) (@eq (@Tpoint Tn) O B) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @LtP Tn O E E' O B *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' B O D) (@Ps Tn O E D)) *)
exists B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: and (@Diff Tn O E E' B O B) (@Ps Tn O E B) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Diff Tn O E E' B O B *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Sum Tn O E E' O B B *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Ps Tn O E B *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Out Tn O B E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
apply(opp_same_square O E E' C OC C2 H16 H2).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OB : Tpoint, Opp O E E' B OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OB : @Tpoint Tn => @Opp Tn O E E' B OB) *)
apply(opp_exists O E E' H B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H15 OB.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E B *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) B O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn B O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: not (@eq (@Tpoint Tn) B O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply cong_identity in H8.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply perp_distinct in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
apply not_out_bet in H13.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
(* Goal: @Bet Tn B O E *)
bet.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OB *)
apply(opp_neg_pos O E E' B OB); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O A OB C A2 B2 C2); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Length Tn O E E' A B' C *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E C) (and (@LeP Tn O E E' O C) (@Cong Tn O C A B'))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @LeP Tn O E E' O C *)
unfold Ps in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @LeP Tn O E E' O C *)
apply out_col in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @LeP Tn O E E' O C *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @LeP Tn O E E' O C *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: or (@LtP Tn O E E' O C) (@eq (@Tpoint Tn) O C) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @LtP Tn O E E' O C *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' C O D) (@Ps Tn O E D)) *)
exists C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: and (@Diff Tn O E E' C O C) (@Ps Tn O E C) *)
split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Diff Tn O E E' C O C *)
apply diff_A_O; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
unfold Ps in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E A) (and (@LeP Tn O E E' O A) (@Cong Tn O A A O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @LeP Tn O E E' O A *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: or (@LtP Tn O E E' O A) (@eq (@Tpoint Tn) O A) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @LtP Tn O E E' O A *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' A O D) (@Ps Tn O E D)) *)
exists A.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: and (@Diff Tn O E E' A O A) (@Ps Tn O E A) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Diff Tn O E E' A O A *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Sum Tn O E E' O A A *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Ps Tn O E A *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Out Tn O A E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OB) (and (@LeP Tn O E E' O OB) (@Cong Tn O OB B' O))) *)
repeat split; Cong; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LeP Tn O E E' O OB *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: or (@LtP Tn O E E' O OB) (@eq (@Tpoint Tn) O OB) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LtP Tn O E E' O OB *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OB O D) (@Ps Tn O E D)) *)
exists OB.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: and (@Diff Tn O E E' OB O OB) (@Ps Tn O E OB) *)
split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Diff Tn O E E' OB O OB *)
apply diff_A_O; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Col Tn O E OB *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
apply opp_midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
unfold Midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
apply cong_transitivity with O B; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
apply(opp_same_square O E E' B OB B2 H16 H1).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OC : Tpoint, Opp O E E' C OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OC : @Tpoint Tn => @Opp Tn O E E' C OC) *)
apply(opp_exists O E E' H C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E C *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H15 OC.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E C *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) C O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn C O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: not (@eq (@Tpoint Tn) C O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_symmetry in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_identity in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_right_comm in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_not_col in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: @Col Tn O A B *)
ColR.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
apply not_out_bet in H14.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
(* Goal: @Bet Tn C O E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OC *)
apply(opp_neg_pos O E E' C OC); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OB : Tpoint, Opp O E E' B OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OB : @Tpoint Tn => @Opp Tn O E E' B OB) *)
apply(opp_exists O E E' H B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H18 OB.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E B *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) B O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn B O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: not (@eq (@Tpoint Tn) B O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply cong_identity in H8.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply perp_distinct in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
apply not_out_bet in H13.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
(* Goal: @Bet Tn B O E *)
bet.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OB *)
apply(opp_neg_pos O E E' B OB); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O A OB OC A2 B2 C2); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Length Tn O E E' A B' OC *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OC) (and (@LeP Tn O E E' O OC) (@Cong Tn O OC A B'))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
apply out_col in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: or (@LtP Tn O E E' O OC) (@eq (@Tpoint Tn) O OC) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LtP Tn O E E' O OC *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OC O D) (@Ps Tn O E D)) *)
exists OC.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: and (@Diff Tn O E E' OC O OC) (@Ps Tn O E OC) *)
split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Diff Tn O E E' OC O OC *)
apply diff_A_O; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
apply opp_midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
unfold Midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
(* Goal: @Cong Tn O OC A B' *)
apply cong_transitivity with O C; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O A *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E A) (and (@LeP Tn O E E' O A) (@Cong Tn O A A O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @LeP Tn O E E' O A *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: or (@LtP Tn O E E' O A) (@eq (@Tpoint Tn) O A) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @LtP Tn O E E' O A *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' A O D) (@Ps Tn O E D)) *)
exists A.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: and (@Diff Tn O E E' A O A) (@Ps Tn O E A) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Diff Tn O E E' A O A *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Ps Tn O E A *)
(* Goal: @Sum Tn O E E' O A A *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Ps Tn O E A *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Out Tn O A E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Length Tn O E E' B' O OB *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OB) (and (@LeP Tn O E E' O OB) (@Cong Tn O OB B' O))) *)
repeat split; Cong; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LeP Tn O E E' O OB *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: or (@LtP Tn O E E' O OB) (@eq (@Tpoint Tn) O OB) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LtP Tn O E E' O OB *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OB O D) (@Ps Tn O E D)) *)
exists OB.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: and (@Diff Tn O E E' OB O OB) (@Ps Tn O E OB) *)
split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Diff Tn O E E' OB O OB *)
apply diff_A_O; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Col Tn O E OB *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
apply opp_midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
unfold Midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Cong Tn O OB B' O *)
apply cong_transitivity with O B; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
apply(opp_same_square O E E' B OB B2 H19 H1).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
apply(opp_same_square O E E' C OC C2 H16 H2).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OA : Tpoint, Opp O E E' A OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OA : @Tpoint Tn => @Opp Tn O E E' A OA) *)
apply(opp_exists O E E' H A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E A *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H15 OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E A *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) A O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn A O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn A O E *)
apply not_out_bet in H12;auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O OA B C A2 B2 C2); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Length Tn O E E' A B' C *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E C) (and (@LeP Tn O E E' O C) (@Cong Tn O C A B'))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @LeP Tn O E E' O C *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: or (@LtP Tn O E E' O C) (@eq (@Tpoint Tn) O C) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @LtP Tn O E E' O C *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' C O D) (@Ps Tn O E D)) *)
exists C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: and (@Diff Tn O E E' C O C) (@Ps Tn O E C) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Ps Tn O E C *)
(* Goal: @Diff Tn O E E' C O C *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Ps Tn O E C *)
(* Goal: @Sum Tn O E E' O C C *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Ps Tn O E C *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Out Tn O C E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
assert(Col O E OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Col Tn O E OA *)
unfold Opp in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Col Tn O E OA *)
unfold Sum in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Col Tn O E OA *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Col Tn O E OA *)
unfold Ar2 in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Col Tn O E OA *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OA) (and (@LeP Tn O E E' O OA) (@Cong Tn O OA A O))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LeP Tn O E E' O OA *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: or (@LtP Tn O E E' O OA) (@eq (@Tpoint Tn) O OA) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LtP Tn O E E' O OA *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OA O D) (@Ps Tn O E D)) *)
exists OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: and (@Diff Tn O E E' OA O OA) (@Ps Tn O E OA) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Diff Tn O E E' OA O OA *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Sum Tn O E E' O OA OA *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply opp_midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
unfold Midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply not_out_bet in H12.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
assert(HP:=l5_2 A O E OA H11 H12 H16).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
unfold Out.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: and (not (@eq (@Tpoint Tn) OA O)) (and (not (@eq (@Tpoint Tn) E O)) (or (@Bet Tn O OA E) (@Bet Tn O E OA))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: not (@eq (@Tpoint Tn) OA O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
subst OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
apply cong_identity in H18.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
contradiction.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
induction HP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
right; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
left; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
unfold Opp in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
apply opp_midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
unfold Midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
unfold Sum in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E B) (and (@LeP Tn O E E' O B) (@Cong Tn O B B' O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @LeP Tn O E E' O B *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: or (@LtP Tn O E E' O B) (@eq (@Tpoint Tn) O B) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @LtP Tn O E E' O B *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' B O D) (@Ps Tn O E D)) *)
exists B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: and (@Diff Tn O E E' B O B) (@Ps Tn O E B) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Diff Tn O E E' B O B *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Sum Tn O E E' O B B *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Ps Tn O E B *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Out Tn O B E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
apply(opp_same_square O E E' A OA A2 H16 H0).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OC : Tpoint, Opp O E E' C OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OC : @Tpoint Tn => @Opp Tn O E E' C OC) *)
apply(opp_exists O E E' H C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E C *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H15 OC.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E C *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) C O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn C O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: not (@eq (@Tpoint Tn) C O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_symmetry in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_identity in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_right_comm in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_not_col in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: @Col Tn O A B *)
ColR.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
apply not_out_bet in H14.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
(* Goal: @Bet Tn C O E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OC *)
apply(opp_neg_pos O E E' C OC); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OA : Tpoint, Opp O E E' A OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OA : @Tpoint Tn => @Opp Tn O E E' A OA) *)
apply(opp_exists O E E' H A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E A *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H18 OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E A *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) A O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn A O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn A O E *)
apply not_out_bet in H12;auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Col O E OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Opp in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Sum in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Ar2 in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O OA B OC A2 B2 C2); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Length Tn O E E' A B' OC *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OC) (and (@LeP Tn O E E' O OC) (@Cong Tn O OC A B'))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
apply out_col in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: or (@LtP Tn O E E' O OC) (@eq (@Tpoint Tn) O OC) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LtP Tn O E E' O OC *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OC O D) (@Ps Tn O E D)) *)
exists OC.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: and (@Diff Tn O E E' OC O OC) (@Ps Tn O E OC) *)
split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Diff Tn O E E' OC O OC *)
apply diff_A_O; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H17.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
apply opp_midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
unfold Midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
apply cong_transitivity with O C; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Length Tn O E E' A O OA *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OA) (and (@LeP Tn O E E' O OA) (@Cong Tn O OA A O))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LeP Tn O E E' O OA *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: or (@LtP Tn O E E' O OA) (@eq (@Tpoint Tn) O OA) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LtP Tn O E E' O OA *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OA O D) (@Ps Tn O E D)) *)
exists OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: and (@Diff Tn O E E' OA O OA) (@Ps Tn O E OA) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Diff Tn O E E' OA O OA *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Sum Tn O E E' O OA OA *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply opp_midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
unfold Midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply not_out_bet in H12.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
assert(HP:=l5_2 A O E OA H11 H12 H19).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
unfold Out.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: and (not (@eq (@Tpoint Tn) OA O)) (and (not (@eq (@Tpoint Tn) E O)) (or (@Bet Tn O OA E) (@Bet Tn O E OA))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: not (@eq (@Tpoint Tn) OA O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
subst OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
apply cong_identity in H21.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
contradiction.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
induction HP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
right; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
left; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
apply opp_midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
unfold Midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
(* Goal: @Cong Tn O OA A O *)
Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O B *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E B) (and (@LeP Tn O E E' O B) (@Cong Tn O B B' O))) *)
repeat split; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @LeP Tn O E E' O B *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: or (@LtP Tn O E E' O B) (@eq (@Tpoint Tn) O B) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @LtP Tn O E E' O B *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' B O D) (@Ps Tn O E D)) *)
exists B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: and (@Diff Tn O E E' B O B) (@Ps Tn O E B) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Diff Tn O E E' B O B *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Ps Tn O E B *)
(* Goal: @Sum Tn O E E' O B B *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Ps Tn O E B *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Out Tn O B E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
apply(opp_same_square O E E' A OA A2 H19 H0).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OC OC C2 *)
apply(opp_same_square O E E' C OC C2 H16 H2).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OB : Tpoint, Opp O E E' B OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OB : @Tpoint Tn => @Opp Tn O E E' B OB) *)
apply(opp_exists O E E' H B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H15 OB.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E B *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) B O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn B O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: not (@eq (@Tpoint Tn) B O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply cong_identity in H8.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply perp_distinct in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
apply not_out_bet in H13.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
(* Goal: @Bet Tn B O E *)
bet.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OB *)
apply(opp_neg_pos O E E' B OB); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OA : Tpoint, Opp O E E' A OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OA : @Tpoint Tn => @Opp Tn O E E' A OA) *)
apply(opp_exists O E E' H A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E A *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H18 OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E A *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) A O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn A O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn A O E *)
apply not_out_bet in H12;auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Col O E OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Opp in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Sum in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Ar2 in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O OA OB C A2 B2 C2); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Length Tn O E E' A B' C *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E C) (and (@LeP Tn O E E' O C) (@Cong Tn O C A B'))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @LeP Tn O E E' O C *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: or (@LtP Tn O E E' O C) (@eq (@Tpoint Tn) O C) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @LtP Tn O E E' O C *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' C O D) (@Ps Tn O E D)) *)
exists C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: and (@Diff Tn O E E' C O C) (@Ps Tn O E C) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Ps Tn O E C *)
(* Goal: @Diff Tn O E E' C O C *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Ps Tn O E C *)
(* Goal: @Sum Tn O E E' O C C *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Ps Tn O E C *)
auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OA) (and (@LeP Tn O E E' O OA) (@Cong Tn O OA A O))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LeP Tn O E E' O OA *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: or (@LtP Tn O E E' O OA) (@eq (@Tpoint Tn) O OA) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LtP Tn O E E' O OA *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OA O D) (@Ps Tn O E D)) *)
exists OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: and (@Diff Tn O E E' OA O OA) (@Ps Tn O E OA) *)
split.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Diff Tn O E E' OA O OA *)
apply sum_diff.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Sum Tn O E E' O OA OA *)
apply sum_O_B; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
unfold Ps.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply opp_midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
unfold Midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply not_out_bet in H12.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
assert(HP:=l5_2 A O E OA H11 H12 H19).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
unfold Out.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: and (not (@eq (@Tpoint Tn) OA O)) (and (not (@eq (@Tpoint Tn) E O)) (or (@Bet Tn O OA E) (@Bet Tn O E OA))) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: not (@eq (@Tpoint Tn) OA O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
subst OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
apply cong_identity in H21.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
contradiction.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
induction HP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
right; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
left; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
apply opp_midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
unfold Midpoint in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
unfold Length.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OB) (and (@LeP Tn O E E' O OB) (@Cong Tn O OB B' O))) *)
repeat split; Cong; Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LeP Tn O E E' O OB *)
unfold LeP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: or (@LtP Tn O E E' O OB) (@eq (@Tpoint Tn) O OB) *)
left.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LtP Tn O E E' O OB *)
unfold LtP.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OB O D) (@Ps Tn O E D)) *)
exists OB.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: and (@Diff Tn O E E' OB O OB) (@Ps Tn O E OB) *)
split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Diff Tn O E E' OB O OB *)
apply diff_A_O; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Col Tn O E OB *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
apply opp_midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
unfold Midpoint in H16.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
apply cong_transitivity with O B; Cong.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
apply(opp_same_square O E E' A OA A2 H19 H0).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
apply(opp_same_square O E E' B OB B2 H16 H1).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OC : Tpoint, Opp O E E' C OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OC : @Tpoint Tn => @Opp Tn O E E' C OC) *)
apply(opp_exists O E E' H C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E C *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H15 OC.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E C).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E C *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) C O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn C O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: not (@eq (@Tpoint Tn) C O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst C.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_symmetry in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply cong_identity in H9.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_right_comm in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply perp_not_col in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: False *)
apply H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
(* Goal: @Col Tn O A B *)
ColR.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn C O E *)
apply not_out_bet in H14.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
(* Goal: @Bet Tn C O E *)
assumption.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn C O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OC).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OC *)
apply(opp_neg_pos O E E' C OC); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OA : Tpoint, Opp O E E' A OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OA : @Tpoint Tn => @Opp Tn O E E' A OA) *)
apply(opp_exists O E E' H A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E A *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H18 OA.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E A).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E A *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) A O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn A O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn A O E *)
apply not_out_bet in H12;auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Col O E OA).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Opp in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Sum in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
spliter.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
unfold Ar2 in H19.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E OA *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(exists OB : Tpoint, Opp O E E' B OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @ex (@Tpoint Tn) (fun OB : @Tpoint Tn => @Opp Tn O E E' B OB) *)
apply(opp_exists O E E' H B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn O E B *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
ex_and H21 OB.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ng O E B).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ng Tn O E B *)
unfold Ng.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: and (not (@eq (@Tpoint Tn) B O)) (and (not (@eq (@Tpoint Tn) E O)) (@Bet Tn B O E)) *)
repeat split; auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: not (@eq (@Tpoint Tn) B O) *)
intro.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply cong_identity in H8.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
subst B'.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
apply perp_distinct in H3.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
(* Goal: False *)
tauto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Bet Tn B O E *)
apply not_out_bet in H13.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
(* Goal: @Bet Tn B O E *)
bet.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Col Tn B O E *)
Col.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
assert(Ps O E OB).
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
(* Goal: @Ps Tn O E OB *)
apply(opp_neg_pos O E E' B OB); auto.
(* Goal: @Sum Tn O E E' A2 B2 C2 *)
apply(pythagoras O E E' A B' O OA OB OC A2 B2 C2); auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Length Tn O E E' A B' OC *)
unfold Length.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OC) (and (@LeP Tn O E E' O OC) (@Cong Tn O OC A B'))) *)
repeat split; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H17.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
apply out_col in H17.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LeP Tn O E E' O OC *)
unfold LeP.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: or (@LtP Tn O E E' O OC) (@eq (@Tpoint Tn) O OC) *)
left.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @LtP Tn O E E' O OC *)
unfold LtP.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OC O D) (@Ps Tn O E D)) *)
exists OC.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: and (@Diff Tn O E E' OC O OC) (@Ps Tn O E OC) *)
split; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Diff Tn O E E' OC O OC *)
apply diff_A_O; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
unfold Ps in H17.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
(* Goal: @Col Tn O E OC *)
Col.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
apply opp_midpoint in H16.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
unfold Midpoint in H16.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
spliter.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
(* Goal: @Cong Tn O OC A B' *)
apply cong_transitivity with O C; Cong.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Length Tn O E E' A O OA *)
unfold Length.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OA) (and (@LeP Tn O E E' O OA) (@Cong Tn O OA A O))) *)
repeat split; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LeP Tn O E E' O OA *)
unfold LeP.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: or (@LtP Tn O E E' O OA) (@eq (@Tpoint Tn) O OA) *)
left.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @LtP Tn O E E' O OA *)
unfold LtP.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OA O D) (@Ps Tn O E D)) *)
exists OA.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: and (@Diff Tn O E E' OA O OA) (@Ps Tn O E OA) *)
split.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Diff Tn O E E' OA O OA *)
apply sum_diff.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
(* Goal: @Sum Tn O E E' O OA OA *)
apply sum_O_B; Col.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Ps Tn O E OA *)
unfold Ps.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply opp_midpoint in H19.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
unfold Midpoint in H19.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
spliter.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Out Tn O OA E *)
apply not_out_bet in H12.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
assert(HP:=l5_2 A O E OA H11 H12 H19).
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: @Out Tn O OA E *)
unfold Out.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: and (not (@eq (@Tpoint Tn) OA O)) (and (not (@eq (@Tpoint Tn) E O)) (or (@Bet Tn O OA E) (@Bet Tn O E OA))) *)
repeat split; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: not (@eq (@Tpoint Tn) OA O) *)
intro.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
subst OA.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
apply cong_identity in H24.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: False *)
contradiction.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
induction HP.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
right; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
(* Goal: or (@Bet Tn O OA E) (@Bet Tn O E OA) *)
left; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
(* Goal: @Col Tn A O E *)
Col.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
apply opp_midpoint in H19.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
unfold Midpoint in H19.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
spliter.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
(* Goal: @Cong Tn O OA A O *)
Cong.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Length Tn O E E' B' O OB *)
unfold Length.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: and (not (@eq (@Tpoint Tn) O E)) (and (@Col Tn O E OB) (and (@LeP Tn O E E' O OB) (@Cong Tn O OB B' O))) *)
repeat split; Cong; Col.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LeP Tn O E E' O OB *)
unfold LeP.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: or (@LtP Tn O E E' O OB) (@eq (@Tpoint Tn) O OB) *)
left.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @LtP Tn O E E' O OB *)
unfold LtP.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @ex (@Tpoint Tn) (fun D : @Tpoint Tn => and (@Diff Tn O E E' OB O D) (@Ps Tn O E D)) *)
exists OB.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: and (@Diff Tn O E E' OB O OB) (@Ps Tn O E OB) *)
split; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Diff Tn O E E' OB O OB *)
apply diff_A_O; auto.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
(* Goal: @Col Tn O E OB *)
Col.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
apply opp_midpoint in H22.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
unfold Midpoint in H22.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
spliter.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
(* Goal: @Cong Tn O OB B' O *)
apply cong_transitivity with O B; Cong.
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
(* Goal: @Prod Tn O E E' OA OA A2 *)
apply(opp_same_square O E E' A OA A2 H19 H0).
(* Goal: @Prod Tn O E E' OC OC C2 *)
(* Goal: @Prod Tn O E E' OB OB B2 *)
apply(opp_same_square O E E' B OB B2 H22 H1).
(* Goal: @Prod Tn O E E' OC OC C2 *)
apply(opp_same_square O E E' C OC C2 H16 H2).
Qed.
Lemma PythRel_uniqueness : forall O E E' A B C1 C2,
PythRel O E E' A B C1 ->
PythRel O E E' A B C2 ->
((Ps O E C1 /\ Ps O E C2) \/ C1 = O)->
C1 = C2.
Proof.
(* Goal: forall (O E E' A B C1 C2 : @Tpoint Tn) (_ : @PythRel Tn O E E' A B C1) (_ : @PythRel Tn O E E' A B C2) (_ : or (and (@Ps Tn O E C1) (@Ps Tn O E C2)) (@eq (@Tpoint Tn) C1 O)), @eq (@Tpoint Tn) C1 C2 *)
intros.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold PythRel in *.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Ar2 in *.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
clean_duplicated_hyps; induction H2; induction H3.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst B.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H4; induction H3.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst C1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) A C2 *)
subst C2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) A A *)
auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst A.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Opp in H3.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
apply sum_comm in H3; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(HP:=sum_pos_pos O E E' C1 C2 O H1 H2 H3).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(HQ:=O_not_positive O E).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
contradiction.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst C1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
unfold Opp in H3.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
apply (sum_A_O_eq O E E') in H3; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst C2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
induction H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
unfold Opp in H2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
assert(HP:=sum_pos_pos O E E' C1 A O H1 H3 H2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
assert(HQ:=O_not_positive O E).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
contradiction.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 A *)
subst C1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O A *)
unfold Opp in H2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O A *)
apply(sum_O_B_eq O E E') in H2; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Opp in *.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
eapply (sum_uniquenessA O E E' H A C1 C2 O); auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
ex_and H2 B'.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst B.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
apply perp_distinct in H2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
tauto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
ex_and H0 B'.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst B.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
apply perp_distinct in H0.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
tauto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
ex_and H0 B1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
ex_and H2 B2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Cong O B1 O B2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O B1 O B2 *)
apply cong_transitivity with O B; Cong.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert (O <> E).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: not (@eq (@Tpoint Tn) O E) *)
intro.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: False *)
subst E.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: False *)
apply H;Col.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(HH:= perp2__col O B1 B2 O B H0 H2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(B1 = B2 \/ Midpoint O B1 B2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: or (@eq (@Tpoint Tn) B1 B2) (@Midpoint Tn O B1 B2) *)
apply l7_20; Col.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H13.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst B2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
clean_duplicated_hyps.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
clean_trivial_hyps.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Cong O C2 O C1).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C2 O C1 *)
apply cong_transitivity with A B1; Cong.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(C1 = C2 \/ Midpoint O C1 C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: or (@eq (@Tpoint Tn) C1 C2) (@Midpoint Tn O C1 C2) *)
apply l7_20.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C1 O C2 *)
(* Goal: @Col Tn C1 O C2 *)
ColR.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C1 O C2 *)
Cong.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H5.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assumption.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Ps in H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Ps in H2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Out O C1 C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Out Tn O C1 C2 *)
apply (out2_out_1 _ _ _ E); apply l6_6; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Midpoint in H5.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
apply l6_4_1 in H5; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
tauto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst C1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
unfold Midpoint in H5.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
apply cong_symmetry in H5.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
apply (cong_identity O C2 O);auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction(eq_dec_points A O).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst A.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Cong O C1 O C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C1 O C2 *)
apply cong_transitivity with O B2; trivial.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O B2 O C2 *)
apply cong_transitivity with O B1; Cong.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(C1 = C2 \/ Midpoint O C1 C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: or (@eq (@Tpoint Tn) C1 C2) (@Midpoint Tn O C1 C2) *)
apply l7_20; eCol.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H15.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assumption.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Ps in H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Ps in H2.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Out O C1 C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Out Tn O C1 C2 *)
apply (out2_out_1 _ _ _ E); apply l6_6; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Midpoint in H15.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
apply l6_4_1 in H15; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
tauto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst C1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
apply cong_symmetry in H5.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) O C2 *)
apply (cong_identity O C2 O);auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C2 O O *)
Cong.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Per A O B1).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Per Tn A O B1 *)
apply perp_in_per.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Perp_at Tn O A O O B1 *)
apply perp_in_comm.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Perp_at Tn O O A B1 O *)
apply perp_perp_in.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Perp Tn O A B1 O *)
apply (perp_col O B ).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Perp Tn O B B1 O *)
(* Goal: not (@eq (@Tpoint Tn) O A) *)
auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Col Tn O B A *)
(* Goal: @Perp Tn O B B1 O *)
Perp.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Col Tn O B A *)
ColR.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Per in H15.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
ex_and H15 B2'.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(B2 = B2').
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) B2 B2' *)
apply (symmetric_point_uniqueness B1 O); auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst B2'.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Cong O C1 O C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C1 O C2 *)
apply cong_transitivity with A B2; trivial.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn A B2 O C2 *)
apply cong_transitivity with A B1; Cong.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(C1 = C2 \/ Midpoint O C1 C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: or (@eq (@Tpoint Tn) C1 C2) (@Midpoint Tn O C1 C2) *)
apply l7_20.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C1 O C2 *)
(* Goal: @Col Tn C1 O C2 *)
ColR.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Cong Tn O C1 O C2 *)
Cong.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H18.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assumption.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
induction H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Ps in H1.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Ps in H19.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
assert(Out O C1 C2).
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @Out Tn O C1 C2 *)
apply (out2_out_1 _ _ _ E); apply l6_6; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
unfold Midpoint in H18.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
spliter.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
apply l6_4_1 in H18; auto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
tauto.
(* Goal: @eq (@Tpoint Tn) C1 C2 *)
subst C1.
(* Goal: @eq (@Tpoint Tn) O C2 *)
apply cong_symmetry in H17.
(* Goal: @eq (@Tpoint Tn) O C2 *)
apply (cong_identity O C2 O);auto.
Qed.
End PythagoreanFun.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_equalanglessymmetric.
Section Euclid.
Context `{Ax1:euclidean_neutral_ruler_compass}.
Lemma lemma_angledistinct :
forall A B C a b c,
CongA A B C a b c ->
neq A B /\ neq B C /\ neq A C /\ neq a b /\ neq b c /\ neq a c.
Proof.
(* Goal: forall (A B C a b c : @Point Ax) (_ : @CongA Ax A B C a b c), and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
intros.
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (nCol A B C) by (conclude_def CongA ).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (~ eq A B).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
(* Goal: not (@eq Ax A B) *)
{
(* Goal: not (@eq Ax A B) *)
intro.
(* Goal: False *)
assert (Col A B C) by (conclude_def Col ).
(* Goal: False *)
contradict.
(* BG Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
}
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (~ eq B C).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax 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 (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
}
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (~ eq A C).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
(* Goal: not (@eq Ax A C) *)
{
(* Goal: not (@eq Ax A C) *)
intro.
(* Goal: False *)
assert (Col A B C) by (conclude_def Col ).
(* Goal: False *)
contradict.
(* BG Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
}
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (CongA a b c A B C) by (conclude lemma_equalanglessymmetric).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (nCol a b c) by (conclude_def CongA ).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (~ eq a b).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
(* Goal: not (@eq Ax a b) *)
{
(* Goal: not (@eq Ax a b) *)
intro.
(* Goal: False *)
assert (Col a b c) by (conclude_def Col ).
(* Goal: False *)
contradict.
(* BG Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
}
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (~ eq b c).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax 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 (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
}
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
assert (~ eq a c).
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
(* Goal: not (@eq Ax a c) *)
{
(* Goal: not (@eq Ax a c) *)
intro.
(* Goal: False *)
assert (Col a b c) by (conclude_def Col ).
(* Goal: False *)
contradict.
(* BG Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
}
(* Goal: and (@neq Ax A B) (and (@neq Ax B C) (and (@neq Ax A C) (and (@neq Ax a b) (and (@neq Ax b c) (@neq Ax a c))))) *)
close.
Qed.
End Euclid.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence.
Require Export GeoCoq.Elements.OriginalProofs.lemma_3_6b.
Require Export GeoCoq.Elements.OriginalProofs.lemma_partnotequalwhole.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_trichotomy2 :
forall A B C D,
Lt A B C D ->
~ Lt C D A B.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @Lt Ax0 A B C D), not (@Lt Ax0 C D A B) *)
intros.
(* Goal: not (@Lt Ax0 C D A B) *)
let Tf:=fresh in assert (Tf:exists E, (BetS C E D /\ Cong C E A B)) by (conclude_def Lt );destruct Tf as [E];spliter.
(* Goal: not (@Lt Ax0 C D A B) *)
assert (Cong A B C E) by (conclude lemma_congruencesymmetric).
(* Goal: not (@Lt Ax0 C D A B) *)
assert (~ Lt C D A B).
(* Goal: not (@Lt Ax0 C D A B) *)
(* Goal: not (@Lt Ax0 C D A B) *)
{
(* Goal: not (@Lt Ax0 C D A B) *)
intro.
(* Goal: False *)
assert (Lt C D C E) by (conclude lemma_lessthancongruence).
(* Goal: False *)
let Tf:=fresh in assert (Tf:exists F, (BetS C F E /\ Cong C F C D)) by (conclude_def Lt );destruct Tf as [F];spliter.
(* Goal: False *)
assert (BetS C F D) by (conclude lemma_3_6b).
(* Goal: False *)
assert (~ Cong C F C D) by (conclude lemma_partnotequalwhole).
(* Goal: False *)
contradict.
(* BG Goal: not (@Lt Ax0 C D A B) *)
}
(* Goal: not (@Lt Ax0 C D A B) *)
close.
Qed.
End Euclid.
|
Require Import Ensf_types.
Require Import Ensf_dans.
Require Import Ensf_union.
Require Import Ensf_couple.
Require Import Ensf_inclus.
Require Import Ensf_map.
Definition injgauche (e : Elt) : Elt := couple e zero.
Definition injdroite (e : Elt) : Elt := couple e un.
Definition union_disj (e f : Ensf) : Ensf :=
union (map injgauche e) (map injdroite f).
Lemma dans_map_injg :
forall (e : Ensf) (x : Elt), dans x (map injgauche e) -> dans (first x) e.
Lemma dans_map_injd :
forall (e : Ensf) (x : Elt), dans x (map injdroite e) -> dans (first x) e.
Lemma absurd_injg_injd :
forall (x : Elt) (e f : Ensf),
dans x (map injgauche e) -> ~ dans x (map injdroite f).
Lemma union_disj1 :
forall (x : Elt) (a b : Ensf),
dans x (union_disj a b) ->
(exists y : Elt, dans y a /\ x = injgauche y :>Elt) \/
(exists y : Elt, dans y b /\ x = injdroite y :>Elt).
Lemma union_disj_d :
forall (x : Elt) (a b : Ensf),
dans x b -> dans (injdroite x) (union_disj a b).
Proof.
(* Goal: forall (x : Elt) (a b : Ensf) (_ : dans x b), dans (injdroite x) (union_disj a b) *)
intros.
(* Goal: dans (injdroite x) (union_disj a b) *)
unfold union_disj in |- *.
(* Goal: dans (injdroite x) (union (map injgauche a) (map injdroite b)) *)
apply union_d.
(* Goal: dans (injdroite x) (map injdroite b) *)
apply dans_map_inv.
(* Goal: dans x b *)
auto.
Qed.
Lemma union_disj_g :
forall (x : Elt) (a b : Ensf),
dans x a -> dans (injgauche x) (union_disj a b).
Proof.
(* Goal: forall (x : Elt) (a b : Ensf) (_ : dans x a), dans (injgauche x) (union_disj a b) *)
intros.
(* Goal: dans (injgauche x) (union_disj a b) *)
unfold union_disj in |- *.
(* Goal: dans (injgauche x) (union (map injgauche a) (map injdroite b)) *)
apply union_g.
(* Goal: dans (injgauche x) (map injgauche a) *)
apply dans_map_inv.
(* Goal: dans x a *)
auto.
Qed.
Lemma inclus_union_disj :
forall a b c d : Ensf,
inclus a c -> inclus b d -> inclus (union_disj a b) (union_disj c d).
Lemma pair_equal :
forall (A B : Set) (x x' : A) (y y' : B),
x = x' :>A -> y = y' :>B -> pair x y = pair x' y' :>A * B.
Proof.
(* Goal: forall (A B : Set) (x x' : A) (y y' : B) (_ : @eq A x x') (_ : @eq B y y'), @eq (prod A B) (@pair A B x y) (@pair A B x' y') *)
intros A B x x' y y' X Y.
(* Goal: @eq (prod A B) (@pair A B x y) (@pair A B x' y') *)
rewrite X.
(* Goal: @eq (prod A B) (@pair A B x' y) (@pair A B x' y') *)
rewrite Y.
(* Goal: @eq (prod A B) (@pair A B x' y') (@pair A B x' y') *)
apply refl_equal.
Qed.
Hint Resolve pair_equal. |
Require Export GeoCoq.Elements.OriginalProofs.proposition_47B.
Require Export GeoCoq.Elements.OriginalProofs.lemma_squareflip.
Section Euclid.
Context `{Ax:area}.
Lemma proposition_47 :
forall A B C D E F G H K,
Triangle A B C -> Per B A C -> SQ A B F G -> TS G B A C -> SQ A C K H -> TS H C A B -> SQ B C E D -> TS D C B A ->
exists X Y, PG B X Y D /\ BetS B X C /\ PG X C E Y /\ BetS D Y E /\ EF A B F G B X Y D /\ EF A C K H X C E Y.
Proof.
(* Goal: forall (A B C D E F G H K : @Point Ax0) (_ : @Triangle Ax0 A B C) (_ : @Per Ax0 B A C) (_ : @SQ Ax0 A B F G) (_ : @TS Ax0 G B A C) (_ : @SQ Ax0 A C K H) (_ : @TS Ax0 H C A B) (_ : @SQ Ax0 B C E D) (_ : @TS Ax0 D C B A), @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
intros.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
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 /\ BetS L M A /\ Per D L A /\ EF A B F G B M L D)) by (conclude proposition_47B);destruct Tf as [M[L]];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (nCol A B C) by (conclude_def Triangle ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (nCol A C B) by (forward_using lemma_NCorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Triangle A C B) by (conclude_def Triangle ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Per C A B) by (conclude lemma_8_2).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (SQ C B D E) by (conclude lemma_squareflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (TS D B C A) by (conclude lemma_oppositesideflip).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (PG B C E D) by (conclude lemma_squareparallelogram).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Par B C E D) by (conclude_def PG ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (TP B C E D) by (conclude lemma_paralleldef2B).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (OS E D B C) by (conclude_def TP ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (TS E B C A) by (conclude lemma_planeseparation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
let Tf:=fresh in assert (Tf:exists m l, (PG C m l E /\ BetS C m B /\ PG m B D l /\ BetS E l D /\ BetS l m A /\ Per E l A /\ EF A C K H C m l E)) by (conclude proposition_47B);destruct Tf as [m[l]];spliter.
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (neq E D) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (neq D E) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col E l D) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col D L E) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col D E L) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col D E l) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col E l L) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (neq L E) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (neq E L) by (conclude lemma_inequalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Per E L A) by (conclude lemma_collinearright).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (eq l L) by (conclude lemma_droppedperpendicularunique).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (eq L l) by (conclude lemma_equalitysymmetric).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (BetS L m A) by (conclude cn_equalitysub).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (BetS C M B) by (conclude axiom_betweennesssymmetry).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col L m A) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col L M A) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col L A m) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col L A M) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (neq L A) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col A m M) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col M m A) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col B M C) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col C B M) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col C m B) by (conclude_def Col ).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col C B m) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (neq C B) by (forward_using lemma_betweennotequal).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col B M m) by (conclude lemma_collinear4).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (Col M m B) by (forward_using lemma_collinearorder).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (~ neq M m).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
(* Goal: not (@neq Ax0 M m) *)
{
(* Goal: not (@neq Ax0 M m) *)
intro.
(* Goal: False *)
assert (Col m M A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col m M B) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq m M) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
assert (Col M A B) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col M B A) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (Col M B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
assert (neq M B) by (forward_using lemma_betweennotequal).
(* Goal: False *)
assert (Col B A C) by (conclude lemma_collinear4).
(* Goal: False *)
assert (Col A B C) by (forward_using lemma_collinearorder).
(* Goal: False *)
contradict.
(* BG Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
}
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (EF A C K H C M l E) by (conclude cn_equalitysub).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (EF A C K H C M L E) by (conclude cn_equalitysub).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
assert (EF A C K H M C E L) by (forward_using axiom_EFpermutation).
(* Goal: @ex (@Point Ax0) (fun X : @Point Ax0 => @ex (@Point Ax0) (fun Y : @Point Ax0 => and (@PG Ax0 B X Y D) (and (@BetS Ax0 B X C) (and (@PG Ax0 X C E Y) (and (@BetS Ax0 D Y E) (and (@EF Ax0 Ax1 Ax2 Ax A B F G B X Y D) (@EF Ax0 Ax1 Ax2 Ax A C K H X C E Y))))))) *)
close.
Qed.
End Euclid.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Fpart2.
Section tiroirs_def.
Variable E F : Setoid.
Variable f : MAP E F.
Lemma diff_add_part2 :
forall (E : Setoid) (A : part_set E) (x : E),
in_part x A -> Equal A (add_part (diff A (single x)) x).
Proof.
(* Goal: forall (E : Setoid) (A : Carrier (part_set E)) (x : Carrier E) (_ : @in_part E x A), @Equal (part_set E) A (@add_part E (@diff E A (@single E x)) x) *)
intros E0 A x H'; try assumption.
(* Goal: @Equal (part_set E0) A (@add_part E0 (@diff E0 A (@single E0 x)) x) *)
apply in_eq_part.
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *)
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 A), @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x) *)
intros x0 H'0; try assumption.
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *)
(* Goal: @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x) *)
elim (classic (Equal x x0)); intros.
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *)
(* Goal: @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x) *)
(* Goal: @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x) *)
apply in_part_trans_eq with x; auto with *.
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *)
(* Goal: @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x) *)
cut (in_part x0 (diff A (single x))).
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *)
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
(* Goal: forall _ : @in_part E0 x0 (@diff E0 A (@single E0 x)), @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x) *)
unfold add_part in |- *; auto with *.
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *)
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
apply in_diff; auto with *.
(* Goal: forall (x0 : Carrier E0) (_ : @in_part E0 x0 (@add_part E0 (@diff E0 A (@single E0 x)) x)), @in_part E0 x0 A *)
intros x0 H'0; try assumption.
(* Goal: @in_part E0 x0 A *)
elim (classic (Equal x x0)); intros.
(* Goal: @in_part E0 x0 A *)
(* Goal: @in_part E0 x0 A *)
apply in_part_trans_eq with x; auto with *.
(* Goal: @in_part E0 x0 A *)
cut (in_part x0 (diff A (single x))).
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
(* Goal: forall _ : @in_part E0 x0 (@diff E0 A (@single E0 x)), @in_part E0 x0 A *)
intros H'1; try assumption.
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
(* Goal: @in_part E0 x0 A *)
apply diff_in_l with (single x).
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
auto with *.
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
unfold add_part in H'0.
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
elim (in_part_union H'0); intros.
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
auto with *.
(* Goal: @in_part E0 x0 (@diff E0 A (@single E0 x)) *)
absurd (Equal x x0); auto with *.
Qed.
Hint Resolve diff_add_part2: algebra.
Lemma cardinal_minus_part :
forall (B : part_set F) (x : F) (n : nat),
cardinal B (S n) -> in_part x B -> cardinal (diff B (single x)) n.
Proof.
(* Goal: forall (B : Carrier (part_set F)) (x : Carrier F) (n : nat) (_ : @cardinal F B (S n)) (_ : @in_part F x B), @cardinal F (@diff F B (@single F x)) n *)
intros B x n H' H'0; try assumption.
(* Goal: @cardinal F (@diff F B (@single F x)) n *)
apply cardinal_S with B x; auto with *.
(* Goal: not (@in_part F x (@diff F B (@single F x))) *)
unfold not in |- *; intros.
(* Goal: False *)
cut (~ in_part x (single x)).
(* Goal: not (@in_part F x (@single F x)) *)
(* Goal: forall _ : not (@in_part F x (@single F x)), False *)
unfold not in |- *; auto with *.
(* Goal: not (@in_part F x (@single F x)) *)
apply diff_in_r with B; auto with *.
Qed.
Hint Resolve cardinal_minus_part: algebra.
Lemma tiroirs :
forall (n : nat) (Chaussettes : part_set E),
cardinal Chaussettes n ->
forall (m : nat) (Tiroirs : part_set F),
cardinal Tiroirs m ->
m < n ->
(forall x : E, in_part x Chaussettes -> in_part (f x) Tiroirs) ->
exists x : E, (exists y : E, ~ Equal x y /\ Equal (f x) (f y)).
Proof.
(* Goal: forall (n : nat) (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes n) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m n) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
simple induction n.
(* Goal: forall (n : nat) (_ : forall (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes n) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m n) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y))))) (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes (S n)) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m (S n)) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
(* Goal: forall (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes O) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m O) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
intros Chaussettes H' m Tiroirs H'0 H'1; try assumption.
(* Goal: forall (n : nat) (_ : forall (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes n) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m n) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y))))) (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes (S n)) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m (S n)) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
(* Goal: forall _ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs, @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
inversion H'1.
(* Goal: forall (n : nat) (_ : forall (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes n) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m n) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y))))) (Chaussettes : Carrier (part_set E)) (_ : @cardinal E Chaussettes (S n)) (m : nat) (Tiroirs : Carrier (part_set F)) (_ : @cardinal F Tiroirs m) (_ : lt m (S n)) (_ : forall (x : Carrier E) (_ : @in_part E x Chaussettes), @in_part F (@Ap E F f x) Tiroirs), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
intros n0 H' Chaussettes H'0 m Tiroirs H'1 H'2 H'3; try assumption.
(* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
inversion H'0.
(* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
elim (classic (ex (fun y : E => ~ Equal x y /\ Equal (Ap f x) (Ap f y)))); intros.
(* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
(* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
exists x; try assumption.
(* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
cut (exists m0 : nat, m = S m0).
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall _ : @ex nat (fun m0 : nat => @eq nat m (S m0)), @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
intros H'4; try assumption.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
case H'4; clear H'4; intros.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @ex (Carrier E) (fun x : Carrier E => @ex (Carrier E) (fun y : Carrier E => and (not (@Equal E x y)) (@Equal F (@Ap E F f x) (@Ap E F f y)))) *)
apply H' with (diff Chaussettes (single x)) x0 (diff Tiroirs (single (f x))).
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E (@diff E Chaussettes (@single E x)) n0 *)
apply cardinal_S with Chaussettes x.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E Chaussettes (S n0) *)
(* Goal: @Equal (part_set E) Chaussettes (@add_part E (@diff E Chaussettes (@single E x)) x) *)
(* Goal: not (@in_part E x (@diff E Chaussettes (@single E x))) *)
unfold not in |- *; intros.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E Chaussettes (S n0) *)
(* Goal: @Equal (part_set E) Chaussettes (@add_part E (@diff E Chaussettes (@single E x)) x) *)
(* Goal: False *)
absurd (~ in_part x (single x)); auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E Chaussettes (S n0) *)
(* Goal: @Equal (part_set E) Chaussettes (@add_part E (@diff E Chaussettes (@single E x)) x) *)
(* Goal: not (@in_part E x (@single E x)) *)
apply diff_in_r with Chaussettes; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E Chaussettes (S n0) *)
(* Goal: @Equal (part_set E) Chaussettes (@add_part E (@diff E Chaussettes (@single E x)) x) *)
auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E Chaussettes (S n0) *)
(* Goal: @Equal (part_set E) Chaussettes (@add_part E (@diff E Chaussettes (@single E x)) x) *)
apply diff_add_part2.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E Chaussettes (S n0) *)
(* Goal: @in_part E x Chaussettes *)
apply in_part_comp_r with (add_part B x); auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
(* Goal: @cardinal E Chaussettes (S n0) *)
auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @cardinal F (@diff F Tiroirs (@single F (@Ap E F f x))) x0 *)
apply cardinal_minus_part.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @in_part F (@Ap E F f x) Tiroirs *)
(* Goal: @cardinal F Tiroirs (S x0) *)
rewrite <- H5; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @in_part F (@Ap E F f x) Tiroirs *)
apply H'3; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @in_part E x Chaussettes *)
apply in_part_comp_r with (add_part B x).
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @Equal (part_set E) (@add_part E B x) Chaussettes *)
(* Goal: @in_part E x (@add_part E B x) *)
auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
(* Goal: @Equal (part_set E) (@add_part E B x) Chaussettes *)
auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
(* Goal: lt x0 n0 *)
rewrite H5 in H'2; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: forall (x0 : Carrier E) (_ : @in_part E x0 (@diff E Chaussettes (@single E x))), @in_part F (@Ap E F f x0) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
intros x1 H'4; try assumption.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @in_part F (@Ap E F f x1) (@diff F Tiroirs (@single F (@Ap E F f x))) *)
apply in_diff.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: not (@in_part F (@Ap E F f x1) (@single F (@Ap E F f x))) *)
(* Goal: @in_part F (@Ap E F f x1) Tiroirs *)
apply H'3; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: not (@in_part F (@Ap E F f x1) (@single F (@Ap E F f x))) *)
(* Goal: @in_part E x1 Chaussettes *)
apply diff_in_l with (single x); auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: not (@in_part F (@Ap E F f x1) (@single F (@Ap E F f x))) *)
unfold not in |- *; intros.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: False *)
unfold not in H4.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: False *)
apply H4.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @ex (Carrier E) (fun y : Carrier E => and (forall _ : @Equal E x y, False) (@Equal F (@Ap E F f x) (@Ap E F f y))) *)
exists x1; try assumption.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: and (forall _ : @Equal E x x1, False) (@Equal F (@Ap E F f x) (@Ap E F f x1)) *)
split.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *)
(* Goal: forall _ : @Equal E x x1, False *)
intros H'5; try assumption.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *)
(* Goal: False *)
cut (~ in_part x1 (single x)).
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *)
(* Goal: not (@in_part E x1 (@single E x)) *)
(* Goal: forall _ : not (@in_part E x1 (@single E x)), False *)
intro.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *)
(* Goal: not (@in_part E x1 (@single E x)) *)
(* Goal: False *)
apply H7.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *)
(* Goal: not (@in_part E x1 (@single E x)) *)
(* Goal: @in_part E x1 (@single E x) *)
apply in_part_trans_eq with x; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *)
(* Goal: not (@in_part E x1 (@single E x)) *)
apply diff_in_r with Chaussettes; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
(* Goal: @Equal F (@Ap E F f x) (@Ap E F f x1) *)
auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat m (S m0)) *)
inversion H'1.
(* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *)
(* Goal: @ex nat (fun m0 : nat => @eq nat O (S m0)) *)
cut (in_part (f x) Tiroirs).
(* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *)
(* Goal: @in_part F (@Ap E F f x) Tiroirs *)
(* Goal: forall _ : @in_part F (@Ap E F f x) Tiroirs, @ex nat (fun m0 : nat => @eq nat O (S m0)) *)
intros H'4; try assumption.
(* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *)
(* Goal: @in_part F (@Ap E F f x) Tiroirs *)
(* Goal: @ex nat (fun m0 : nat => @eq nat O (S m0)) *)
absurd (in_part (f x) (empty F)); auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *)
(* Goal: @in_part F (@Ap E F f x) Tiroirs *)
(* Goal: @in_part F (@Ap E F f x) (empty F) *)
apply in_part_comp_r with Tiroirs; auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *)
(* Goal: @in_part F (@Ap E F f x) Tiroirs *)
apply H'3.
(* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *)
(* Goal: @in_part E x Chaussettes *)
apply in_part_comp_r with (add_part B x); auto with *.
(* Goal: @ex nat (fun m0 : nat => @eq nat (S n2) (S m0)) *)
exists n2; try assumption.
(* Goal: @eq nat (S n2) (S n2) *)
auto with *.
Qed.
End tiroirs_def.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_ray2.
Require Export GeoCoq.Elements.OriginalProofs.lemma_lessthancongruence.
Require Export GeoCoq.Elements.OriginalProofs.lemma_3_7b.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_ray :
forall A B P,
Out A B P -> neq P B -> ~ BetS A P B ->
BetS A B P.
Proof.
(* Goal: forall (A B P : @Point Ax0) (_ : @Out Ax0 A B P) (_ : @neq Ax0 P B) (_ : not (@BetS Ax0 A P B)), @BetS Ax0 A B P *)
intros.
(* Goal: @BetS Ax0 A B P *)
assert (neq A B) by (conclude lemma_ray2).
(* Goal: @BetS Ax0 A B P *)
let Tf:=fresh in assert (Tf:exists E, (BetS E A P /\ BetS E A B)) by (conclude_def Out );destruct Tf as [E];spliter.
(* Goal: @BetS Ax0 A B P *)
assert (neq A P) by (forward_using lemma_betweennotequal).
(* Goal: @BetS Ax0 A B P *)
let Tf:=fresh in assert (Tf:exists D, (BetS A B D /\ Cong B D A P)) by (conclude lemma_extension);destruct Tf as [D];spliter.
(* Goal: @BetS Ax0 A B P *)
assert (Cong D B B D) by (conclude cn_equalityreverse).
(* Goal: @BetS Ax0 A B P *)
assert (Cong D B A P) by (conclude lemma_congruencetransitive).
(* Goal: @BetS Ax0 A B P *)
assert (BetS D B A) by (conclude axiom_betweennesssymmetry).
(* Goal: @BetS Ax0 A B P *)
assert (Lt A P D A) by (conclude_def Lt ).
(* Goal: @BetS Ax0 A B P *)
assert (Cong D A A D) by (conclude cn_equalityreverse).
(* Goal: @BetS Ax0 A B P *)
assert (Lt A P A D) by (conclude lemma_lessthancongruence).
(* Goal: @BetS Ax0 A B P *)
let Tf:=fresh in assert (Tf:exists F, (BetS A F D /\ Cong A F A P)) by (conclude_def Lt );destruct Tf as [F];spliter.
(* Goal: @BetS Ax0 A B P *)
assert (BetS E A D) by (conclude lemma_3_7b).
(* Goal: @BetS Ax0 A B P *)
assert (BetS E A F) by (conclude axiom_innertransitivity).
(* Goal: @BetS Ax0 A B P *)
assert (Cong A P A F) by (conclude lemma_congruencesymmetric).
(* Goal: @BetS Ax0 A B P *)
assert (eq P F) by (conclude lemma_extensionunique).
(* Goal: @BetS Ax0 A B P *)
assert (BetS A P D) by (conclude cn_equalitysub).
(* Goal: @BetS Ax0 A B P *)
assert (~ ~ BetS A B P).
(* Goal: @BetS Ax0 A B P *)
(* Goal: not (not (@BetS Ax0 A B P)) *)
{
(* Goal: not (not (@BetS Ax0 A B P)) *)
intro.
(* Goal: False *)
assert (eq B P) by (conclude axiom_connectivity).
(* Goal: False *)
assert (neq B P) by (conclude lemma_inequalitysymmetric).
(* Goal: False *)
contradict.
(* BG Goal: @BetS Ax0 A B P *)
}
(* Goal: @BetS Ax0 A B P *)
close.
Qed.
End Euclid.
|
Require Import AMM11262.
Import NatSet GeneralProperties.
Section example_five_inhabitants.
Definition town_2:= 1 ++ 2 ++ 3 ++ 4 ++ 5 ++ empty.
Remark population_2 : cardinal town_2 = 2*2 +1.
Proof.
(* Goal: @Logic.eq nat (cardinal town_2) (Nat.add (Nat.mul (S (S O)) (S (S O))) (S O)) *)
reflexivity.
Qed.
Definition familiarity_2 (m n:elt):Prop :=
match m,n with
| 1,2=> True
| 1,3 => True
| 1,4 => True
| 1,5 => True
| 2,1 => True
| 2,5 => True
| 3,1 => True
| 3,4 => True
| 3,5 => True
| 4,1 => True
| 4,3 => True
| 5,1 => True
| 5,2 => True
| 5,3 => True
| _,_ => False
end.
Remark familiarity_2_sym:forall m n : elt, familiarity_2 m n -> familiarity_2 n m.
Remark familiarity_2_extensional:forall (m : elt) (n p : E.t), E.eq n p -> familiarity_2 m n -> familiarity_2 m p.
Remark subsets_2: forall B : t, Subset B town_2 -> cardinal B = 2 ->
{B [=] 1++2++empty}+{B[=]1++3++empty}+{B[=]1++4++empty}+{B [=] 1++5++empty}+{B[=]2++3++empty}+
{B[=]2++4++empty}+{B[=]2++5++empty}+{B[=]3++4++empty}+{B [=] 3++5++empty}+{B[=]4++5++empty}.
Proof.
(* Goal: forall (B : t) (_ : Subset B town_2) (_ : @Logic.eq nat (cardinal B) (S (S O))), sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
intros B H_sub H_card.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
destruct (In_dec 1 B) as [H1|H1].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
do 6 left.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
assert (H_card_rem:cardinal (remove 1 B)=1); [ rewrite <- (remove_cardinal_1 H1) in H_card; apply eq_add_S; assumption|].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
destruct (In_dec 2 (remove 1 B)) as [H12|H12].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
do 3 left.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal B (add (S O) (add (S (S O)) empty)) *)
rewrite <- (add_remove H1).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (remove (S O) B)) (add (S O) (add (S (S O)) empty)) *)
rewrite <- (add_remove H12).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
generalize (remove_cardinal_1 H12).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S O)) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
rewrite H_card_rem; intro H_eq2.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
destruct (In_dec 3 (remove 1 B)) as [H13|H13].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
do 2 left; right.
rewrite <- (add_remove H1).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (remove (S O) B)))))) (add (S O) (add (S (S O)) empty)) *)
rewrite <- (add_remove H13).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
generalize (remove_cardinal_1 H13).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
destruct (In_dec 4 (remove 1 B)) as [H14|H14].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
left; right.
rewrite <- (add_remove H1).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (remove (S O) B)))))) (cardinal (remove (S O) (add (S O) (remove (S O) B)))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (remove (S O) B)))))))))) (add (S O) (add (S (S O)) empty)) *)
rewrite <- (add_remove H14).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
generalize (remove_cardinal_1 H14).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
destruct (In_dec 5 (remove 1 B)) as [H15|H15].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
right.
rewrite <- (add_remove H1).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) (add (S O) (remove (S O) B)))))) (cardinal (remove (S O) (add (S O) (remove (S O) B))))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (remove (S O) B)))))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (remove (S O) B))))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (remove (S O) B)))))))))))))) (add (S O) (add (S (S O)) empty)) *)
rewrite <- (add_remove H15).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B))))))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B)))))))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B))))))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B)))))))))))))))) (add (S O) (add (S (S O)) empty)) *)
generalize (remove_cardinal_1 H15).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S (S O))))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B))))))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B)))))))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B))))))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) (add (S O) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S O) B)))))))))))))))) (add (S O) (add (S (S O)) empty)) *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
apply False_rec.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
assert (H11:=(@remove_1 B _ _ (refl_equal 1))).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
destruct (cardinal_inv_2 H_card_rem) as [b Hb].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
destruct (NatSet.E.eq_dec b 1) as [Hb1|Hb1].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
apply H11; rewrite Hb1 in Hb; assumption.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
destruct (NatSet.E.eq_dec b 2) as [Hb2|Hb2].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
apply H12; rewrite <- Hb2; assumption.
destruct (NatSet.E.eq_dec b 3) as [Hb3|Hb3].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply H13; rewrite <- Hb3; assumption.
destruct (NatSet.E.eq_dec b 4) as [Hb4|Hb4].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply H14; rewrite <- Hb4; assumption.
destruct (NatSet.E.eq_dec b 5) as [Hb5|Hb5].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply H15; rewrite <- Hb5; assumption.
assert (H_sub':=@subset_remove_3 _ _ 1 H_sub).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert (Hb_town:=H_sub' _ Hb).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
unfold town_2 in Hb_town.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (proj1 (FM.add_iff _ _ b) Hb_town) as [Hb1_town|Hb1_town].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
apply Hb1; rewrite Hb1_town; reflexivity.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (proj1 (FM.add_iff _ _ b) Hb1_town) as [Hb2_town|Hb2_town].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
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.
destruct (proj1 (FM.add_iff _ _ b) Hb3_town) as [Hb4_town|Hb4_town].
apply Hb4; rewrite Hb4_town; reflexivity.
destruct (proj1 (FM.add_iff _ _ b) Hb4_town) as [Hb5_town|Hb5_town].
apply Hb5; rewrite Hb5_town; reflexivity.
apply (proj1 (FM.empty_iff b) Hb5_town)...
destruct (In_dec 2 B) as [H2|H2].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert (H_card_rem:cardinal (remove 2 B)=1); [ rewrite <- (remove_cardinal_1 H2) in H_card; apply eq_add_S; assumption|].
assert (H21:=fun HH : In 1 (remove 2 B) => H1 (remove_3 HH)).
destruct (In_dec 3 (remove 2 B)) as [H23|H23].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
do 5 left; right.
rewrite <- (add_remove H2).
rewrite <- (add_remove H23).
generalize (remove_cardinal_1 H23).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
destruct (In_dec 4 (remove 2 B)) as [H24|H24].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
do 4 left; right.
rewrite <- (add_remove H2).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (remove (S (S O)) B)))))) (cardinal (remove (S (S O)) (add (S (S O)) (remove (S (S O)) B)))), False *)
rewrite <- (add_remove H24).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))), False *)
generalize (remove_cardinal_1 H24).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
destruct (In_dec 5 (remove 2 B)) as [H25|H25].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
do 3 left; right.
rewrite <- (add_remove H2).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (remove (S (S O)) B)))))) (cardinal (remove (S (S O)) (add (S (S O)) (remove (S (S O)) B))))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (remove (S (S O)) B)))))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (remove (S (S O)) B))))))))), False *)
rewrite <- (add_remove H25).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B))))))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B)))))))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B))))))))))), False *)
generalize (remove_cardinal_1 H25).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S (S O))))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B))))))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B)))))))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S O)) B))))))))))), False *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
apply False_rec.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
assert (H22:=(@remove_1 B _ _ (refl_equal 2))).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
destruct (cardinal_inv_2 H_card_rem) as [b Hb].
destruct (NatSet.E.eq_dec b 1) as [Hb1|Hb1].
apply H21; rewrite Hb1 in Hb; assumption.
destruct (NatSet.E.eq_dec b 2) as [Hb2|Hb2].
apply H22; rewrite Hb2 in Hb; assumption.
destruct (NatSet.E.eq_dec b 3) as [Hb3|Hb3].
apply H23; rewrite <- Hb3; assumption.
destruct (NatSet.E.eq_dec b 4) as [Hb4|Hb4].
apply H24; rewrite <- Hb4; assumption.
destruct (NatSet.E.eq_dec b 5) as [Hb5|Hb5].
apply H25; rewrite <- Hb5; assumption.
assert (H_sub':=@subset_remove_3 _ _ 2 H_sub).
assert (Hb_town:=H_sub' _ Hb).
unfold town_2 in Hb_town.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
destruct (proj1 (FM.add_iff _ _ b) Hb_town) as [Hb1_town|Hb1_town].
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.
destruct (proj1 (FM.add_iff _ _ b) Hb3_town) as [Hb4_town|Hb4_town].
apply Hb4; rewrite Hb4_town; reflexivity.
destruct (proj1 (FM.add_iff _ _ b) Hb4_town) as [Hb5_town|Hb5_town].
apply Hb5; rewrite Hb5_town; reflexivity.
apply (proj1 (FM.empty_iff b) Hb5_town)...
destruct (In_dec 3 B) as [H3|H3].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
assert (H_card_rem:cardinal (remove 3 B)=1); [ rewrite <- (remove_cardinal_1 H3) in H_card; apply eq_add_S; assumption|].
assert (H31:=fun HH : In 1 (remove 3 B) => H1 (remove_3 HH)).
assert (H32:=fun HH : In 2 (remove 3 B) => H2 (remove_3 HH)).
destruct (In_dec 4 (remove 3 B)) as [H34|H34].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
do 2 left; right.
rewrite <- (add_remove H3).
rewrite <- (add_remove H34).
generalize (remove_cardinal_1 H34).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
destruct (In_dec 5 (remove 3 B)) as [H35|H35].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
left; right.
rewrite <- (add_remove H3).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) (add (S (S (S O))) (remove (S (S (S O))) B)))))) (cardinal (remove (S (S (S O))) (add (S (S (S O))) (remove (S (S (S O))) B)))), False *)
rewrite <- (add_remove H35).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) (add (S (S (S O))) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S (S O))) B)))))))) (cardinal (remove (S (S (S O))) (add (S (S (S O))) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S (S O))) B)))))), False *)
generalize (remove_cardinal_1 H35).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S (S O))))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) (add (S (S (S O))) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S (S O))) B)))))))) (cardinal (remove (S (S (S O))) (add (S (S (S O))) (add (S (S (S (S (S O))))) (remove (S (S (S (S (S O))))) (remove (S (S (S O))) B))))))), False *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
apply False_rec.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
assert (H33:=(@remove_1 B _ _ (refl_equal 3))).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
destruct (cardinal_inv_2 H_card_rem) as [b Hb].
destruct (NatSet.E.eq_dec b 1) as [Hb1|Hb1].
apply H31; rewrite Hb1 in Hb; assumption.
destruct (NatSet.E.eq_dec b 2) as [Hb2|Hb2].
apply H32; rewrite Hb2 in Hb; assumption.
destruct (NatSet.E.eq_dec b 3) as [Hb3|Hb3].
apply H33; rewrite Hb3 in Hb; assumption.
destruct (NatSet.E.eq_dec b 4) as [Hb4|Hb4].
apply H34; rewrite <- Hb4; assumption.
destruct (NatSet.E.eq_dec b 5) as [Hb5|Hb5].
apply H35; rewrite <- Hb5; assumption.
assert (H_sub':=@subset_remove_3 _ _ 3 H_sub).
assert (Hb_town:=H_sub' _ Hb).
unfold town_2 in Hb_town.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
destruct (proj1 (FM.add_iff _ _ b) Hb_town) as [Hb1_town|Hb1_town].
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.
destruct (proj1 (FM.add_iff _ _ b) Hb3_town) as [Hb4_town|Hb4_town].
apply Hb4; rewrite Hb4_town; reflexivity.
destruct (proj1 (FM.add_iff _ _ b) Hb4_town) as [Hb5_town|Hb5_town].
apply Hb5; rewrite Hb5_town; reflexivity.
apply (proj1 (FM.empty_iff b) Hb5_town)...
destruct (In_dec 4 B) as [H4|H4].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
assert (H_card_rem:cardinal (remove 4 B)=1); [ rewrite <- (remove_cardinal_1 H4) in H_card; apply eq_add_S; assumption|].
assert (H41:=fun HH : In 1 (remove 4 B) => H1 (remove_3 HH)).
assert (H42:=fun HH : In 2 (remove 4 B) => H2 (remove_3 HH)).
assert (H43:=fun HH : In 3 (remove 4 B) => H3 (remove_3 HH)).
destruct (In_dec 5 (remove 4 B)) as [H45|H45].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
right.
rewrite <- (add_remove H4).
rewrite <- (add_remove H45).
generalize (remove_cardinal_1 H45).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S (S O))))) (remove (S (S (S (S O)))) B)))) (cardinal (remove (S (S (S (S O)))) B)), False *)
rewrite H_card_rem; intro H_eq2.
rewrite (empty_is_empty_1 (cardinal_inv_1 (eq_add_S _ _ H_eq2))); reflexivity...
apply False_rec.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert (H44:=(@remove_1 B _ _ (refl_equal 4))).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (cardinal_inv_2 H_card_rem) as [b Hb].
destruct (NatSet.E.eq_dec b 1) as [Hb1|Hb1].
apply H41; rewrite Hb1 in Hb; assumption.
destruct (NatSet.E.eq_dec b 2) as [Hb2|Hb2].
apply H42; rewrite Hb2 in Hb; assumption.
destruct (NatSet.E.eq_dec b 3) as [Hb3|Hb3].
apply H43; rewrite Hb3 in Hb; assumption.
destruct (NatSet.E.eq_dec b 4) as [Hb4|Hb4].
apply H44; rewrite Hb4 in Hb; assumption.
destruct (NatSet.E.eq_dec b 5) as [Hb5|Hb5].
apply H45; rewrite <- Hb5; assumption.
assert (H_sub':=@subset_remove_3 _ _ 4 H_sub).
assert (Hb_town:=H_sub' _ Hb).
unfold town_2 in Hb_town.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (proj1 (FM.add_iff _ _ b) Hb_town) as [Hb1_town|Hb1_town].
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.
destruct (proj1 (FM.add_iff _ _ b) Hb3_town) as [Hb4_town|Hb4_town].
apply Hb4; rewrite Hb4_town; reflexivity.
destruct (proj1 (FM.add_iff _ _ b) Hb4_town) as [Hb5_town|Hb5_town].
apply Hb5; rewrite Hb5_town; reflexivity.
apply (proj1 (FM.empty_iff b) Hb5_town)...
apply False_rec.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (In_dec 5 B) as [H5|H5].
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
assert (H_card_rem:cardinal (remove 5 B)=1); [ rewrite <- (remove_cardinal_1 H5) in H_card; apply eq_add_S; assumption|].
assert (H51:=fun HH : In 1 (remove 5 B) => H1 (remove_3 HH)).
assert (H52:=fun HH : In 2 (remove 5 B) => H2 (remove_3 HH)).
assert (H53:=fun HH : In 3 (remove 5 B) => H3 (remove_3 HH)).
assert (H54:=fun HH : In 4 (remove 5 B) => H4 (remove_3 HH)).
assert (H55:=(@remove_1 B _ _ (refl_equal 5))).
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (cardinal_inv_2 H_card_rem) as [b Hb].
assert (H_sub':=@subset_remove_3 _ _ 5 H_sub).
assert (Hb_town:=H_sub' _ Hb).
unfold town_2 in Hb_town.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (proj1 (FM.add_iff _ _ b) Hb_town) as [Hb1_town|Hb1_town].
apply H51; rewrite <- Hb1_town in Hb; assumption.
destruct (proj1 (FM.add_iff _ _ b) Hb1_town) as [Hb2_town|Hb2_town].
apply H52; rewrite <- Hb2_town in Hb; assumption.
destruct (proj1 (FM.add_iff _ _ b) Hb2_town) as [Hb3_town|Hb3_town].
apply H53; rewrite <- Hb3_town in Hb; assumption.
destruct (proj1 (FM.add_iff _ _ b) Hb3_town) as [Hb4_town|Hb4_town].
apply H54; rewrite <- Hb4_town in Hb; assumption.
destruct (proj1 (FM.add_iff _ _ b) Hb4_town) as [Hb5_town|Hb5_town].
apply H55; rewrite <- Hb5_town in Hb; assumption.
apply (proj1 (FM.empty_iff b) Hb5_town)...
destruct (cardinal_inv_2 H_card) as [b Hb].
destruct (NatSet.E.eq_dec b 1) as [Hb1|Hb1].
apply H1; rewrite Hb1 in Hb; assumption.
destruct (NatSet.E.eq_dec b 2) as [Hb2|Hb2].
apply H2; rewrite Hb2 in Hb; assumption.
destruct (NatSet.E.eq_dec b 3) as [Hb3|Hb3].
apply H3; rewrite Hb3 in Hb; assumption.
destruct (NatSet.E.eq_dec b 4) as [Hb4|Hb4].
apply H4; rewrite Hb4 in Hb; assumption.
destruct (NatSet.E.eq_dec b 5) as [Hb5|Hb5].
apply H5; rewrite <- Hb5; assumption.
assert (Hb_town:=H_sub _ Hb).
unfold town_2 in Hb_town.
(* Goal: sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S O)) (add (S (S (S O))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S O)) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S O)))) empty)))) (Equal B (add (S (S (S O))) (add (S (S (S (S (S O))))) empty)))) (Equal B (add (S (S (S (S O)))) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: sumor (sumor (sumbool (Equal B (add (S O) (add (S (S O)) empty))) (Equal B (add (S O) (add (S (S (S O))) empty)))) (Equal B (add (S O) (add (S (S (S (S O)))) empty)))) (Equal B (add (S O) (add (S (S (S (S (S O))))) empty))) *)
(* Goal: Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) B)))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) B)))) (cardinal (remove (S O) B)), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) B)))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S O) B)))) (cardinal (remove (S O) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))) (cardinal (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B))))))), Equal (add (S O) (add (S (S O)) (remove (S (S O)) (remove (S O) (add (S O) (add (S (S (S O))) (remove (S (S (S O))) (remove (S O) (add (S O) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S O) B)))))))))))) (add (S O) (add (S (S O)) empty)) *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B)), False *)
(* Goal: forall (_ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S O)) B)))) (cardinal (remove (S (S O)) B))) (_ : @Logic.eq nat (S (cardinal (remove (S (S (S O))) (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B)))))))) (cardinal (remove (S (S O)) (add (S (S O)) (add (S (S (S (S O)))) (remove (S (S (S (S O)))) (remove (S (S O)) B))))))), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: forall _ : @Logic.eq nat (S (cardinal (remove (S (S (S (S O)))) (remove (S (S (S O))) B)))) (cardinal (remove (S (S (S O))) B)), False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
(* Goal: False *)
destruct (proj1 (FM.add_iff _ _ b) Hb_town) as [Hb1_town|Hb1_town].
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.
destruct (proj1 (FM.add_iff _ _ b) Hb3_town) as [Hb4_town|Hb4_town].
apply Hb4; rewrite Hb4_town; reflexivity.
destruct (proj1 (FM.add_iff _ _ b) Hb4_town) as [Hb5_town|Hb5_town].
apply Hb5; rewrite Hb5_town; reflexivity.
apply (proj1 (FM.empty_iff b) Hb5_town)...
Qed.
Qed.
Remark acquintance_2: forall B : t, Subset B town_2 -> cardinal B = 2 ->
{d : elt |In d (diff town_2 B) /\ (forall b : elt, In b B -> familiarity_2 d b)}.
Proof.
(* Goal: forall (B : t) (_ : Subset B town_2) (_ : @Logic.eq nat (cardinal B) (S (S O))), @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
intros B H_sub H_card.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
destruct (subsets_2 B H_sub H_card) as [[[[[[[[[HB12|HB13]|HB14]|HB15]|HB23]|HB24]|HB25]|HB34]|HB35]|HB45].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 5; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S (S (S O))))) b *)
(* Goal: In (S (S (S (S (S O))))) (diff town_2 B) *)
rewrite HB12; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S (S (S O))))) b *)
intro b; rewrite HB12; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 4; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S (S O)))) b *)
(* Goal: In (S (S (S (S O)))) (diff town_2 B) *)
rewrite HB13; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S (S O)))) b *)
intro b; rewrite HB13; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S O)))) b *)
(* Goal: familiarity_2 (S (S (S (S O)))) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S O)))) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S O)))) b *)
(* Goal: familiarity_2 (S (S (S (S O)))) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 3; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S O))) b *)
(* Goal: In (S (S (S O))) (diff town_2 B) *)
rewrite HB14; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S O))) b *)
intro b; rewrite HB14; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S O))) b *)
(* Goal: familiarity_2 (S (S (S O))) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S O))) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S O))) b *)
(* Goal: familiarity_2 (S (S (S O))) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 2; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S O)) b *)
(* Goal: In (S (S O)) (diff town_2 B) *)
rewrite HB15; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S O)) b *)
intro b; rewrite HB15; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S O)) b *)
(* Goal: familiarity_2 (S (S O)) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S O)) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S O)) b *)
(* Goal: familiarity_2 (S (S O)) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 5; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S (S (S O))))) b *)
(* Goal: In (S (S (S (S (S O))))) (diff town_2 B) *)
rewrite HB23; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S (S (S O))))) b *)
intro b; rewrite HB23; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
(* Goal: familiarity_2 (S (S (S (S (S O))))) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S (S (S (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_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 1; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
(* Goal: In (S O) (diff town_2 B) *)
rewrite HB24; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
intro b; rewrite HB24; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
apply False_ind; apply (proj1 (FM.empty_iff b) H').
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 1; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
(* Goal: In (S O) (diff town_2 B) *)
rewrite HB25; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
intro b; rewrite HB25; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
apply False_ind; apply (proj1 (FM.empty_iff b) H').
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 1; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
(* Goal: In (S O) (diff town_2 B) *)
rewrite HB34; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
intro b; rewrite HB34; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
apply False_ind; apply (proj1 (FM.empty_iff b) H').
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 1; split.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
(* Goal: In (S O) (diff town_2 B) *)
rewrite HB35; apply mem_2; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S O) b *)
intro b; rewrite HB35; intro Hb.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
(* Goal: familiarity_2 (S O) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
(* Goal: familiarity_2 (S O) b *)
apply False_ind; apply (proj1 (FM.empty_iff b) H').
(* Goal: @sig elt (fun d : elt => and (In d (diff town_2 B)) (forall (b : elt) (_ : In b B), familiarity_2 d b)) *)
exists 3; split.
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S O))) b *)
(* Goal: In (S (S (S O))) (diff town_2 B) *)
rewrite HB45; apply mem_2; trivial.
(* Goal: forall (b : elt) (_ : In b B), familiarity_2 (S (S (S O))) b *)
intro b; rewrite HB45; intro Hb.
(* Goal: familiarity_2 (S (S (S O))) b *)
destruct (proj1 (FM.add_iff _ _ b) Hb) as [H|H].
(* Goal: familiarity_2 (S (S (S O))) b *)
(* Goal: familiarity_2 (S (S (S O))) b *)
compute in H; rewrite <- H; simpl; trivial.
(* Goal: familiarity_2 (S (S (S O))) b *)
destruct (proj1 (FM.add_iff _ _ b) H) as [H'|H'].
(* Goal: familiarity_2 (S (S (S O))) b *)
(* Goal: familiarity_2 (S (S (S O))) b *)
compute in H'; rewrite <- H'; simpl; trivial.
(* Goal: familiarity_2 (S (S (S O))) b *)
apply False_ind; apply (proj1 (FM.empty_iff b) H').
Qed.
Check (AMM11262 town_2 2 population_2 familiarity_2 familiarity_2_sym familiarity_2_extensional acquintance_2).
Definition social_citizen_2:=AMM11262 town_2 2 population_2 familiarity_2
familiarity_2_sym familiarity_2_extensional acquintance_2.
End example_five_inhabitants.
Extraction "social2" social_citizen_2.
|
Require Import securite.
Require Import invprel1.
Require Import invprel2.
Require Import invprel3.
Require Import invprel4.
Require Import invprel5.
Require Import invprel6.
Require Import invprel7.
Require Import invprel8.
Lemma POinvP :
forall st1 st2 : GlobalState,
inv0 st1 -> inv1 st1 -> invP st1 -> rel st1 st2 -> invP st2.
Proof.
(* Goal: forall (st1 st2 : GlobalState) (_ : inv0 st1) (_ : inv1 st1) (_ : invP st1) (_ : rel st1 st2), invP st2 *)
simple induction st1; intros a b s l; elim a; elim b; elim s.
(* Goal: forall (d d0 d1 d2 d3 d4 d5 d6 : D) (k : K) (c c0 : C) (d7 d8 d9 : D) (k0 : K) (st2 : GlobalState) (_ : 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)) (_ : rel (ABSI (MBNaKab d7 d8 d9 k0) (MANbKabCaCb d4 d5 d6 k c c0) (MABNaNbKeyK d d0 d1 d2 d3) l) st2), invP st2 *)
simple induction st2; intros a0 b0 s0 l0; elim a0; elim b0; elim s0.
(* Goal: forall (d10 d11 d12 d13 d14 d15 d16 d17 : D) (k1 : K) (c1 c2 : C) (d18 d19 d20 : D) (k2 : K) (_ : 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)) (_ : rel (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 15 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)) (_ : rel (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) *)
intros Inv0 Inv1 InvP.
(* Goal: forall _ : rel (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 rel in |- *.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
intros Rel1_8.
(* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel1_8; clear Rel1_8.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
(* Goal: forall _ : 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), invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
exact (POinvprel1 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
intros Rel2_8.
(* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel2_8; clear Rel2_8.
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
(* Goal: forall _ : 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) *)
exact (POinvprel2 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
(* Goal: forall _ : or (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)) (or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
intros Rel3_8.
(* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel3_8; clear Rel3_8.
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
(* Goal: forall _ : 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) *)
exact (POinvprel3 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
(* Goal: forall _ : or (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)) (or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
intros Rel4_8.
(* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel4_8; clear Rel4_8.
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
(* Goal: forall _ : 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) *)
exact (POinvprel4 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
(* Goal: forall _ : or (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)) (or (rel6 (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)) (or (rel7 (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)) (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) *)
intros Rel5_8.
(* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel5_8; clear Rel5_8.
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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) *)
(* Goal: forall _ : 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) *)
exact (POinvprel5 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
(* Goal: forall _ : or (rel6 (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)) (or (rel7 (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)) (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) *)
intros Rel6_8.
(* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel6_8; clear Rel6_8.
(* Goal: forall _ : or (rel7 (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)) (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) *)
(* Goal: forall _ : rel6 (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) *)
exact (POinvprel6 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
(* Goal: forall _ : or (rel7 (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)) (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) *)
intros Rel7_8.
(* Goal: invP (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
elim Rel7_8; clear Rel7_8.
(* Goal: forall _ : 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) *)
(* Goal: forall _ : rel7 (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) *)
exact (POinvprel7 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
(* Goal: forall _ : 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) *)
exact (POinvprel8 l l0 k k0 k1 k2 c c0 c1 c2 d d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 Inv0 Inv1 InvP).
Qed.
|
Set Automatic Coercions Import.
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Module_cat.
Require Export Monoid_util.
Require Export Group_util.
Section Module.
Variable R : RING.
Variable E : Setoid.
Variable genlaw : E -> E -> E.
Variable e : E.
Variable geninv : E -> E.
Variable gen_module_op : R -> 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).
Hypothesis
op_comp :
forall (a b : R) (x y : E),
Equal a b -> Equal x y -> Equal (gen_module_op a x) (gen_module_op b y).
Hypothesis
oplin_l :
forall (a b : R) (x : E),
Equal (gen_module_op (sgroup_law R a b) x)
(genlaw (gen_module_op a x) (gen_module_op b x)).
Hypothesis
oplin_r :
forall (a : R) (x y : E),
Equal (gen_module_op a (genlaw x y))
(genlaw (gen_module_op a x) (gen_module_op a y)).
Hypothesis
opassoc :
forall (a b : R) (x : E),
Equal (gen_module_op a (gen_module_op b x))
(gen_module_op (ring_mult a b) x).
Hypothesis opunit : forall x : E, Equal (gen_module_op (ring_unit R) x) x.
Definition module_util_endo_el : forall a : R, Endo_SET E.
Proof.
(* Goal: forall _ : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), Carrier (sgroup_set (monoid_sgroup (Endo_SET E))) *)
intros a; try assumption.
(* Goal: Carrier (sgroup_set (monoid_sgroup (Endo_SET E))) *)
simpl in |- *.
(* Goal: Map E E *)
apply (Build_Map (A:=E) (B:=E) (Ap:=fun x : E => gen_module_op a x)).
(* Goal: @fun_compatible E E (fun x : Carrier E => gen_module_op a x) *)
red in |- *.
(* Goal: forall (x y : Carrier E) (_ : @Equal E x y), @Equal E (gen_module_op a x) (gen_module_op a y) *)
auto with algebra.
Qed.
Definition module_util_op : operation (ring_monoid R) E.
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))) E) *)
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 E) *)
apply (BUILD_HOM_MONOID (G:=ring_monoid R) (G':=Endo_SET E) (ff:=module_util_endo_el)).
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* 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 E))) (module_util_endo_el (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 E)) (module_util_endo_el x) (module_util_endo_el 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 E))) (module_util_endo_el x) (module_util_endo_el y) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* 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 E))) (module_util_endo_el (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 E)) (module_util_endo_el x) (module_util_endo_el 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 E E (module_util_endo_el x) (module_util_endo_el y) *)
intros x y H'; red in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* 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 E))) (module_util_endo_el (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 E)) (module_util_endo_el x) (module_util_endo_el y)) *)
(* Goal: forall x0 : Carrier E, @Equal E (@Ap E E (module_util_endo_el x) x0) (@Ap E E (module_util_endo_el y) x0) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* 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 E))) (module_util_endo_el (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 E)) (module_util_endo_el x) (module_util_endo_el y)) *)
(* Goal: forall x0 : Carrier E, @Equal E (gen_module_op x x0) (gen_module_op y x0) *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* 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 E))) (module_util_endo_el (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 E)) (module_util_endo_el x) (module_util_endo_el y)) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Map_eq E E (module_util_endo_el (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 E) (module_util_endo_el x) (module_util_endo_el y)) *)
intros x y; red in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* Goal: forall x0 : Carrier E, @Equal E (@Ap E E (module_util_endo_el (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 E E (sgroup_law (Endo_SET_sgroup E) (module_util_endo_el x) (module_util_endo_el y)) x0) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* Goal: forall x0 : Carrier E, @Equal E (gen_module_op (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) (gen_module_op x (gen_module_op y x0)) *)
intros x0; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
(* Goal: @Equal E (gen_module_op (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) (gen_module_op x (gen_module_op y x0)) *)
apply Trans with (gen_module_op (ring_mult x y) x0); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET E))) (module_util_endo_el (@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 E)) (monoid_on_def (Endo_SET E))) *)
simpl in |- *.
(* Goal: @Map_eq E E (module_util_endo_el (@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 E) *)
red in |- *.
(* Goal: forall x : Carrier E, @Equal E (@Ap E E (module_util_endo_el (@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 E E (Id E) x) *)
simpl in |- *.
(* Goal: forall x : Carrier E, @Equal E (gen_module_op (@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) x *)
auto with algebra.
Qed.
Definition module_util_G : ABELIAN_GROUP.
Proof.
(* Goal: Ob ABELIAN_GROUP *)
apply (BUILD_ABELIAN_GROUP (E:=E) (genlaw:=genlaw) (e:=e) (geninv:=geninv)); auto with algebra.
Qed.
Definition BUILD_MODULE : MODULE R.
Proof.
(* Goal: Ob (MODULE R) *)
apply (Build_module (R:=R) (module_carrier:=module_util_G)).
(* Goal: module_on R module_util_G *)
apply (Build_module_on (R:=R) (M:=module_util_G) (module_op:=module_util_op)).
(* Goal: @op_lin_right R module_util_G module_util_op *)
(* Goal: @op_lin_left R module_util_G module_util_op *)
abstract exact oplin_l.
(* Goal: @op_lin_right R module_util_G module_util_op *)
abstract exact oplin_r.
Qed.
End Module.
Section Hom.
Variable R : RING.
Variable Mod Mod' : MODULE R.
Variable ff : Mod -> Mod'.
Hypothesis ffcomp : forall x y : Mod, Equal x y -> Equal (ff x) (ff y).
Hypothesis
fflaw :
forall x y : Mod,
Equal (ff (sgroup_law Mod x y)) (sgroup_law Mod' (ff x) (ff y)).
Hypothesis ffunit : Equal (ff (monoid_unit Mod)) (monoid_unit Mod').
Hypothesis
ffop :
forall (a : R) (x : Mod),
Equal (ff (module_mult a x)) (module_mult a (ff x)).
Definition BUILD_HOM_MODULE : Hom Mod Mod' :=
Build_module_hom
(module_monoid_hom:=BUILD_HOM_GROUP (G:=Mod) (G':=Mod') (ff:=ff) ffcomp
fflaw ffunit) ffop.
End Hom.
Section Module_on_group.
Variable R : RING.
Variable module_util_G : ABELIAN_GROUP.
Variable gen_module_op : R -> module_util_G -> module_util_G.
Hypothesis
op_comp :
forall (a b : R) (x y : module_util_G),
Equal a b -> Equal x y -> Equal (gen_module_op a x) (gen_module_op b y).
Hypothesis
oplin_l :
forall (a b : R) (x : module_util_G),
Equal (gen_module_op (sgroup_law R a b) x)
(sgroup_law module_util_G (gen_module_op a x) (gen_module_op b x)).
Hypothesis
oplin_r :
forall (a : R) (x y : module_util_G),
Equal (gen_module_op a (sgroup_law module_util_G x y))
(sgroup_law module_util_G (gen_module_op a x) (gen_module_op a y)).
Hypothesis
opassoc :
forall (a b : R) (x : module_util_G),
Equal (gen_module_op a (gen_module_op b x))
(gen_module_op (ring_mult a b) x).
Hypothesis
opunit : forall x : module_util_G, Equal (gen_module_op (ring_unit R) x) x.
Definition module_util_endo_el2 : forall a : R, Endo_SET module_util_G.
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 module_util_G))))))) *)
intros a; try assumption.
(* Goal: Carrier (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
simpl in |- *.
(* Goal: Map (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) *)
apply (Build_Map (A:=module_util_G) (B:=module_util_G) (Ap:=fun x : module_util_G => gen_module_op a x)).
(* Goal: @fun_compatible (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (fun x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) => gen_module_op a x) *)
red in |- *.
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op a x) (gen_module_op a y) *)
auto with algebra.
Qed.
Definition module_util_op2 : operation (ring_monoid R) module_util_G.
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 module_util_G))))) *)
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 (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *)
apply (BUILD_HOM_MONOID (G:=ring_monoid R) (G':=Endo_SET module_util_G) (ff:=module_util_endo_el2)).
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* 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 (abelian_group_group module_util_G))))))) (module_util_endo_el2 (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 (abelian_group_group module_util_G)))))) (module_util_endo_el2 x) (module_util_endo_el2 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 (abelian_group_group module_util_G))))))) (module_util_endo_el2 x) (module_util_endo_el2 y) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* 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 (abelian_group_group module_util_G))))))) (module_util_endo_el2 (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 (abelian_group_group module_util_G)))))) (module_util_endo_el2 x) (module_util_endo_el2 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 (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 x) (module_util_endo_el2 y) *)
intros x y H'; red in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* 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 (abelian_group_group module_util_G))))))) (module_util_endo_el2 (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 (abelian_group_group module_util_G)))))) (module_util_endo_el2 x) (module_util_endo_el2 y)) *)
(* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 x) x0) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 y) x0) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* 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 (abelian_group_group module_util_G))))))) (module_util_endo_el2 (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 (abelian_group_group module_util_G)))))) (module_util_endo_el2 x) (module_util_endo_el2 y)) *)
(* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op x x0) (gen_module_op y x0) *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* 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 (abelian_group_group module_util_G))))))) (module_util_endo_el2 (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 (abelian_group_group module_util_G)))))) (module_util_endo_el2 x) (module_util_endo_el2 y)) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group R))))), @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (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 (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) (module_util_endo_el2 x) (module_util_endo_el2 y)) *)
intros x y; red in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (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 (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_law (Endo_SET_sgroup (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) (module_util_endo_el2 x) (module_util_endo_el2 y)) x0) *)
simpl in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* Goal: forall x0 : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (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) (gen_module_op x (gen_module_op y x0)) *)
intros x0; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (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) (gen_module_op x (gen_module_op y x0)) *)
apply Trans with (gen_module_op (ring_mult x y) x0); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) (module_util_endo_el2 (@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 (abelian_group_group module_util_G)))))) (monoid_on_def (Endo_SET (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))))) *)
simpl in |- *.
(* Goal: @Map_eq (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@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 (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) *)
red in |- *.
(* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (@Ap (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (module_util_endo_el2 (@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 (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (Id (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G))))) x) *)
simpl in |- *.
(* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))), @Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group module_util_G)))) (gen_module_op (@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) x *)
auto with algebra.
Qed.
Definition BUILD_MODULE_GROUP : MODULE R.
Proof.
(* Goal: Ob (MODULE R) *)
apply (Build_module (R:=R) (module_carrier:=module_util_G)).
(* Goal: module_on R module_util_G *)
apply (Build_module_on (R:=R) (M:=module_util_G) (module_op:=module_util_op2)).
(* Goal: @op_lin_right R module_util_G module_util_op2 *)
(* Goal: @op_lin_left R module_util_G module_util_op2 *)
abstract exact oplin_l.
(* Goal: @op_lin_right R module_util_G module_util_op2 *)
abstract exact oplin_r.
Qed.
End Module_on_group. |
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrbool ssrfun eqtype ssrnat seq path fintype.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Definition grel (T : eqType) (g : T -> seq T) := [rel x y | y \in g x].
Section Connect.
Variable T : finType.
Section Dfs.
Variable g : T -> seq T.
Implicit Type v w a : seq T.
Fixpoint dfs n v x :=
if x \in v then v else
if n is n'.+1 then foldl (dfs n') (x :: v) (g x) else v.
Lemma subset_dfs n v a : v \subset foldl (dfs n) v a.
Proof.
(* Goal: is_true (@subset T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) v) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@foldl (Equality.sort (Finite.eqType T)) (list (Finite.sort T)) (dfs n) v a))) *)
elim: n a v => [|n IHn]; first by elim=> //= *; rewrite if_same.
(* Goal: forall a v : list (Finite.sort T), is_true (@subset T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) v) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@foldl (Equality.sort (Finite.eqType T)) (list (Finite.sort T)) (dfs (S n)) v a))) *)
elim=> //= x a IHa v; apply: subset_trans {IHa}(IHa _); case: ifP => // _.
(* Goal: is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_eq_seq (Finite.eqType T) v)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_eq_seq (Finite.eqType T) (@foldl (Finite.sort T) (list (Finite.sort T)) (dfs n) (@cons (Finite.sort T) x v) (g x))))) *)
by apply: subset_trans (IHn _ _); apply/subsetP=> y; apply: predU1r.
Qed.
Inductive dfs_path v x y : Prop :=
DfsPath p of path (grel g) x p & y = last x p & [disjoint x :: p & v].
Lemma dfs_pathP n x y v :
#|T| <= #|v| + n -> y \notin v -> reflect (dfs_path v x y) (y \in dfs n v x).
Lemma dfsP x y :
reflect (exists2 p, path (grel g) x p & y = last x p) (y \in dfs #|T| [::] x).
Proof.
(* Goal: Bool.reflect (@ex2 (list (Equality.sort (Finite.eqType T))) (fun p : list (Equality.sort (Finite.eqType T)) => is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@grel (Finite.eqType T) g)) x p)) (fun p : list (Equality.sort (Finite.eqType T)) => @eq (Equality.sort (Finite.eqType T)) y (@last (Equality.sort (Finite.eqType T)) x p))) (@in_mem (Equality.sort (Finite.eqType T)) y (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (dfs (@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)))))) (@nil (Finite.sort T)) x))) *)
apply: (iffP (dfs_pathP _ _ _)); rewrite ?card0 // => [] [p]; exists p => //.
(* Goal: is_true (@disjoint T (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Equality.sort (Finite.eqType T)) x p)) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@nil (Finite.sort T)))) *)
by rewrite disjoint_sym disjoint0.
Qed.
End Dfs.
Variable e : rel T.
Definition rgraph x := enum (e x).
Lemma rgraphK : grel rgraph =2 e.
Proof.
(* Goal: @eqrel bool (Equality.sort (Finite.eqType T)) (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@grel (Finite.eqType T) rgraph)) e *)
by move=> x y; rewrite /= mem_enum.
Qed.
Definition connect : rel T := fun x y => y \in dfs rgraph #|T| [::] x.
Canonical connect_app_pred x := ApplicativePred (connect x).
Lemma connectP x y :
reflect (exists2 p, path e x p & y = last x p) (connect x y).
Lemma connect_trans : transitive connect.
Lemma connect0 x : connect x x.
Proof.
(* Goal: is_true (connect x x) *)
by apply/connectP; exists [::].
Qed.
Lemma eq_connect0 x y : x = y -> connect x y.
Proof.
(* Goal: forall _ : @eq (Finite.sort T) x y, is_true (connect x y) *)
by move->; apply: connect0.
Qed.
Lemma connect1 x y : e x y -> connect x y.
Proof.
(* Goal: forall _ : is_true (e x y), is_true (connect x y) *)
by move=> e_xy; apply/connectP; exists [:: y]; rewrite /= ?e_xy.
Qed.
Lemma path_connect x p : path e x p -> subpred (mem (x :: p)) (connect x).
Proof.
(* Goal: forall _ : is_true (@path (Finite.sort T) e x p), @subpred (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)) (@cons (Finite.sort T) x p)))) (connect x) *)
move=> e_p y p_y; case/splitPl: p / p_y e_p => p q <-.
(* Goal: forall _ : is_true (@path (Finite.sort T) e x (@cat (Equality.sort (Finite.eqType T)) p q)), is_true (connect x (@last (Equality.sort (Finite.eqType T)) x p)) *)
by rewrite cat_path => /andP[e_p _]; apply/connectP; exists p.
Qed.
Definition root x := odflt x (pick (connect x)).
Definition roots : pred T := fun x => root x == x.
Canonical roots_pred := ApplicativePred roots.
Definition n_comp_mem (m_a : mem_pred T) := #|predI roots m_a|.
Lemma connect_root x : connect x (root x).
Proof.
(* Goal: is_true (connect x (root x)) *)
by rewrite /root; case: pickP; rewrite ?connect0.
Qed.
Definition connect_sym := symmetric connect.
Hypothesis sym_e : connect_sym.
Lemma same_connect : left_transitive connect.
Proof.
(* Goal: @left_transitive (Finite.sort T) connect *)
exact: sym_left_transitive connect_trans.
Qed.
Lemma same_connect_r : right_transitive connect.
Proof.
(* Goal: @right_transitive (Finite.sort T) connect *)
exact: sym_right_transitive connect_trans.
Qed.
Lemma same_connect1 x y : e x y -> connect x =1 connect y.
Proof.
(* Goal: forall _ : is_true (e x y), @eqfun bool (Finite.sort T) (connect x) (connect y) *)
by move/connect1; apply: same_connect.
Qed.
Lemma same_connect1r x y : e x y -> connect^~ x =1 connect^~ y.
Proof.
(* Goal: forall _ : is_true (e x y), @eqfun bool (Finite.sort T) (fun x0 : Finite.sort T => connect x0 x) (fun x : Finite.sort T => connect x y) *)
by move/connect1; apply: same_connect_r.
Qed.
Lemma rootP x y : reflect (root x = root y) (connect x y).
Proof.
(* Goal: Bool.reflect (@eq (Finite.sort T) (root x) (root y)) (connect x y) *)
apply: (iffP idP) => e_xy.
(* Goal: is_true (connect x y) *)
(* Goal: @eq (Finite.sort T) (root x) (root y) *)
by rewrite /root -(eq_pick (same_connect e_xy)); case: pickP e_xy => // ->.
(* Goal: is_true (connect x y) *)
by apply: (connect_trans (connect_root x)); rewrite e_xy sym_e connect_root.
Qed.
Lemma root_root x : root (root x) = root x.
Proof.
(* Goal: @eq (Finite.sort T) (root (root x)) (root x) *)
exact/esym/rootP/connect_root.
Qed.
Lemma roots_root x : roots (root x).
Proof.
(* Goal: is_true (roots (root x)) *)
exact/eqP/root_root.
Qed.
Lemma root_connect x y : (root x == root y) = connect x y.
Proof.
(* Goal: @eq bool (@eq_op (Finite.eqType T) (root x) (root y)) (connect x y) *)
exact: sameP eqP (rootP x y).
Qed.
Definition closed_mem m_a := forall x y, e x y -> in_mem x m_a = in_mem y m_a.
Definition closure_mem m_a : pred T :=
fun x => ~~ disjoint (mem (connect x)) m_a.
End Connect.
Hint Resolve connect0 : core.
Notation n_comp e a := (n_comp_mem e (mem a)).
Notation closed e a := (closed_mem e (mem a)).
Notation closure e a := (closure_mem e (mem a)).
Prenex Implicits connect root roots.
Arguments dfsP {T g x y}.
Arguments connectP {T e x y}.
Arguments rootP [T e] _ {x y}.
Notation fconnect f := (connect (coerced_frel f)).
Notation froot f := (root (coerced_frel f)).
Notation froots f := (roots (coerced_frel f)).
Notation fcard_mem f := (n_comp_mem (coerced_frel f)).
Notation fcard f a := (fcard_mem f (mem a)).
Notation fclosed f a := (closed (coerced_frel f) a).
Notation fclosure f a := (closure (coerced_frel f) a).
Section EqConnect.
Variable T : finType.
Implicit Types (e : rel T) (a : pred T).
Lemma connect_sub e e' :
subrel e (connect e') -> subrel (connect e) (connect e').
Proof.
(* Goal: forall _ : @subrel (Finite.sort T) e (@connect T e'), @subrel (Finite.sort T) (@connect T e) (@connect T e') *)
move=> e'e x _ /connectP[p e_p ->]; elim: p x e_p => //= y p IHp x /andP[exy].
(* Goal: forall _ : is_true (@path (Finite.sort T) e y p), is_true (@connect T e' x (@last (Finite.sort T) y p)) *)
by move/IHp; apply: connect_trans; apply: e'e.
Qed.
Lemma relU_sym e e' :
connect_sym e -> connect_sym e' -> connect_sym (relU e e').
Proof.
(* Goal: forall (_ : @connect_sym T e) (_ : @connect_sym T e'), @connect_sym T (@rel_of_simpl_rel (Finite.sort T) (@relU (Finite.sort T) e e')) *)
move=> sym_e sym_e'; apply: symmetric_from_pre => x _ /connectP[p e_p ->].
(* Goal: is_true (@connect T (@rel_of_simpl_rel (Finite.sort T) (@relU (Finite.sort T) e e')) (@last (Finite.sort T) x p) x) *)
elim: p x e_p => //= y p IHp x /andP[e_xy /IHp{IHp}/connect_trans]; apply.
(* Goal: is_true (@connect T (@rel_of_simpl_rel (Finite.sort T) (@relU (Finite.sort T) e e')) y x) *)
case/orP: e_xy => /connect1; rewrite (sym_e, sym_e'); by apply: connect_sub y x => x y e_xy; rewrite connect1 //= e_xy ?orbT.
Qed.
Lemma eq_connect e e' : e =2 e' -> connect e =2 connect e'.
Proof.
(* Goal: forall _ : @eqrel bool (Finite.sort T) (Finite.sort T) e e', @eqrel bool (Finite.sort T) (Finite.sort T) (@connect T e) (@connect T e') *)
move=> eq_e x y; apply/connectP/connectP=> [] [p e_p ->]; by exists p; rewrite // (eq_path eq_e) in e_p *.
Qed.
Qed.
Lemma eq_n_comp e e' : connect e =2 connect e' -> n_comp_mem e =1 n_comp_mem e'.
Proof.
(* Goal: forall _ : @eqrel bool (Finite.sort T) (Finite.sort T) (@connect T e) (@connect T e'), @eqfun nat (mem_pred (Finite.sort T)) (@n_comp_mem T e) (@n_comp_mem T e') *)
move=> eq_e [a]; apply: eq_card => 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) (@roots T e) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@Mem (Finite.sort T) a))))))) (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@predI (Finite.sort T) (@roots T e') (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@Mem (Finite.sort T) a))))))) *)
by rewrite !inE /= /roots /root /= (eq_pick (eq_e x)).
Qed.
Lemma eq_n_comp_r {e} a a' : a =i a' -> n_comp e a = n_comp e a'.
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)) a'), @eq nat (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a')) *)
by move=> eq_a; apply: eq_card => x; rewrite inE /= eq_a.
Qed.
Lemma n_compC a e : n_comp e T = n_comp e a + n_comp e [predC a].
Lemma eq_root e e' : e =2 e' -> root e =1 root e'.
Proof.
(* Goal: forall _ : @eqrel bool (Finite.sort T) (Finite.sort T) e e', @eqfun (Finite.sort T) (Finite.sort T) (@root T e) (@root T e') *)
by move=> eq_e x; rewrite /root (eq_pick (eq_connect eq_e x)).
Qed.
Lemma eq_roots e e' : e =2 e' -> roots e =1 roots e'.
Proof.
(* Goal: forall _ : @eqrel bool (Finite.sort T) (Finite.sort T) e e', @eqfun bool (Finite.sort T) (@roots T e) (@roots T e') *)
by move=> eq_e x; rewrite /roots (eq_root eq_e).
Qed.
End EqConnect.
Section Closure.
Variables (T : finType) (e : rel T).
Hypothesis sym_e : connect_sym e.
Implicit Type a : pred T.
Lemma same_connect_rev : connect e =2 connect (fun x y => e y x).
Lemma intro_closed a : (forall x y, e x y -> x \in a -> y \in a) -> closed e a.
Proof.
(* Goal: forall _ : forall (x y : Finite.sort T) (_ : is_true (e x y)) (_ : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))), is_true (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)), @closed_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) *)
move=> cl_a x y e_xy; apply/idP/idP=> [|a_y]; first exact: cl_a.
(* Goal: is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
have{x e_xy} /connectP[p e_p ->]: connect e y x by rewrite sym_e connect1.
(* Goal: is_true (@in_mem (Finite.sort T) (@last (Finite.sort T) y p) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
by elim: p y a_y e_p => //= y p IHp x a_x /andP[/cl_a/(_ a_x)]; apply: IHp.
Qed.
Lemma closed_connect a :
closed e a -> forall x y, connect e x y -> (x \in a) = (y \in a).
Proof.
(* Goal: forall (_ : @closed_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (x y : Finite.sort T) (_ : is_true (@connect T e x y)), @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
move=> cl_a x _ /connectP[p e_p ->].
(* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@in_mem (Finite.sort T) (@last (Finite.sort T) x p) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
by elim: p x e_p => //= y p IHp x /andP[/cl_a->]; apply: IHp.
Qed.
Lemma connect_closed x : closed e (connect e x).
Proof.
(* Goal: @closed_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@connect T e x)) *)
by move=> y z /connect1/same_connect_r; apply.
Qed.
Lemma predC_closed a : closed e a -> closed e [predC a].
Proof.
(* Goal: forall _ : @closed_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a), @closed_mem T e (@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))))) *)
by move=> cl_a x y /cl_a; rewrite !inE => ->.
Qed.
Lemma closure_closed a : closed e (closure e a).
Lemma mem_closure a : {subset a <= closure e a}.
Proof.
(* Goal: @sub_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@closure_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))) *)
by move=> x a_x; apply/existsP; exists x; rewrite !inE connect0.
Qed.
Lemma subset_closure a : a \subset closure e a.
Proof.
(* Goal: is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@closure_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))) *)
by apply/subsetP; apply: mem_closure.
Qed.
Lemma n_comp_closure2 x y :
n_comp e (closure e (pred2 x y)) = (~~ connect e x y).+1.
Lemma n_comp_connect x : n_comp e (connect e x) = 1.
Proof.
(* Goal: @eq nat (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@connect T e x))) (S O) *)
rewrite -(card1 (root e x)); apply: eq_card => y.
(* 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) (@roots T e) (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@connect T e x)))))))) (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Equality.sort (Finite.eqType T)) (@pred1 (Finite.eqType T) (@root T e x))))) *)
apply/andP/eqP => [[/eqP r_y /rootP-> //] | ->] /=.
(* Goal: and (is_true (@roots T e (@root T e x))) (is_true (@in_mem (Finite.sort T) (@root T e x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@connect T e x)))) *)
by rewrite inE connect_root roots_root.
Qed.
End Closure.
Section Orbit.
Variables (T : finType) (f : T -> T).
Definition order x := #|fconnect f x|.
Definition orbit x := traject f x (order x).
Definition findex x y := index y (orbit x).
Definition finv x := iter (order x).-1 f x.
Lemma fconnect_iter n x : fconnect f x (iter n f x).
Lemma fconnect1 x : fconnect f x (f x).
Proof.
(* Goal: is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x (f x)) *)
exact: (fconnect_iter 1).
Qed.
Lemma fconnect_finv x : fconnect f x (finv x).
Proof.
(* Goal: is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x (finv x)) *)
exact: fconnect_iter.
Qed.
Lemma orderSpred x : (order x).-1.+1 = order x.
Proof.
(* Goal: @eq nat (S (Nat.pred (order x))) (order x) *)
by rewrite /order (cardD1 x) [_ x _]connect0.
Qed.
Lemma size_orbit x : size (orbit x) = order x.
Proof.
(* Goal: @eq nat (@size (Finite.sort T) (orbit x)) (order x) *)
exact: size_traject.
Qed.
Lemma looping_order x : looping f x (order x).
Lemma fconnect_orbit x y : fconnect f x y = (y \in orbit x).
Proof.
(* Goal: @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@in_mem (Finite.sort T) y (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (orbit x))) *)
apply/idP/idP=> [/connectP[_ /fpathP[m ->] ->] | /trajectP[i _ ->]].
(* Goal: is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x (@iter (Equality.sort (Finite.eqType T)) i f x)) *)
(* Goal: is_true (@in_mem (Finite.sort T) (@last (Finite.sort T) x (@traject (Equality.sort (Finite.eqType T)) f (f x) m)) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (orbit x))) *)
by rewrite last_traject; apply/loopingP/looping_order.
(* Goal: is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x (@iter (Equality.sort (Finite.eqType T)) i f x)) *)
exact: fconnect_iter.
Qed.
Lemma orbit_uniq x : uniq (orbit x).
Proof.
(* Goal: is_true (@uniq (Finite.eqType T) (orbit x)) *)
rewrite /orbit -orderSpred looping_uniq; set n := (order x).-1.
(* Goal: is_true (negb (@looping (Finite.eqType T) f x n)) *)
apply: contraFN (ltnn n) => /trajectP[i lt_i_n eq_fnx_fix].
(* Goal: is_true (leq (S n) n) *)
rewrite {1}/n orderSpred /order -(size_traject f x n).
(* Goal: is_true (leq (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x))) (@size (Finite.sort T) (@traject (Finite.sort T) f x n))) *)
apply: (leq_trans (subset_leq_card _) (card_size _)); apply/subsetP=> z.
(* Goal: forall _ : is_true (@in_mem (Finite.sort T) z (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x))), is_true (@in_mem (Finite.sort T) z (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_eq_seq (Finite.eqType T) (@traject (Finite.sort T) f x n)))) *)
rewrite inE fconnect_orbit => /trajectP[j le_jn ->{z}].
(* Goal: is_true (@in_mem (Finite.sort T) (@iter (Equality.sort (Finite.eqType T)) j f x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_eq_seq (Finite.eqType T) (@traject (Finite.sort T) f x n)))) *)
rewrite -orderSpred -/n ltnS leq_eqVlt in le_jn.
(* Goal: is_true (@in_mem (Finite.sort T) (@iter (Equality.sort (Finite.eqType T)) j f x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_eq_seq (Finite.eqType T) (@traject (Finite.sort T) f x n)))) *)
by apply/trajectP; case/predU1P: le_jn => [->|]; [exists i | exists j].
Qed.
Lemma findex_max x y : fconnect f x y -> findex x y < order x.
Proof.
(* Goal: forall _ : is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y), is_true (leq (S (findex x y)) (order x)) *)
by rewrite [_ y]fconnect_orbit -index_mem size_orbit.
Qed.
Lemma findex_iter x i : i < order x -> findex x (iter i f x) = i.
Proof.
(* Goal: forall _ : is_true (leq (S i) (order x)), @eq nat (findex x (@iter (Finite.sort T) i f x)) i *)
move=> lt_ix; rewrite -(nth_traject f lt_ix) /findex index_uniq ?orbit_uniq //.
(* Goal: is_true (leq (S i) (@size (Equality.sort (Finite.eqType T)) (@traject (Finite.sort T) f x (order x)))) *)
by rewrite size_orbit.
Qed.
Lemma iter_findex x y : fconnect f x y -> iter (findex x y) f x = y.
Proof.
(* Goal: forall _ : is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y), @eq (Finite.sort T) (@iter (Finite.sort T) (findex x y) f x) y *)
rewrite [_ y]fconnect_orbit => fxy; pose i := index y (orbit x).
(* Goal: @eq (Finite.sort T) (@iter (Finite.sort T) (findex x y) f x) y *)
have lt_ix: i < order x by rewrite -size_orbit index_mem.
(* Goal: @eq (Finite.sort T) (@iter (Finite.sort T) (findex x y) f x) y *)
by rewrite -(nth_traject f lt_ix) nth_index.
Qed.
Lemma findex0 x : findex x x = 0.
Proof.
(* Goal: @eq nat (findex x x) O *)
by rewrite /findex /orbit -orderSpred /= eqxx.
Qed.
Lemma fconnect_invariant (T' : eqType) (k : T -> T') :
invariant f k =1 xpredT -> forall x y, fconnect f x y -> k x = k y.
Proof.
(* Goal: forall (_ : @eqfun bool (Finite.sort T) (@pred_of_simpl (Finite.sort T) (@invariant (Finite.sort T) T' f k)) (fun _ : Finite.sort T => true)) (x y : Finite.sort T) (_ : is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y)), @eq (Equality.sort T') (k x) (k y) *)
move=> eq_k_f x y /iter_findex <-; elim: {y}(findex x y) => //= n ->.
(* Goal: @eq (Equality.sort T') (k (@iter (Finite.sort T) n f x)) (k (f (@iter (Finite.sort T) n f x))) *)
by rewrite (eqP (eq_k_f _)).
Qed.
Section Loop.
Variable p : seq T.
Hypotheses (f_p : fcycle f p) (Up : uniq p).
Variable x : T.
Hypothesis p_x : x \in p.
Lemma fconnect_cycle y : fconnect f x y = (y \in p).
Proof.
(* Goal: @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@in_mem (Finite.sort T) y (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) p)) *)
have [i q def_p] := rot_to p_x; rewrite -(mem_rot i p) def_p.
(* Goal: @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@in_mem (Equality.sort (Finite.eqType T)) y (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Equality.sort (Finite.eqType T)) x q))) *)
have{i def_p} /andP[/eqP q_x f_q]: (f (last x q) == x) && fpath f x q.
(* Goal: @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@in_mem (Equality.sort (Finite.eqType T)) y (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Equality.sort (Finite.eqType T)) x q))) *)
(* Goal: is_true (andb (@eq_op (Finite.eqType T) (f (@last (Finite.sort T) x q)) x) (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x q)) *)
by have:= f_p; rewrite -(rot_cycle i) def_p (cycle_path x).
(* Goal: @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@in_mem (Equality.sort (Finite.eqType T)) y (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Equality.sort (Finite.eqType T)) x q))) *)
apply/idP/idP=> [/connectP[_ /fpathP[j ->] ->] | ]; last exact: path_connect.
(* Goal: is_true (@in_mem (Equality.sort (Finite.eqType T)) (@last (Finite.sort T) x (@traject (Equality.sort (Finite.eqType T)) f (f x) j)) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Equality.sort (Finite.eqType T)) x q))) *)
case/fpathP: f_q q_x => n ->; rewrite !last_traject -iterS => def_x.
(* Goal: is_true (@in_mem (Equality.sort (Finite.eqType T)) (@iter (Finite.sort T) j f x) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@cons (Equality.sort (Finite.eqType T)) x (@traject (Equality.sort (Finite.eqType T)) f (f x) n)))) *)
by apply: (@loopingP _ f x n.+1); rewrite /looping def_x /= mem_head.
Qed.
Lemma order_cycle : order x = size p.
Proof.
(* Goal: @eq nat (order x) (@size (Finite.sort T) p) *)
by rewrite -(card_uniqP Up); apply (eq_card fconnect_cycle).
Qed.
Lemma orbit_rot_cycle : {i : nat | orbit x = rot i p}.
Proof.
(* Goal: @sig nat (fun i : nat => @eq (list (Finite.sort T)) (orbit x) (@rot (Finite.sort T) i p)) *)
have [i q def_p] := rot_to p_x; exists i.
(* Goal: @eq (list (Finite.sort T)) (orbit x) (@rot (Finite.sort T) i p) *)
rewrite /orbit order_cycle -(size_rot i) def_p.
(* Goal: @eq (list (Finite.sort T)) (@traject (Finite.sort T) f x (@size (Finite.sort T) (@cons (Equality.sort (Finite.eqType T)) x q))) (@cons (Equality.sort (Finite.eqType T)) x q) *)
suffices /fpathP[j ->]: fpath f x q by rewrite /= size_traject.
(* Goal: is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x q) *)
by move: f_p; rewrite -(rot_cycle i) def_p (cycle_path x); case/andP.
Qed.
End Loop.
Section orbit_in.
Variable S : pred_sort (predPredType T).
Hypothesis f_in : {in S, forall x, f x \in S}.
Hypothesis injf : {in S &, injective f}.
Lemma iter_in : {in S, forall x i, iter i f x \in S}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Finite.sort T => forall i : nat, is_true (@in_mem (Finite.sort T) (@iter (Finite.sort T) i f x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S))) (inPhantom (forall (x : Finite.sort T) (i : nat), is_true (@in_mem (Finite.sort T) (@iter (Finite.sort T) i f x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S)))) *)
by move=> x xS; elim=> [|i /f_in].
Qed.
Lemma finv_in : {in S, forall x, finv x \in S}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Finite.sort T => is_true (@in_mem (Finite.sort T) (finv x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S))) (inPhantom (forall x : Finite.sort T, is_true (@in_mem (Finite.sort T) (finv x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S)))) *)
by move=> ??; rewrite iter_in.
Qed.
Lemma f_finv_in : {in S, cancel finv f}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Finite.sort T => @eq (Finite.sort T) (f (finv x)) x) (inPhantom (@cancel (Finite.sort T) (Finite.sort T) finv f)) *)
move=> x xS; move: (looping_order x) (orbit_uniq x).
(* Goal: forall (_ : is_true (@looping (Finite.eqType T) f x (order x))) (_ : is_true (@uniq (Finite.eqType T) (orbit x))), @eq (Finite.sort T) (f (finv x)) x *)
rewrite /looping /orbit -orderSpred looping_uniq /= /looping; set n := _.-1.
(* Goal: forall (_ : is_true (@in_mem (Finite.sort T) (f (@iter (Finite.sort T) n f x)) (@mem (Finite.sort T) (seq_predType (Finite.eqType T)) (@cons (Finite.sort T) x (@traject (Finite.sort T) f (f x) n))))) (_ : is_true (negb (@in_mem (Equality.sort (Finite.eqType T)) (@iter (Equality.sort (Finite.eqType T)) n f x) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@traject (Equality.sort (Finite.eqType T)) f x n))))), @eq (Finite.sort T) (f (finv x)) x *)
case/predU1P=> // /trajectP[i lt_i_n]; rewrite -iterSr.
(* Goal: forall (_ : @eq (Equality.sort (Finite.eqType T)) (f (@iter (Finite.sort T) n f x)) (@iter (Equality.sort (Finite.eqType T)) (Datatypes.S i) f x)) (_ : is_true (negb (@in_mem (Equality.sort (Finite.eqType T)) (@iter (Equality.sort (Finite.eqType T)) n f x) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@traject (Equality.sort (Finite.eqType T)) f x n))))), @eq (Finite.sort T) (f (finv x)) x *)
by move=> /injf ->; rewrite ?iter_in //; case/trajectP; exists i.
Qed.
Lemma finv_f_in : {in S, cancel f finv}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Finite.sort T => @eq (Finite.sort T) (finv (f x)) x) (inPhantom (@cancel (Finite.sort T) (Finite.sort T) f finv)) *)
by move=> x xS; apply/injf; rewrite ?iter_in ?f_finv_in ?f_in.
Qed.
Lemma finv_inj_in : {in S &, injective finv}.
Proof.
(* Goal: @prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x1 x2 : Finite.sort T => forall _ : @eq (Finite.sort T) (finv x1) (finv x2), @eq (Finite.sort T) x1 x2) (inPhantom (@injective (Finite.sort T) (Finite.sort T) finv)) *)
by move=> x y xS yS q; rewrite -(f_finv_in xS) q f_finv_in.
Qed.
Lemma fconnect_sym_in : {in S &, forall x y, fconnect f x y = fconnect f y x}.
Proof.
(* Goal: @prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x y : Finite.sort T => @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x)) (inPhantom (forall x y : Finite.sort T, @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x))) *)
suff Sf : {in S &, forall x y, fconnect f x y -> fconnect f y x}.
(* Goal: @prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x y : Finite.sort T => forall _ : is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y), is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x)) (inPhantom (forall (x y : Finite.sort T) (_ : is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y)), is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x))) *)
(* Goal: @prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x y : Finite.sort T => @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x)) (inPhantom (forall x y : Finite.sort T, @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x))) *)
by move=> *; apply/idP/idP=> /Sf->.
(* Goal: @prop_in2 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x y : Finite.sort T => forall _ : is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y), is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x)) (inPhantom (forall (x y : Finite.sort T) (_ : is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y)), is_true (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x))) *)
move=> x _ xS _ /connectP [p f_p ->]; elim: p => //= y p IHp in x xS f_p *.
move: f_p; rewrite -{2}(finv_f_in xS) => /andP[/eqP <- /(IHp _ (f_in xS))].
by move=> /connect_trans -> //; apply: fconnect_finv.
Qed.
Qed.
Lemma iter_order_in : {in S, forall x, iter (order x) f x = x}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Finite.sort T => @eq (Finite.sort T) (@iter (Finite.sort T) (order x) f x) x) (inPhantom (forall x : Finite.sort T, @eq (Finite.sort T) (@iter (Finite.sort T) (order x) f x) x)) *)
by move=> x xS; rewrite -orderSpred iterS; apply: f_finv_in.
Qed.
Lemma iter_finv_in n :
{in S, forall x, n <= order x -> iter n finv x = iter (order x - n) f x}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Finite.sort T => forall _ : is_true (leq n (order x)), @eq (Finite.sort T) (@iter (Finite.sort T) n finv x) (@iter (Finite.sort T) (subn (order x) n) f x)) (inPhantom (forall (x : Finite.sort T) (_ : is_true (leq n (order x))), @eq (Finite.sort T) (@iter (Finite.sort T) n finv x) (@iter (Finite.sort T) (subn (order x) n) f x))) *)
move=> x xS; rewrite -{2}[x]iter_order_in => // /subnKC {1}<-; move: (_ - n).
(* Goal: forall subn : nat, @eq (Finite.sort T) (@iter (Finite.sort T) n finv (@iter (Finite.sort T) (addn n subn) f x)) (@iter (Finite.sort T) subn f x) *)
move=> m; rewrite iter_add; elim: n => // n {2}<-.
(* Goal: @eq (Finite.sort T) (@iter (Finite.sort T) (Datatypes.S n) finv (@iter (Finite.sort T) (Datatypes.S n) f (@iter (Finite.sort T) m f x))) (@iter (Finite.sort T) n finv (@iter (Finite.sort T) n f (@iter (Finite.sort T) m f x))) *)
by rewrite iterSr /= finv_f_in // -iter_add iter_in.
Qed.
Lemma cycle_orbit_in : {in S, forall x, (fcycle f) (orbit x)}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Finite.sort T => is_true (@cycle (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (orbit x))) (inPhantom (forall x : Finite.sort T, is_true (@cycle (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (orbit x)))) *)
move=> x xS; rewrite /orbit -orderSpred (cycle_path x) /= last_traject.
(* Goal: is_true (andb (@eq_op (Finite.eqType T) (f (@iter (Finite.sort T) (Nat.pred (order x)) f x)) x) (@path (Finite.sort T) (@rel_of_simpl_rel (Finite.sort T) (@frel (Finite.eqType T) f)) x (@traject (Finite.sort T) f (f x) (Nat.pred (order x))))) *)
by rewrite -/(finv x) fpath_traject f_finv_in ?eqxx.
Qed.
Lemma fpath_finv_in p x : (x \in S) && (fpath finv x p) =
(last x p \in S) && (fpath f (last x p) (rev (belast x p))).
Lemma fpath_finv_f_in p : {in S, forall x,
fpath finv x p -> fpath f (last x p) (rev (belast x p))}.
Proof.
(* Goal: @prop_in1 (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S) (fun x : Equality.sort (Finite.eqType T) => forall _ : is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) finv)) x p), is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (@last (Equality.sort (Finite.eqType T)) x p) (@rev (Equality.sort (Finite.eqType T)) (@belast (Equality.sort (Finite.eqType T)) x p)))) (inPhantom (forall (x : Equality.sort (Finite.eqType T)) (_ : is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) finv)) x p)), is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (@last (Equality.sort (Finite.eqType T)) x p) (@rev (Equality.sort (Finite.eqType T)) (@belast (Equality.sort (Finite.eqType T)) x p))))) *)
by move=> x xS /(conj xS)/andP; rewrite fpath_finv_in => /andP[].
Qed.
Lemma fpath_f_finv_in p x : last x p \in S ->
fpath f (last x p) (rev (belast x p)) -> fpath finv x p.
Proof.
(* Goal: forall (_ : is_true (@in_mem (Finite.sort T) (@last (Finite.sort T) x p) (@mem (Finite.sort T) (predPredType (Finite.sort T)) S))) (_ : is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (@last (Finite.sort T) x p) (@rev (Finite.sort T) (@belast (Finite.sort T) x p)))), is_true (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) finv)) x p) *)
by move=> lS /(conj lS)/andP; rewrite -fpath_finv_in => /andP[].
Qed.
End orbit_in.
Hypothesis injf : injective f.
Lemma f_finv : cancel finv f. Proof. exact: (in1T (f_finv_in _ (in2W _))). Qed.
Proof.
(* Goal: @cancel (Finite.sort T) (Finite.sort T) finv f *)
exact: (in1T (f_finv_in _ (in2W _))).
Qed.
Lemma fin_inj_bij : bijective f.
Proof.
(* Goal: @bijective (Finite.sort T) (Finite.sort T) f *)
by exists finv; [apply: finv_f|apply: f_finv].
Qed.
Lemma finv_bij : bijective finv.
Proof.
(* Goal: @bijective (Finite.sort T) (Finite.sort T) finv *)
by exists f; [apply: f_finv|apply: finv_f].
Qed.
Lemma fconnect_sym x y : fconnect f x y = fconnect f y x.
Proof.
(* Goal: @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) y x) *)
exact: (in2T (fconnect_sym_in _ (in2W _))).
Qed.
Let symf := fconnect_sym.
Lemma iter_order x : iter (order x) f x = x.
Proof.
(* Goal: @eq (Finite.sort T) (@iter (Finite.sort T) (order x) f x) x *)
exact: (in1T (iter_order_in _ (in2W _))).
Qed.
Lemma iter_finv n x : n <= order x -> iter n finv x = iter (order x - n) f x.
Proof.
(* Goal: forall _ : is_true (leq n (order x)), @eq (Finite.sort T) (@iter (Finite.sort T) n finv x) (@iter (Finite.sort T) (subn (order x) n) f x) *)
exact: (in1T (@iter_finv_in _ _ (in2W _) _)).
Qed.
Lemma cycle_orbit x : fcycle f (orbit x).
Proof.
(* Goal: is_true (@cycle (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (orbit x)) *)
exact: (in1T (cycle_orbit_in _ (in2W _))).
Qed.
Lemma fpath_finv x p : fpath finv x p = fpath f (last x p) (rev (belast x p)).
Proof.
(* Goal: @eq bool (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) finv)) x p) (@path (Equality.sort (Finite.eqType T)) (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (@last (Equality.sort (Finite.eqType T)) x p) (@rev (Equality.sort (Finite.eqType T)) (@belast (Equality.sort (Finite.eqType T)) x p))) *)
exact: (@fpath_finv_in T _ (in2W _)).
Qed.
Lemma same_fconnect_finv : fconnect finv =2 fconnect f.
Proof.
(* Goal: @eqrel bool (Finite.sort T) (Finite.sort T) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) finv))) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) *)
move=> x y; rewrite (same_connect_rev symf); apply: {x y}eq_connect => x y /=.
(* Goal: @eq bool (@eq_op (Finite.eqType T) (finv x) y) (@eq_op (Finite.eqType T) (f y) x) *)
by rewrite (canF_eq finv_f) eq_sym.
Qed.
Lemma fcard_finv : fcard_mem finv =1 fcard_mem f.
Proof.
(* Goal: @eqfun nat (mem_pred (Finite.sort T)) (@n_comp_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) finv))) (@n_comp_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) *)
exact: eq_n_comp same_fconnect_finv.
Qed.
Definition order_set n : pred T := [pred x | order x == n].
Lemma fcard_order_set n (a : pred T) :
a \subset order_set n -> fclosed f a -> fcard f a * n = #|a|.
Proof.
(* Goal: forall (_ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (order_set n)))) (_ : @closed_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)), @eq nat (muln (@n_comp_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) n) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
move=> a_n cl_a; rewrite /n_comp_mem; set b := [predI froots f & a].
(* Goal: @eq nat (muln (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) b)) n) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
symmetry; transitivity #|preim (froot f) b|.
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) b)) n) *)
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) *)
apply: eq_card => x; rewrite !inE (roots_root fconnect_sym).
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) b)) n) *)
(* Goal: @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (andb true (@in_mem (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))) *)
by rewrite -(closed_connect cl_a (connect_root _ x)).
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) b)) n) *)
have{cl_a a_n} (x): b x -> froot f x = x /\ order x = n.
(* Goal: forall _ : forall (x : Finite.sort T) (_ : is_true (@pred_of_simpl (Finite.sort T) b x)), and (@eq (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x) x) (@eq nat (order x) n), @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) b)) n) *)
(* Goal: forall _ : is_true (@pred_of_simpl (Finite.sort T) b x), and (@eq (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x) x) (@eq nat (order x) n) *)
by case/andP=> /eqP-> /(subsetP a_n)/eqnP->.
(* Goal: forall _ : forall (x : Finite.sort T) (_ : is_true (@pred_of_simpl (Finite.sort T) b x)), and (@eq (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x) x) (@eq nat (order x) n), @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) b)) n) *)
elim: {a b}#|b| {1 3 4}b (eqxx #|b|) => [|m IHm] b def_m f_b.
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (S m) n) *)
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln O n) *)
by rewrite eq_card0 // => x; apply: (pred0P def_m).
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (S m) n) *)
have [x b_x | b0] := pickP b; last by rewrite (eq_card0 b0) in def_m.
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (S m) n) *)
have [r_x ox_n] := f_b x b_x; rewrite (cardD1 x) [x \in b]b_x eqSS in def_m.
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (muln (S m) n) *)
rewrite mulSn -{1}ox_n -(IHm _ def_m) => [|_ /andP[_ /f_b //]].
(* Goal: @eq nat (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (Finite.sort T) b)))) (addn (order x) (@card T (@mem (Finite.sort T) (simplPredType (Finite.sort T)) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@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)) (@pred_of_simpl (Finite.sort T) b)))) x)))))) *)
rewrite -(cardID (fconnect f x)); congr (_ + _); apply: eq_card => y.
(* Goal: @eq bool (@in_mem (Finite.sort T) y (@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)) (@pred_of_simpl (Finite.sort T) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (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)) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x)))))))) (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@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)) (@pred_of_simpl (Finite.sort T) b)))) x)))))) *)
(* 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) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (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)) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x)))))))) (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x))) *)
by apply: andb_idl => /= fxy; rewrite !inE -(rootP symf fxy) r_x.
(* Goal: @eq bool (@in_mem (Finite.sort T) y (@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)) (@pred_of_simpl (Finite.sort T) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@pred_of_simpl (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)) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x)))))))) (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@pred_of_simpl (Finite.sort T) (@preim (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@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)) (@pred_of_simpl (Finite.sort T) b)))) x)))))) *)
by congr (~~ _ && _); rewrite /= /in_mem /= symf -(root_connect symf) r_x.
Qed.
Lemma fclosed1 (a : pred T) : fclosed f a -> forall x, (x \in a) = (f x \in a).
Proof.
(* Goal: forall (_ : @closed_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (x : Finite.sort T), @eq bool (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@in_mem (Finite.sort T) (f x) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
by move=> cl_a x; apply: cl_a (eqxx _).
Qed.
Lemma same_fconnect1 x : fconnect f x =1 fconnect f (f x).
Proof.
(* Goal: @eqfun bool (Finite.sort T) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) (f x)) *)
by apply: same_connect1 => /=.
Qed.
Lemma same_fconnect1_r x y : fconnect f x y = fconnect f x (f y).
Proof.
(* Goal: @eq bool (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x y) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f)) x (f y)) *)
by apply: same_connect1r x => /=.
Qed.
End Orbit.
Prenex Implicits order orbit findex finv order_set.
Section FconnectId.
Variable T : finType.
Lemma fconnect_id (x : T) : fconnect id x =1 xpred1 x.
Proof.
(* Goal: @eqfun bool (Finite.sort T) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) (fun x : Equality.sort (Finite.eqType T) => x))) x) ((fun a1 x : Equality.sort (Finite.eqType T) => @eq_op (Finite.eqType T) x a1) x) *)
by move=> y; rewrite (@fconnect_cycle _ _ [:: x]) //= ?inE ?eqxx.
Qed.
Lemma order_id (x : T) : order id x = 1.
Proof.
(* Goal: @eq nat (@order T (fun x : Finite.sort T => x) x) (S O) *)
by rewrite /order (eq_card (fconnect_id x)) card1.
Qed.
Lemma orbit_id (x : T) : orbit id x = [:: x].
Proof.
(* Goal: @eq (list (Finite.sort T)) (@orbit T (fun x : Finite.sort T => x) x) (@cons (Finite.sort T) x (@nil (Finite.sort T))) *)
by rewrite /orbit order_id.
Qed.
Lemma froots_id (x : T) : froots id x.
Proof.
(* Goal: is_true (@roots T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) (fun x : Equality.sort (Finite.eqType T) => x))) x) *)
by rewrite /roots -fconnect_id connect_root.
Qed.
Lemma froot_id (x : T) : froot id x = x.
Proof.
(* Goal: @eq (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) (fun x : Equality.sort (Finite.eqType T) => x))) x) x *)
by apply/eqP; apply: froots_id.
Qed.
Lemma fcard_id (a : pred T) : fcard id a = #|a|.
Proof.
(* Goal: @eq nat (@n_comp_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) (fun x : Equality.sort (Finite.eqType T) => x))) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@card T (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) *)
by apply: eq_card => x; rewrite inE froots_id.
Qed.
End FconnectId.
Section FconnectEq.
Variables (T : finType) (f f' : T -> T).
Lemma finv_eq_can : cancel f f' -> finv f =1 f'.
Proof.
(* Goal: forall _ : @cancel (Finite.sort T) (Finite.sort T) f f', @eqfun (Finite.sort T) (Finite.sort T) (@finv T f) f' *)
move=> fK; have inj_f := can_inj fK.
(* Goal: @eqfun (Finite.sort T) (Finite.sort T) (@finv T f) f' *)
by apply: bij_can_eq fK; [apply: fin_inj_bij | apply: finv_f].
Qed.
Hypothesis eq_f : f =1 f'.
Let eq_rf := eq_frel eq_f.
Lemma eq_fconnect : fconnect f =2 fconnect f'.
Proof.
(* Goal: @eqrel bool (Finite.sort T) (Finite.sort T) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@connect T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f'))) *)
exact: eq_connect eq_rf.
Qed.
Lemma eq_fcard : fcard_mem f =1 fcard_mem f'.
Proof.
(* Goal: @eqfun nat (mem_pred (Finite.sort T)) (@n_comp_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@n_comp_mem T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f'))) *)
exact: eq_n_comp eq_fconnect.
Qed.
Lemma eq_finv : finv f =1 finv f'.
Proof.
(* Goal: @eqfun (Finite.sort T) (Finite.sort T) (@finv T f) (@finv T f') *)
by move=> x; rewrite /finv /order (eq_card (eq_fconnect x)) (eq_iter eq_f).
Qed.
Lemma eq_froot : froot f =1 froot f'.
Proof.
(* Goal: @eqfun (Finite.sort T) (Finite.sort T) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@root T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f'))) *)
exact: eq_root eq_rf.
Qed.
Lemma eq_froots : froots f =1 froots f'.
Proof.
(* Goal: @eqfun bool (Finite.sort T) (@roots T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f))) (@roots T (@rel_of_simpl_rel (Equality.sort (Finite.eqType T)) (@frel (Finite.eqType T) f'))) *)
exact: eq_roots eq_rf.
Qed.
End FconnectEq.
Section FinvEq.
Variables (T : finType) (f : T -> T).
Hypothesis injf : injective f.
Lemma finv_inv : finv (finv f) =1 f.
Proof.
(* Goal: @eqfun (Finite.sort T) (Finite.sort T) (@finv T (@finv T f)) f *)
exact: (finv_eq_can (f_finv injf)).
Qed.
Lemma order_finv : order (finv f) =1 order f.
Proof.
(* Goal: @eqfun nat (Finite.sort T) (@order T (@finv T f)) (@order T f) *)
by move=> x; apply: eq_card (same_fconnect_finv injf x).
Qed.
Lemma order_set_finv n : order_set (finv f) n =i order_set f n.
Proof.
(* Goal: @eq_mem (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@order_set T (@finv T f) n)) (@mem (Finite.sort T) (predPredType (Finite.sort T)) (@order_set T f n)) *)
by move=> x; rewrite !inE order_finv.
Qed.
End FinvEq.
Section RelAdjunction.
Variables (T T' : finType) (h : T' -> T) (e : rel T) (e' : rel T').
Hypotheses (sym_e : connect_sym e) (sym_e' : connect_sym e').
Record rel_adjunction_mem m_a := RelAdjunction {
rel_unit x : in_mem x m_a -> {x' : T' | connect e x (h x')};
rel_functor x' y' :
in_mem (h x') m_a -> connect e' x' y' = connect e (h x') (h y')
}.
Variable a : pred T.
Hypothesis cl_a : closed e a.
Local Notation rel_adjunction := (rel_adjunction_mem (mem a)).
Lemma intro_adjunction (h' : forall x, x \in a -> T') :
(forall x a_x,
[/\ connect e x (h (h' x a_x))
& forall y a_y, e x y -> connect e' (h' x a_x) (h' y a_y)]) ->
(forall x' a_x,
[/\ connect e' x' (h' (h x') a_x)
& forall y', e' x' y' -> connect e (h x') (h y')]) ->
rel_adjunction.
Proof.
(* Goal: forall (_ : forall (x : Finite.sort T) (a_x : is_true (@in_mem (Finite.sort T) x (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))), and (is_true (@connect T e x (h (h' x a_x)))) (forall (y : Finite.sort T) (a_y : is_true (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))) (_ : is_true (e x y)), is_true (@connect T' e' (h' x a_x) (h' y a_y)))) (_ : forall (x' : Finite.sort T') (a_x : is_true (@in_mem (Finite.sort T) (h x') (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))), and (is_true (@connect T' e' x' (h' (h x') a_x))) (forall (y' : Finite.sort T') (_ : is_true (e' x' y')), is_true (@connect T e (h x') (h y')))), rel_adjunction_mem (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) *)
move=> Aee' Ae'e; split=> [y a_y | x' z' a_x].
(* Goal: @eq bool (@connect T' e' x' z') (@connect T e (h x') (h z')) *)
(* Goal: @sig (Finite.sort T') (fun x' : Finite.sort T' => is_true (@connect T e y (h x'))) *)
by exists (h' y a_y); case/Aee': (a_y).
(* Goal: @eq bool (@connect T' e' x' z') (@connect T e (h x') (h z')) *)
apply/idP/idP=> [/connectP[p e'p ->{z'}] | /connectP[p e_p p_z']].
(* Goal: is_true (@connect T' e' x' z') *)
(* Goal: is_true (@connect T e (h x') (h (@last (Finite.sort T') x' p))) *)
elim: p x' a_x e'p => //= y' p IHp x' a_x.
(* Goal: is_true (@connect T' e' x' z') *)
(* Goal: forall _ : is_true (andb (e' x' y') (@path (Finite.sort T') e' y' p)), is_true (@connect T e (h x') (h (@last (Finite.sort T') y' p))) *)
case: (Ae'e x' a_x) => _ Ae'x /andP[/Ae'x e_xy /IHp e_yz] {Ae'x}.
(* Goal: is_true (@connect T' e' x' z') *)
(* Goal: is_true (@connect T e (h x') (h (@last (Finite.sort T') y' p))) *)
by apply: connect_trans (e_yz _); rewrite // -(closed_connect cl_a e_xy).
(* Goal: is_true (@connect T' e' x' z') *)
case: (Ae'e x' a_x) => /connect_trans-> //.
(* Goal: is_true (@connect T' e' (h' (h x') a_x) z') *)
elim: p {x'}(h x') p_z' a_x e_p => /= [|y p IHp] x p_z' a_x.
(* Goal: forall _ : is_true (andb (e x y) (@path (Finite.sort T) e y p)), is_true (@connect T' e' (h' x a_x) z') *)
(* Goal: forall _ : is_true true, is_true (@connect T' e' (h' x a_x) z') *)
by rewrite -p_z' in a_x *; case: (Ae'e _ a_x); rewrite sym_e'.
(* Goal: forall _ : is_true (andb (e x y) (@path (Finite.sort T) e y p)), is_true (@connect T' e' (h' x a_x) z') *)
case/andP=> e_xy /(IHp _ p_z') e'yz; have a_y: y \in a by rewrite -(cl_a e_xy).
(* Goal: is_true (@connect T' e' (h' x a_x) z') *)
by apply: connect_trans (e'yz a_y); case: (Aee' _ a_x) => _ ->.
Qed.
Lemma strict_adjunction :
injective h -> a \subset codom h -> rel_base h e e' [predC a] ->
rel_adjunction.
Proof.
(* Goal: forall (_ : @injective (Finite.sort T) (Finite.sort T') h) (_ : is_true (@subset T (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) (@mem (Equality.sort (Finite.eqType T)) (seq_predType (Finite.eqType T)) (@codom T' (Finite.sort T) h)))) (_ : @rel_base (Finite.sort T) (Finite.sort T') h e e' (@pred_of_simpl (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)))))), rel_adjunction_mem (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) *)
move=> /= injh h_a a_ee'; pose h' x Hx := iinv (subsetP h_a x Hx).
(* Goal: rel_adjunction_mem (@mem (Finite.sort T) (predPredType (Finite.sort T)) a) *)
apply: (@intro_adjunction h') => [x a_x | x' a_x].
(* Goal: and (is_true (@connect T' e' x' (h' (h x') a_x))) (forall (y' : Finite.sort T') (_ : is_true (e' x' y')), is_true (@connect T e (h x') (h y'))) *)
(* Goal: and (is_true (@connect T e x (h (h' x a_x)))) (forall (y : Finite.sort T) (a_y : is_true (@in_mem (Finite.sort T) y (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))) (_ : is_true (e x y)), is_true (@connect T' e' (h' x a_x) (h' y a_y))) *)
rewrite f_iinv connect0; split=> // y a_y e_xy.
(* Goal: and (is_true (@connect T' e' x' (h' (h x') a_x))) (forall (y' : Finite.sort T') (_ : is_true (e' x' y')), is_true (@connect T e (h x') (h y'))) *)
(* Goal: is_true (@connect T' e' (h' x a_x) (h' y a_y)) *)
by rewrite connect1 // -a_ee' !f_iinv ?negbK.
(* Goal: and (is_true (@connect T' e' x' (h' (h x') a_x))) (forall (y' : Finite.sort T') (_ : is_true (e' x' y')), is_true (@connect T e (h x') (h y'))) *)
rewrite [h' _ _]iinv_f //; split=> // y' e'xy.
(* Goal: is_true (@connect T e (h x') (h y')) *)
by rewrite connect1 // a_ee' ?negbK.
Qed.
Let ccl_a := closed_connect cl_a.
Lemma adjunction_closed : rel_adjunction -> closed e' [preim h of a].
Proof.
(* Goal: forall _ : rel_adjunction_mem (@mem (Finite.sort T) (predPredType (Finite.sort T)) a), @closed_mem T' e' (@mem (Finite.sort T') (simplPredType (Finite.sort T')) (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))))) *)
case=> _ Ae'e; apply: intro_closed => // x' y' /connect1 e'xy a_x.
(* Goal: is_true (@in_mem (Finite.sort T') y' (@mem (Finite.sort T') (predPredType (Finite.sort T')) (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))))))) *)
by rewrite Ae'e // in e'xy; rewrite !inE -(ccl_a e'xy).
Qed.
Lemma adjunction_n_comp :
rel_adjunction -> n_comp e a = n_comp e' [preim h of a].
Proof.
(* Goal: forall _ : rel_adjunction_mem (@mem (Finite.sort T) (predPredType (Finite.sort T)) a), @eq nat (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@n_comp_mem T' e' (@mem (Finite.sort T') (simplPredType (Finite.sort T')) (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))) *)
case=> Aee' Ae'e.
(* Goal: @eq nat (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@n_comp_mem T' e' (@mem (Finite.sort T') (simplPredType (Finite.sort T')) (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))) *)
have inj_h: {in predI (roots e') [preim h of a] &, injective (root e \o h)}.
(* Goal: @eq nat (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@n_comp_mem T' e' (@mem (Finite.sort T') (simplPredType (Finite.sort T')) (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))) *)
(* Goal: @prop_in2 (Finite.sort T') (@mem (Finite.sort T') (simplPredType (Finite.sort T')) (@predI (Finite.sort T') (@roots T' e') (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a))))))) (fun x1 x2 : Finite.sort T' => forall _ : @eq (Finite.sort T) (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x1) (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x2), @eq (Finite.sort T') x1 x2) (inPhantom (@injective (Finite.sort T) (Finite.sort T') (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h))) *)
move=> x' y' /andP[/eqP r_x' /= a_x'] /andP[/eqP r_y' _] /(rootP sym_e).
(* Goal: @eq nat (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@n_comp_mem T' e' (@mem (Finite.sort T') (simplPredType (Finite.sort T')) (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))) *)
(* Goal: forall _ : is_true (@connect T e (h x') (h y')), @eq (Finite.sort T') x' y' *)
by rewrite -Ae'e // => /(rootP sym_e'); rewrite r_x' r_y'.
(* Goal: @eq nat (@n_comp_mem T e (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@n_comp_mem T' e' (@mem (Finite.sort T') (simplPredType (Finite.sort T')) (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))) *)
rewrite /n_comp_mem -(card_in_image inj_h); apply: eq_card => 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) (@roots T e) (@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)) (@pred_of_eq_seq (Finite.eqType T) (@image_mem T' (Finite.sort T) (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h) (@mem (Finite.sort T') (predPredType (Finite.sort T')) (@pred_of_simpl (Finite.sort T') (@predI (Finite.sort T') (@roots T' e') (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))))))))) *)
apply/andP/imageP=> [[/eqP rx a_x] | [x' /andP[/eqP r_x' a_x'] ->]]; last first.
(* Goal: @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')) (@pred_of_simpl (Finite.sort T') (@predI (Finite.sort T') (@roots T' e') (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))))))) (fun x0 : Finite.sort T' => @eq (Equality.sort (Finite.eqType T)) x (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x0)) *)
(* Goal: and (is_true (@roots T e (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x'))) (is_true (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)) (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x'))) *)
by rewrite /= -(ccl_a (connect_root _ _)) roots_root.
(* Goal: @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')) (@pred_of_simpl (Finite.sort T') (@predI (Finite.sort T') (@roots T' e') (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))))))) (fun x0 : Finite.sort T' => @eq (Equality.sort (Finite.eqType T)) x (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x0)) *)
have [y' e_xy]:= Aee' x a_x; pose x' := root e' y'.
(* Goal: @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')) (@pred_of_simpl (Finite.sort T') (@predI (Finite.sort T') (@roots T' e') (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))))))) (fun x0 : Finite.sort T' => @eq (Equality.sort (Finite.eqType T)) x (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x0)) *)
have ay': h y' \in a by rewrite -(ccl_a e_xy).
(* Goal: @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')) (@pred_of_simpl (Finite.sort T') (@predI (Finite.sort T') (@roots T' e') (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))))))) (fun x0 : Finite.sort T' => @eq (Equality.sort (Finite.eqType T)) x (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x0)) *)
have e_yx: connect e (h y') (h x') by rewrite -Ae'e ?connect_root.
(* Goal: @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')) (@pred_of_simpl (Finite.sort T') (@predI (Finite.sort T') (@roots T' e') (@pred_of_simpl (Finite.sort T') (@preim (Finite.sort T') (Finite.sort T) h (@pred_of_simpl (Finite.sort T) (@pred_of_mem_pred (Finite.sort T) (@mem (Finite.sort T) (predPredType (Finite.sort T)) a)))))))))) (fun x0 : Finite.sort T' => @eq (Equality.sort (Finite.eqType T)) x (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x0)) *)
exists x'; first by rewrite inE /= -(ccl_a e_yx) ?roots_root.
(* Goal: @eq (Equality.sort (Finite.eqType T)) x (@funcomp (Finite.sort T) (Finite.sort T) (Finite.sort T') tt (@root T e) h x') *)
by rewrite /= -(rootP sym_e e_yx) -(rootP sym_e e_xy).
Qed.
End RelAdjunction.
Notation rel_adjunction h e e' a := (rel_adjunction_mem h e e' (mem a)).
Notation "@ 'rel_adjunction' T T' h e e' a" :=
(@rel_adjunction_mem T T' h e e' (mem a))
(at level 10, T, T', h, e, e', a at level 8, only parsing) : type_scope.
Notation fun_adjunction h f f' a := (rel_adjunction h (frel f) (frel f') a).
Notation "@ 'fun_adjunction' T T' h f f' a" :=
(@rel_adjunction T T' h (frel f) (frel f') a)
(at level 10, T, T', h, f, f', a at level 8, only parsing) : type_scope.
Arguments intro_adjunction [T T' h e e'] _ [a].
Arguments adjunction_n_comp [T T'] h [e e'] _ _ [a].
Unset Implicit Arguments.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_betweennotequal.
Section Euclid.
Context `{Ax1:euclidean_neutral}.
Lemma lemma_lessthannotequal :
forall A B C D,
Lt A B C D ->
neq A B /\ neq C D.
Proof.
(* Goal: forall (A B C D : @Point Ax1) (_ : @Lt Ax1 A B C D), and (@neq Ax1 A B) (@neq Ax1 C D) *)
intros.
(* Goal: and (@neq Ax1 A B) (@neq Ax1 C D) *)
let Tf:=fresh in assert (Tf:exists E, (BetS C E D /\ Cong C E A B)) by (conclude_def Lt );destruct Tf as [E];spliter.
(* Goal: and (@neq Ax1 A B) (@neq Ax1 C D) *)
assert (neq C E) by (forward_using lemma_betweennotequal).
(* Goal: and (@neq Ax1 A B) (@neq Ax1 C D) *)
assert (neq A B) by (conclude axiom_nocollapse).
(* Goal: and (@neq Ax1 A B) (@neq Ax1 C D) *)
assert (neq C D) by (forward_using lemma_betweennotequal).
(* Goal: and (@neq Ax1 A B) (@neq Ax1 C D) *)
close.
Qed.
End Euclid.
|
Require Import ZArith.
Require Import ZArithRing.
Require Import Zdiv.
Require Import Omega.
Require Import divide.
Inductive gcd (a b d : Z) : Prop :=
gcd_intro :
(d | a)%Z ->
(d | b)%Z ->
(forall x : Z, (x | a)%Z -> (x | b)%Z -> (x | d)%Z) -> gcd a b d.
Lemma gcd_sym : forall a b d : Z, gcd a b d -> gcd b a d.
Proof.
(* Goal: forall (a b d : Z) (_ : gcd a b d), gcd b a d *)
simple induction 1; constructor; intuition.
Qed.
Lemma gcd_0 : forall a : Z, gcd a 0 a.
Proof.
(* Goal: forall a : Z, gcd a Z0 a *)
constructor; auto.
Qed.
Lemma gcd_minus : forall a b d : Z, gcd a (- b) d -> gcd b a d.
Proof.
(* Goal: forall (a b d : Z) (_ : gcd a (Z.opp b) d), gcd b a d *)
simple induction 1; constructor; intuition.
Qed.
Lemma gcd_opp : forall a b d : Z, gcd a b d -> gcd b a (- d).
Proof.
(* Goal: forall (a b d : Z) (_ : gcd a b d), gcd b a (Z.opp d) *)
simple induction 1; constructor; intuition.
Qed.
Hint Resolve gcd_sym gcd_0 gcd_minus gcd_opp.
Lemma gcd_for_euclid : forall a b d q : Z, gcd b (a - q * b) d -> gcd a b d.
Proof.
(* Goal: forall (a b d q : Z) (_ : gcd b (Z.sub a (Z.mul q b)) d), gcd a b d *)
simple induction 1; constructor; intuition.
(* Goal: divide d a *)
replace a with (a - q * b + q * b)%Z.
(* Goal: @eq Z (Z.add (Z.sub a (Z.mul q b)) (Z.mul q b)) a *)
(* Goal: divide d (Z.add (Z.sub a (Z.mul q b)) (Z.mul q b)) *)
auto.
(* Goal: @eq Z (Z.add (Z.sub a (Z.mul q b)) (Z.mul q b)) a *)
ring.
Qed.
Section extended_euclid_algorithm.
Variable a b : Z.
Inductive Euclid : Set :=
Euclid_intro :
forall u v d : Z, (u * a + v * b)%Z = d -> gcd a b d -> Euclid.
Lemma euclid_rec :
forall v3 : Z,
(0 <= v3)%Z ->
forall u1 u2 u3 v1 v2 : Z,
(u1 * a + u2 * b)%Z = u3 ->
(v1 * a + v2 * b)%Z = v3 ->
(forall d : Z, gcd u3 v3 d -> gcd a b d) -> Euclid.
Proof.
(* Goal: forall (v3 : Z) (_ : Z.le Z0 v3) (u1 u2 u3 v1 v2 : Z) (_ : @eq Z (Z.add (Z.mul u1 a) (Z.mul u2 b)) u3) (_ : @eq Z (Z.add (Z.mul v1 a) (Z.mul v2 b)) v3) (_ : forall (d : Z) (_ : gcd u3 v3 d), gcd a b d), Euclid *)
intros v3 Hv3; generalize Hv3; pattern v3 in |- *.
(* Goal: (fun z : Z => forall (_ : Z.le Z0 z) (u1 u2 u3 v1 v2 : Z) (_ : @eq Z (Z.add (Z.mul u1 a) (Z.mul u2 b)) u3) (_ : @eq Z (Z.add (Z.mul v1 a) (Z.mul v2 b)) z) (_ : forall (d : Z) (_ : gcd u3 z d), gcd a b d), Euclid) v3 *)
apply Z_lt_rec.
(* Goal: Z.le Z0 v3 *)
(* Goal: forall (x : Z) (_ : forall (y : Z) (_ : and (Z.le Z0 y) (Z.lt y x)) (_ : Z.le Z0 y) (u1 u2 u3 v1 v2 : Z) (_ : @eq Z (Z.add (Z.mul u1 a) (Z.mul u2 b)) u3) (_ : @eq Z (Z.add (Z.mul v1 a) (Z.mul v2 b)) y) (_ : forall (d : Z) (_ : gcd u3 y d), gcd a b d), Euclid) (_ : Z.le Z0 x) (u1 u2 u3 v1 v2 : Z) (_ : @eq Z (Z.add (Z.mul u1 a) (Z.mul u2 b)) u3) (_ : @eq Z (Z.add (Z.mul v1 a) (Z.mul v2 b)) x) (_ : forall (d : Z) (_ : gcd u3 x d), gcd a b d), Euclid *)
clear v3 Hv3; intros.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
elim (Z_zerop x); intro.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: Euclid *)
apply Euclid_intro with (u := u1) (v := u2) (d := u3).
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: gcd a b u3 *)
(* Goal: @eq Z (Z.add (Z.mul u1 a) (Z.mul u2 b)) u3 *)
assumption.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: gcd a b u3 *)
apply H2.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: gcd u3 x u3 *)
rewrite a0; auto.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
set (q := (u3 / x)%Z) in *.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
assert (Hq : (0 <= u3 - q * x < x)%Z).
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: and (Z.le Z0 (Z.sub u3 (Z.mul q x))) (Z.lt (Z.sub u3 (Z.mul q x)) x) *)
replace (u3 - q * x)%Z with (u3 mod x)%Z.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: @eq Z (Z.modulo u3 x) (Z.sub u3 (Z.mul q x)) *)
(* Goal: and (Z.le Z0 (Z.modulo u3 x)) (Z.lt (Z.modulo u3 x) x) *)
apply Z_mod_lt; omega.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: @eq Z (Z.modulo u3 x) (Z.sub u3 (Z.mul q x)) *)
assert (xpos : (x > 0)%Z).
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: @eq Z (Z.modulo u3 x) (Z.sub u3 (Z.mul q x)) *)
(* Goal: Z.gt x Z0 *)
omega.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: @eq Z (Z.modulo u3 x) (Z.sub u3 (Z.mul q x)) *)
generalize (Z_div_mod_eq u3 x xpos).
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: forall _ : @eq Z u3 (Z.add (Z.mul x (Z.div u3 x)) (Z.modulo u3 x)), @eq Z (Z.modulo u3 x) (Z.sub u3 (Z.mul q x)) *)
unfold q in |- *.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
(* Goal: forall _ : @eq Z u3 (Z.add (Z.mul x (Z.div u3 x)) (Z.modulo u3 x)), @eq Z (Z.modulo u3 x) (Z.sub u3 (Z.mul (Z.div u3 x) x)) *)
intro eq; pattern u3 at 2 in |- *; rewrite eq; ring.
(* Goal: Z.le Z0 v3 *)
(* Goal: Euclid *)
apply (H (u3 - q * x)%Z Hq (proj1 Hq) v1 v2 x (u1 - q * v1)%Z (u2 - q * v2)%Z).
(* Goal: Z.le Z0 v3 *)
(* Goal: forall (d : Z) (_ : gcd x (Z.sub u3 (Z.mul q x)) d), gcd a b d *)
(* Goal: @eq Z (Z.add (Z.mul (Z.sub u1 (Z.mul q v1)) a) (Z.mul (Z.sub u2 (Z.mul q v2)) b)) (Z.sub u3 (Z.mul q x)) *)
(* Goal: @eq Z (Z.add (Z.mul v1 a) (Z.mul v2 b)) x *)
tauto.
(* Goal: Z.le Z0 v3 *)
(* Goal: forall (d : Z) (_ : gcd x (Z.sub u3 (Z.mul q x)) d), gcd a b d *)
(* Goal: @eq Z (Z.add (Z.mul (Z.sub u1 (Z.mul q v1)) a) (Z.mul (Z.sub u2 (Z.mul q v2)) b)) (Z.sub u3 (Z.mul q x)) *)
replace ((u1 - q * v1) * a + (u2 - q * v2) * b)%Z with (u1 * a + u2 * b - q * (v1 * a + v2 * b))%Z.
(* Goal: Z.le Z0 v3 *)
(* Goal: forall (d : Z) (_ : gcd x (Z.sub u3 (Z.mul q x)) d), gcd a b d *)
(* Goal: @eq Z (Z.sub (Z.add (Z.mul u1 a) (Z.mul u2 b)) (Z.mul q (Z.add (Z.mul v1 a) (Z.mul v2 b)))) (Z.add (Z.mul (Z.sub u1 (Z.mul q v1)) a) (Z.mul (Z.sub u2 (Z.mul q v2)) b)) *)
(* Goal: @eq Z (Z.sub (Z.add (Z.mul u1 a) (Z.mul u2 b)) (Z.mul q (Z.add (Z.mul v1 a) (Z.mul v2 b)))) (Z.sub u3 (Z.mul q x)) *)
rewrite H0; rewrite H1; trivial.
(* Goal: Z.le Z0 v3 *)
(* Goal: forall (d : Z) (_ : gcd x (Z.sub u3 (Z.mul q x)) d), gcd a b d *)
(* Goal: @eq Z (Z.sub (Z.add (Z.mul u1 a) (Z.mul u2 b)) (Z.mul q (Z.add (Z.mul v1 a) (Z.mul v2 b)))) (Z.add (Z.mul (Z.sub u1 (Z.mul q v1)) a) (Z.mul (Z.sub u2 (Z.mul q v2)) b)) *)
ring.
(* Goal: Z.le Z0 v3 *)
(* Goal: forall (d : Z) (_ : gcd x (Z.sub u3 (Z.mul q x)) d), gcd a b d *)
intros; apply H2.
(* Goal: Z.le Z0 v3 *)
(* Goal: gcd u3 x d *)
apply gcd_for_euclid with q; assumption.
(* Goal: Z.le Z0 v3 *)
assumption.
Qed.
Lemma euclid : Euclid.
Proof.
(* Goal: Euclid *)
case (Z_le_gt_dec 0 b); intro.
(* Goal: Euclid *)
(* Goal: Euclid *)
intros; apply euclid_rec with (u1 := 1%Z) (u2 := 0%Z) (u3 := a) (v1 := 0%Z) (v2 := 1%Z) (v3 := b); auto; ring.
(* Goal: Euclid *)
intros; apply euclid_rec with (u1 := 1%Z) (u2 := 0%Z) (u3 := a) (v1 := 0%Z) (v2 := (-1)%Z) (v3 := (- b)%Z); auto; try ring.
(* Goal: Z.le Z0 (Z.opp b) *)
omega.
Qed.
End extended_euclid_algorithm.
Theorem gcd_uniqueness_apart_sign :
forall a b d d' : Z, gcd a b d -> gcd a b d' -> d = d' \/ d = (- d')%Z.
Proof.
(* Goal: forall (a b d d' : Z) (_ : gcd a b d) (_ : gcd a b d'), or (@eq Z d d') (@eq Z d (Z.opp d')) *)
simple induction 1.
(* Goal: forall (_ : divide d a) (_ : divide d b) (_ : forall (x : Z) (_ : divide x a) (_ : divide x b), divide x d) (_ : gcd a b d'), or (@eq Z d d') (@eq Z d (Z.opp d')) *)
intros H1 H2 H3; simple induction 1; intros.
(* Goal: or (@eq Z d d') (@eq Z d (Z.opp d')) *)
generalize (H3 d' H4 H5); intro Hd'd.
(* Goal: or (@eq Z d d') (@eq Z d (Z.opp d')) *)
generalize (H6 d H1 H2); intro Hdd'.
(* Goal: or (@eq Z d d') (@eq Z d (Z.opp d')) *)
exact (divide_antisym d d' Hdd' Hd'd).
Qed.
Inductive Bezout (a b d : Z) : Prop :=
Bezout_intro : forall u v : Z, (u * a + v * b)%Z = d -> Bezout a b d.
Lemma gcd_bezout : forall a b d : Z, gcd a b d -> Bezout a b d.
Proof.
(* Goal: forall (a b d : Z) (_ : gcd a b d), Bezout a b d *)
intros a b d Hgcd.
(* Goal: Bezout a b d *)
elim (euclid a b); intros.
(* Goal: Bezout a b d *)
generalize (gcd_uniqueness_apart_sign a b d d0 Hgcd g).
(* Goal: forall _ : or (@eq Z d d0) (@eq Z d (Z.opp d0)), Bezout a b d *)
intro H; elim H; clear H; intros.
(* Goal: Bezout a b d *)
(* Goal: Bezout a b d *)
apply Bezout_intro with u v.
(* Goal: Bezout a b d *)
(* Goal: @eq Z (Z.add (Z.mul u a) (Z.mul v b)) d *)
rewrite H; assumption.
(* Goal: Bezout a b d *)
apply Bezout_intro with (- u)%Z (- v)%Z.
(* Goal: @eq Z (Z.add (Z.mul (Z.opp u) a) (Z.mul (Z.opp v) b)) d *)
rewrite H; rewrite <- e; ring.
Qed.
Lemma gcd_mult : forall a b c d : Z, gcd a b d -> gcd (c * a) (c * b) (c * d).
Proof.
(* Goal: forall (a b c d : Z) (_ : gcd a b d), gcd (Z.mul c a) (Z.mul c b) (Z.mul c d) *)
simple induction 1; constructor; intuition.
(* Goal: divide x (Z.mul c d) *)
elim (gcd_bezout a b d H); intros.
(* Goal: divide x (Z.mul c d) *)
elim H3; intros.
(* Goal: divide x (Z.mul c d) *)
elim H4; intros.
(* Goal: divide x (Z.mul c d) *)
apply divide_intro with (u * q + v * q0)%Z.
(* Goal: @eq Z (Z.mul c d) (Z.mul (Z.add (Z.mul u q) (Z.mul v q0)) x) *)
rewrite <- H5.
(* Goal: @eq Z (Z.mul c (Z.add (Z.mul u a) (Z.mul v b))) (Z.mul (Z.add (Z.mul u q) (Z.mul v q0)) x) *)
replace (c * (u * a + v * b))%Z with (u * (c * a) + v * (c * b))%Z.
(* Goal: @eq Z (Z.add (Z.mul u (Z.mul c a)) (Z.mul v (Z.mul c b))) (Z.mul c (Z.add (Z.mul u a) (Z.mul v b))) *)
(* Goal: @eq Z (Z.add (Z.mul u (Z.mul c a)) (Z.mul v (Z.mul c b))) (Z.mul (Z.add (Z.mul u q) (Z.mul v q0)) x) *)
rewrite H6; rewrite H7; ring.
(* Goal: @eq Z (Z.add (Z.mul u (Z.mul c a)) (Z.mul v (Z.mul c b))) (Z.mul c (Z.add (Z.mul u a) (Z.mul v b))) *)
ring.
Qed.
|
Require Import sur_les_relations.
Require Import TS.
Require Import egaliteTS.
Require Import sigma_lift.
Require Import betapar.
Require Import SLstar_bpar_SLstar.
Require Import determinePC_SL.
Definition e_diag1 (b : wsort) (x y : TS b) :=
forall z : TS b,
e_beta_par _ x z ->
exists u : TS b, e_slstar_bp_slstar _ y u /\ e_relSLstar _ z u.
Notation diag1 := (e_diag1 _) (only parsing).
Goal forall x y : terms, reg_app x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a b0 s z H0.
pattern z in |- *; apply case_benv with (app a b0) s.
2: assumption.
intros x' s' H1 H2; pattern x' in |- *; apply case_bapp with a b0.
3: assumption.
intros a' b0' H3 H4; exists (app (env a' s') (env b0' s')); auto 6.
intros a1 a1' b0' H3 H4 H5; rewrite H3.
exists (env a1' (cons (env b0' s') s')); split.
red in |- *; apply comp_2rel with (app (lambda (env a1 (lift s))) (env b0 s)).
auto 6.
apply comp_2rel with (env (env a1' (lift s')) (cons (env b0' s') id)).
auto.
red in |- *;
apply star_trans1 with (env a1' (comp (lift s') (cons (env b0' s') id))).
auto.
apply star_trans1 with (env a1' (cons (env b0' s') (comp s' id))); auto 6.
red in |- *; apply star_trans1 with (env a1' (comp (cons b0' id) s')).
auto.
apply star_trans1 with (env a1' (cons (env b0' s') (comp id s'))); auto 6.
Save commut_app.
Hint Resolve commut_app.
Goal forall x y : terms, reg_lambda x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a s z H0.
pattern z in |- *; apply case_benv with (lambda a) s.
2: assumption.
intros x' s' H1 H2; pattern x' in |- *; apply case_blambda with a.
2: assumption.
intros a' H3; exists (lambda (env a' (lift s'))); auto 6.
Save commut_lambda.
Hint Resolve commut_lambda.
Goal forall x y : terms, reg_clos x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a s t z H0.
pattern z in |- *; apply case_benv with (env a s) t.
2: assumption.
intros x' t' H1 H2; pattern x' in |- *; apply case_benv with a s.
2: assumption.
intros a' s' H3 H4; exists (env a' (comp s' t')); auto 6.
Save commut_clos.
Hint Resolve commut_clos.
Goal forall x y : terms, reg_varshift1 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros n z H0.
pattern z in |- *; apply case_benv with (var n) shift.
2: assumption.
intros x' s' H1 H2; pattern x' in |- *; apply case_bvar with n.
2: assumption.
pattern s' in |- *; apply case_bshift.
2: assumption.
exists (var (S n)); auto 6.
Save commut_varshift1.
Hint Resolve commut_varshift1.
Goal forall x y : terms, reg_varshift2 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros n s z H0.
pattern z in |- *; apply case_benv with (var n) (comp shift s).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with n.
2: assumption.
pattern y' in |- *; apply case_bcomp with shift s.
2: assumption.
intros t' s' H3 H4; pattern t' in |- *; apply case_bshift.
2: assumption.
exists (env (var (S n)) s'); auto 6.
Save commut_varshift2.
Hint Resolve commut_varshift2.
Goal forall x y : terms, reg_fvarcons x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a s z H0.
pattern z in |- *; apply case_benv with (var 0) (cons a s).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with 0.
2: assumption.
pattern y' in |- *; apply case_bcons with a s.
2: assumption.
intros a' s' H3 H4; exists a'; auto 6.
Save commut_fvarcons.
Hint Resolve commut_fvarcons.
Goal forall x y : terms, reg_fvarlift1 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s z H0.
pattern z in |- *; apply case_benv with (var 0) (lift s).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with 0.
2: assumption.
pattern y' in |- *; apply case_blift with s.
2: assumption.
intros s' H3; exists (var 0); auto 6.
Save commut_fvarlift1.
Hint Resolve commut_fvarlift1.
Goal forall x y : terms, reg_fvarlift2 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s t z H0.
pattern z in |- *; apply case_benv with (var 0) (comp (lift s) t).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with 0.
2: assumption.
pattern y' in |- *; apply case_bcomp with (lift s) t.
2: assumption.
intros z' t' H3 H4; pattern z' in |- *; apply case_blift with s.
2: assumption.
intros s' H5; exists (env (var 0) t'); auto 6.
Save commut_fvarlift2.
Hint Resolve commut_fvarlift2.
Goal forall x y : terms, reg_rvarcons x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros n a s z H0.
pattern z in |- *; apply case_benv with (var (S n)) (cons a s).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with (S n).
2: assumption.
pattern y' in |- *; apply case_bcons with a s.
2: assumption.
intros a' s' H3 H4; exists (env (var n) s'); auto 6.
Save commut_rvarcons.
Hint Resolve commut_rvarcons.
Goal forall x y : terms, reg_rvarlift1 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros n s z H0.
pattern z in |- *; apply case_benv with (var (S n)) (lift s).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with (S n).
2: assumption.
pattern y' in |- *; apply case_blift with s.
2: assumption.
intros s' H3; exists (env (var n) (comp s' shift)); auto 6.
Save commut_rvarlift1.
Hint Resolve commut_rvarlift1.
Goal forall x y : terms, reg_rvarlift2 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros n s t z H0.
pattern z in |- *; apply case_benv with (var (S n)) (comp (lift s) t).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bvar with (S n).
2: assumption.
pattern y' in |- *; apply case_bcomp with (lift s) t.
2: assumption.
intros z' t' H3 H4; pattern z' in |- *; apply case_blift with s.
2: assumption.
intros s' H5; exists (env (var n) (comp s' (comp shift t'))); auto 6.
Save commut_rvarlift2.
Hint Resolve commut_rvarlift2.
Goal forall x y : sub_explicits, reg_assenv x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s t u z H0.
pattern z in |- *; apply case_bcomp with (comp s t) u.
2: assumption.
intros x' u' H1 H2; pattern x' in |- *; apply case_bcomp with s t.
2: assumption.
intros s' t' H3 H4; exists (comp s' (comp t' u')); auto 6.
Save commut_assenv.
Hint Resolve commut_assenv.
Goal forall x y : sub_explicits, reg_mapenv x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a s t z H0.
pattern z in |- *; apply case_bcomp with (cons a s) t.
2: assumption.
intros x' t' H1 H2; pattern x' in |- *; apply case_bcons with a s.
2: assumption.
intros a' s' H3 H4; exists (cons (env a' t') (comp s' t')); auto 6.
Save commut_mapenv.
Hint Resolve commut_mapenv.
Goal forall x y : sub_explicits, reg_shiftcons x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a s z H0.
pattern z in |- *; apply case_bcomp with shift (cons a s).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bshift.
2: assumption.
pattern y' in |- *; apply case_bcons with a s.
2: assumption.
intros a' s' H3 H4; exists s'; auto 6.
Save commut_shiftcons.
Hint Resolve commut_shiftcons.
Goal forall x y : sub_explicits, reg_shiftlift1 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s z H0.
pattern z in |- *; apply case_bcomp with shift (lift s).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bshift.
2: assumption.
pattern y' in |- *; apply case_blift with s.
2: assumption.
intros s' H3; exists (comp s' shift); auto 6.
Save commut_shiftlift1.
Hint Resolve commut_shiftlift1.
Goal forall x y : sub_explicits, reg_shiftlift2 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s t z H0.
pattern z in |- *; apply case_bcomp with shift (comp (lift s) t).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_bshift.
2: assumption.
pattern y' in |- *; apply case_bcomp with (lift s) t.
2: assumption.
intros z' t' H3 H4; pattern z' in |- *; apply case_blift with s.
2: assumption.
intros s' H5; exists (comp s' (comp shift t')); auto 6.
Save commut_shiftlift2.
Hint Resolve commut_shiftlift2.
Goal forall x y : sub_explicits, reg_lift1 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s t z H0.
pattern z in |- *; apply case_bcomp with (lift s) (lift t).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_blift with s.
2: assumption.
intros s' H3; pattern y' in |- *; apply case_blift with t.
2: assumption.
intros t' H4; exists (lift (comp s' t')); auto 6.
Save commut_lift1.
Hint Resolve commut_lift1.
Goal forall x y : sub_explicits, reg_lift2 x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s t u z H0.
pattern z in |- *; apply case_bcomp with (lift s) (comp (lift t) u).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_blift with s.
2: assumption.
intros s' H3; pattern y' in |- *; apply case_bcomp with (lift t) u.
2: assumption.
intros z' u' H4 H5; pattern z' in |- *; apply case_blift with t.
2: assumption.
intros t' H6; exists (comp (lift (comp s' t')) u'); auto 6.
Save commut_lift2.
Hint Resolve commut_lift2.
Goal forall x y : sub_explicits, reg_liftenv x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a s t z H0.
pattern z in |- *; apply case_bcomp with (lift s) (cons a t).
2: assumption.
intros x' y' H1 H2; pattern x' in |- *; apply case_blift with s.
2: assumption.
intros s' H3; pattern y' in |- *; apply case_bcons with a t.
2: assumption.
intros a' t' H4 H5; exists (cons a' (comp s' t')); auto 6.
Save commut_liftenv.
Hint Resolve commut_liftenv.
Goal forall x y : sub_explicits, reg_idl x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s z H0.
pattern z in |- *; apply case_bcomp with id s.
2: assumption.
intros x' s' H1 H2; pattern x' in |- *; apply case_bid.
2: assumption.
exists s'; auto 6.
Save commut_idl.
Hint Resolve commut_idl.
Goal forall x y : sub_explicits, reg_idr x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros s z H0.
pattern z in |- *; apply case_bcomp with s id.
2: assumption.
intros s' x' H1 H2; pattern x' in |- *; apply case_bid.
2: assumption.
exists s'; auto 6.
Save commut_idr.
Hint Resolve commut_idr.
Goal forall x y : sub_explicits, reg_liftid x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros z H0.
pattern z in |- *; apply case_blift with id.
2: assumption.
intros x' H1; pattern x' in |- *; apply case_bid.
2: assumption.
exists id; auto 6.
Save commut_liftid.
Hint Resolve commut_liftid.
Goal forall x y : terms, reg_id x y -> e_diag1 _ x y.
simple induction 1; red in |- *; intros a z H0.
pattern z in |- *; apply case_benv with a id.
2: assumption.
intros a' x' H1 H2; pattern x' in |- *; apply case_bid.
2: assumption.
exists a'; auto 6.
Save commut_id.
Hint Resolve commut_id.
Goal forall (b : wsort) (x y : TS b), e_systemSL _ x y -> e_diag1 _ x y.
simple induction 1; intros; auto.
Save commut_systemSL.
Goal
forall (P : terms -> Prop) (a : terms),
(forall a' : terms, e_relSLstar _ a a' -> P (lambda a')) ->
forall M N : terms, e_relSLstar _ N M -> N = lambda a -> P M.
intros P a H M N H0; generalize a H; elim H0.
intros x a0 H1 H2; rewrite H2; apply (H1 a0); red in |- *; apply star_refl.
intros x y z H1 H2 H3 a0 H4 H5; generalize H1; rewrite H5; intro H6.
cut (y = y).
2: trivial.
pattern y at 2 in |- *; apply case_SLlambda with a0.
2: assumption.
intros a0' H7 H8; apply (H3 a0').
intros a' H9; apply H4; red in |- *; apply star_trans1 with a0'; assumption.
assumption.
Save case_SLstar_lambda'.
Goal
forall (P : terms -> Prop) (a : terms),
(forall a' : terms, e_relSLstar _ a a' -> P (lambda a')) ->
forall M : terms, e_relSLstar _ (lambda a) M -> P M.
intros; pattern M in |- *; apply case_SLstar_lambda' with a (lambda a);
auto 6.
Save case_SLstar_lambda.
Goal
forall (P : terms -> Prop) (a : terms),
(forall a' : terms, e_slstar_bp_slstar _ a a' -> P (lambda a')) ->
forall M : terms, e_slstar_bp_slstar _ (lambda a) M -> P M.
intros P a H M H0.
elim
(comp_case terms (e_relSLstar wt)
(explicit_comp_rel _ (e_beta_par wt) (e_relSLstar wt))
(lambda a) M H0).
intros x H1; elim H1; intros H2.
pattern x in |- *; apply case_SLstar_lambda with a.
2: assumption.
intros a' H3 H4.
elim (comp_case terms (e_beta_par wt) (e_relSLstar wt) (lambda a') M H4).
intros y H5; elim H5; intros H6.
pattern y in |- *; apply case_blambda with a'.
2: assumption.
intros a'' H7 H8.
pattern M in |- *; apply case_SLstar_lambda with a''.
2: assumption.
intros a_ H9; apply H.
red in |- *; apply comp_2rel with a'.
assumption.
apply comp_2rel with a''; assumption.
Save case_slbpsl_lambda.
Goal forall a a' : terms, e_diag1 _ (lambda a) (lambda a') -> e_diag1 _ a a'.
red in |- *; intros a a' H z H0.
elim (H (lambda z)).
2: apply lambda_bpar; assumption.
intros u1 H1; elim H1; intros H2 H3.
cut (u1 = u1).
2: trivial.
pattern u1 at 1 in |- *; apply case_SLstar_lambda with z.
2: assumption.
intros z' H4; pattern u1 in |- *; apply case_slbpsl_lambda with a'.
2: assumption.
intros a'' H5 H6; exists a''; split.
assumption.
elim (proj_lambda z' a'' H6); assumption.
Save diag1_lambda.
Theorem commut :
forall (b : wsort) (x y : TS b), e_relSL _ x y -> e_diag1 _ x y.
Theorem commutation :
forall (b : wsort) (x y z : TS b),
e_relSL _ x y ->
e_beta_par _ x z ->
exists u : TS b, e_relSLstar _ z u /\ e_slstar_bp_slstar _ y u.
Proof.
(* Goal: forall (b : wsort) (x y z : TS b) (_ : e_relSL b x y) (_ : e_beta_par b x z), @ex (TS b) (fun u : TS b => and (e_relSLstar b z u) (e_slstar_bp_slstar b y u)) *)
intros b x y z H H0; apply Ex_PQ; generalize z H0.
(* Goal: forall (z : TS b) (_ : e_beta_par b x z), @ex (TS b) (fun u : TS b => and (e_slstar_bp_slstar b y u) (e_relSLstar b z u)) *)
change (e_diag1 _ x y) in |- *.
(* Goal: e_diag1 b x y *)
apply commut; assumption.
Qed.
|
Require Import Arith List.
Require Import BellantoniCook.Lib.
Definition pow : Type := (nat*nat)%type.
Definition mon : Type := (nat * list pow)%type.
Definition pol : Type := (nat * list mon)%type.
Definition peval_pow (xn:pow)(l:list nat) : nat :=
power (nth (fst xn) l 0) (snd xn).
Definition peval_mon (m:mon)(l:list nat) : nat :=
(fst m) * multl (map (fun x => peval_pow x l) (snd m)).
Definition peval (p:pol)(l:list nat) :=
plusl (map (fun m => peval_mon m l) (snd p)).
Lemma peval_parity : forall ar p l,
peval (ar, snd p) l = peval p l.
Proof.
(* Goal: forall (ar : nat) (p : prod nat (list mon)) (l : list nat), @eq nat (peval (@pair nat (list mon) ar (@snd nat (list mon) p)) l) (peval p l) *)
intros ar [ar0 ml] l; simpl; trivial.
Qed.
Lemma peval_pow_monotonic : forall xn l1 l2,
(forall i, nth i l1 0 <= nth i l2 0) ->
peval_pow xn l1 <= peval_pow xn l2.
Proof.
(* Goal: forall (xn : pow) (l1 l2 : list nat) (_ : forall i : nat, le (@nth nat i l1 O) (@nth nat i l2 O)), le (peval_pow xn l1) (peval_pow xn l2) *)
intros [x n] l1 l2 H; simpl.
(* Goal: le (peval_pow (@pair nat nat x n) l1) (peval_pow (@pair nat nat x n) l2) *)
apply power_le_l; trivial.
Qed.
Lemma peval_mon_monotonic : forall m l1 l2,
(forall i, nth i l1 0 <= nth i l2 0) ->
peval_mon m l1 <= peval_mon m l2.
Proof.
(* Goal: forall (m : mon) (l1 l2 : list nat) (_ : forall i : nat, le (@nth nat i l1 O) (@nth nat i l2 O)), le (peval_mon m l1) (peval_mon m l2) *)
unfold peval_mon; intros [a xl] l1 l2 H.
(* Goal: le (Init.Nat.mul (@fst nat (list pow) (@pair nat (list pow) a xl)) (multl (@map pow nat (fun x : pow => peval_pow x l1) (@snd nat (list pow) (@pair nat (list pow) a xl))))) (Init.Nat.mul (@fst nat (list pow) (@pair nat (list pow) a xl)) (multl (@map pow nat (fun x : pow => peval_pow x l2) (@snd nat (list pow) (@pair nat (list pow) a xl))))) *)
induction xl; simpl; trivial.
(* Goal: le (Init.Nat.mul a (Init.Nat.mul (peval_pow a0 l1) (multl (@map pow nat (fun x : pow => peval_pow x l1) xl)))) (Init.Nat.mul a (Init.Nat.mul (peval_pow a0 l2) (multl (@map pow nat (fun x : pow => peval_pow x l2) xl)))) *)
rewrite !mult_assoc, !(mult_comm a), <- !mult_assoc.
(* Goal: le (Nat.mul (peval_pow a0 l1) (Nat.mul a (multl (@map pow nat (fun x : pow => peval_pow x l1) xl)))) (Nat.mul (peval_pow a0 l2) (Nat.mul a (multl (@map pow nat (fun x : pow => peval_pow x l2) xl)))) *)
apply mult_le_compat; trivial.
(* Goal: le (peval_pow a0 l1) (peval_pow a0 l2) *)
apply peval_pow_monotonic; trivial.
Qed.
Lemma peval_monotonic : forall p l1 l2,
(forall i, nth i l1 0 <= nth i l2 0) ->
peval p l1 <= peval p l2.
Proof.
(* Goal: forall (p : pol) (l1 l2 : list nat) (_ : forall i : nat, le (@nth nat i l1 O) (@nth nat i l2 O)), le (peval p l1) (peval p l2) *)
unfold peval; intros [ar ml] l1 l2 H.
(* Goal: le (plusl (@map mon nat (fun m : mon => peval_mon m l1) (@snd nat (list mon) (@pair nat (list mon) ar ml)))) (plusl (@map mon nat (fun m : mon => peval_mon m l2) (@snd nat (list mon) (@pair nat (list mon) ar ml)))) *)
induction ml; simpl; trivial.
(* Goal: le (Init.Nat.add (peval_mon a l1) (plusl (@map mon nat (fun m : mon => peval_mon m l1) ml))) (Init.Nat.add (peval_mon a l2) (plusl (@map mon nat (fun m : mon => peval_mon m l2) ml))) *)
apply plus_le_compat; trivial.
(* Goal: le (peval_mon a l1) (peval_mon a l2) *)
apply peval_mon_monotonic; trivial.
Qed.
Lemma peval_nth i pl p l :
peval (nth i pl p) l =
nth i (map (fun p => peval p l) pl) (peval p l).
Proof.
(* Goal: @eq nat (peval (@nth pol i pl p) l) (@nth nat i (@map pol nat (fun p : pol => peval p l) pl) (peval p l)) *)
intros; revert i.
(* Goal: forall i : nat, @eq nat (peval (@nth pol i pl p) l) (@nth nat i (@map pol nat (fun p : pol => peval p l) pl) (peval p l)) *)
induction pl; intros [ | i]; simpl; intros; trivial.
Qed.
Notation parity := (@fst nat (list mon)).
Definition pWF_pow (ar:nat)(xn:pow) : Prop :=
fst xn < ar.
Definition pWF_mon (ar:nat)(m:mon) : Prop :=
andl (pWF_pow ar) (snd m).
Definition pWF' (ar:nat)(ml:list mon) : Prop :=
andl (pWF_mon ar) ml.
Definition pWF (p:pol) : Prop :=
pWF' (fst p) (snd p).
Lemma pWF_mon_le : forall ar1 ar2 m,
ar1 <= ar2 ->
pWF_mon ar1 m -> pWF_mon ar2 m.
Proof.
(* Goal: forall (ar1 ar2 : nat) (m : mon) (_ : le ar1 ar2) (_ : pWF_mon ar1 m), pWF_mon ar2 m *)
unfold pWF_mon, pWF_pow; intros ar1 ar2 [a xl].
(* Goal: forall (_ : le ar1 ar2) (_ : @andl pow (fun xn : pow => lt (@fst nat nat xn) ar1) (@snd nat (list pow) (@pair nat (list pow) a xl))), @andl pow (fun xn : pow => lt (@fst nat nat xn) ar2) (@snd nat (list pow) (@pair nat (list pow) a xl)) *)
induction xl as [ | xn xl' IH]; simpl; intros; trivial.
(* Goal: and (lt (@fst nat nat xn) ar2) (@andl pow (fun xn : pow => lt (@fst nat nat xn) ar2) xl') *)
destruct xn as [x n]; simpl in *.
(* Goal: and (lt x ar2) (@andl pow (fun xn : pow => lt (@fst nat nat xn) ar2) xl') *)
split;[ omega | tauto].
Qed.
Lemma pWF'_le ar1 ar2 ml :
ar1 <= ar2 -> pWF' ar1 ml -> pWF' ar2 ml.
Proof.
(* Goal: forall (_ : le ar1 ar2) (_ : pWF' ar1 ml), pWF' ar2 ml *)
induction ml; simpl; intros; trivial.
(* Goal: and (pWF_mon ar2 a) (pWF' ar2 ml) *)
split;[ | tauto].
(* Goal: pWF_mon ar2 a *)
apply pWF_mon_le with ar1; trivial; tauto.
Qed.
Lemma pWF_mon_app : forall ar a1 xl1 a2 xl2,
pWF_mon ar (a1, xl1) -> pWF_mon ar (a2, xl2) ->
pWF_mon ar (a1*a2, xl1++xl2).
Proof.
(* Goal: forall (ar a1 : nat) (xl1 : list pow) (a2 : nat) (xl2 : list pow) (_ : pWF_mon ar (@pair nat (list pow) a1 xl1)) (_ : pWF_mon ar (@pair nat (list pow) a2 xl2)), pWF_mon ar (@pair nat (list pow) (Init.Nat.mul a1 a2) (@app pow xl1 xl2)) *)
unfold pWF_mon, pWF_pow.
(* Goal: forall (ar a1 : nat) (xl1 : list pow) (a2 : nat) (xl2 : list pow) (_ : @andl pow (fun xn : pow => lt (@fst nat nat xn) ar) (@snd nat (list pow) (@pair nat (list pow) a1 xl1))) (_ : @andl pow (fun xn : pow => lt (@fst nat nat xn) ar) (@snd nat (list pow) (@pair nat (list pow) a2 xl2))), @andl pow (fun xn : pow => lt (@fst nat nat xn) ar) (@snd nat (list pow) (@pair nat (list pow) (Init.Nat.mul a1 a2) (@app pow xl1 xl2))) *)
induction xl1 as [ | [x n] xl1' IH]; simpl; intros; trivial.
(* Goal: and (lt x ar) (@andl pow (fun xn : pow => lt (@fst nat nat xn) ar) (@app pow xl1' xl2)) *)
split;[ tauto | ].
(* Goal: @andl pow (fun xn : pow => lt (@fst nat nat xn) ar) (@app pow xl1' xl2) *)
apply IH with a1; tauto.
Qed.
Lemma pWF'_app ar ml1 ml2 :
pWF' ar ml1 -> pWF' ar ml2 -> pWF' ar (ml1++ml2).
Proof.
(* Goal: forall (_ : pWF' ar ml1) (_ : pWF' ar ml2), pWF' ar (@app mon ml1 ml2) *)
induction ml1 as [ | m1 ml1' IH]; simpl; intros; trivial.
(* Goal: and (pWF_mon ar m1) (pWF' ar (@app mon ml1' ml2)) *)
split;[ tauto | ].
(* Goal: pWF' ar (@app mon ml1' ml2) *)
apply IH; tauto.
Qed.
Lemma pWF_nth i pl p0 :
andl pWF pl -> pWF p0 -> pWF (nth i pl p0).
Proof.
(* Goal: forall (_ : @andl pol pWF pl) (_ : pWF p0), pWF (@nth pol i pl p0) *)
intros; revert i.
(* Goal: forall i : nat, pWF (@nth pol i pl p0) *)
induction pl; simpl in *; intros; case i; intros; trivial.
(* Goal: pWF (@nth pol n pl p0) *)
(* Goal: pWF a *)
tauto.
(* Goal: pWF (@nth pol n pl p0) *)
apply IHpl; tauto.
Qed.
Lemma parity_mon_correct : forall ar m l l1 l2,
pWF_mon ar m -> length l = ar -> peval_mon m (l++l1) = peval_mon m (l++l2).
Proof.
(* Goal: forall (ar : nat) (m : mon) (l l1 l2 : list nat) (_ : pWF_mon ar m) (_ : @eq nat (@length nat l) ar), @eq nat (peval_mon m (@app nat l l1)) (peval_mon m (@app nat l l2)) *)
unfold peval_mon, peval_pow, pWF_mon, pWF_pow.
(* Goal: forall (ar : nat) (m : mon) (l l1 l2 : list nat) (_ : @andl pow (fun xn : pow => lt (@fst nat nat xn) ar) (@snd nat (list pow) m)) (_ : @eq nat (@length nat l) ar), @eq nat (Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) (@snd nat (list pow) m)))) (Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) (@snd nat (list pow) m)))) *)
intros ar [a xl] l l1 l2 H1 H2; simpl in *; f_equal; f_equal.
(* Goal: @eq (list nat) (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) xl) (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) xl) *)
induction xl as [ | [x n] xl' IH]; simpl in *; trivial.
(* Goal: @eq (list nat) (@cons nat (power (@nth nat x (@app nat l l1) O) n) (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) xl')) (@cons nat (power (@nth nat x (@app nat l l2) O) n) (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) xl')) *)
f_equal;[ | tauto].
(* Goal: @eq nat (power (@nth nat x (@app nat l l1) O) n) (power (@nth nat x (@app nat l l2) O) n) *)
f_equal; rewrite !app_nth1; trivial; omega.
Qed.
Lemma parity_correct : forall p l l1 l2,
pWF p -> length l = parity p -> peval p (l++l1) = peval p (l++l2).
Proof.
(* Goal: forall (p : pol) (l l1 l2 : list nat) (_ : pWF p) (_ : @eq nat (@length nat l) (@fst nat (list mon) p)), @eq nat (peval p (@app nat l l1)) (peval p (@app nat l l2)) *)
unfold peval, peval_mon, peval_pow, pWF, pWF_mon, pWF_pow.
(* Goal: forall (p : pol) (l l1 l2 : list nat) (_ : pWF' (@fst nat (list mon) p) (@snd nat (list mon) p)) (_ : @eq nat (@length nat l) (@fst nat (list mon) p)), @eq nat (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) p))) (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) p))) *)
intros [ar ml] l l1 l2 H1 H2; simpl in *; f_equal.
(* Goal: @eq (list nat) (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) (@snd nat (list pow) m)))) ml) (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) (@snd nat (list pow) m)))) ml) *)
induction ml as [ | m ml' IH]; simpl in *; trivial.
(* Goal: @eq (list nat) (@cons nat (Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) (@snd nat (list pow) m)))) ml')) (@cons nat (Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) (@snd nat (list pow) m)))) ml')) *)
f_equal;[ | tauto].
(* Goal: @eq nat (Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l1) O) (@snd nat nat x)) (@snd nat (list pow) m)))) (Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@app nat l l2) O) (@snd nat nat x)) (@snd nat (list pow) m)))) *)
apply parity_mon_correct with ar; tauto.
Qed.
Definition pcst (ar a:nat) : pol :=
(ar, [(a,nil)]).
Lemma parity_pcst ar a :
parity (pcst ar a) = ar.
Proof.
(* Goal: @eq nat (@fst nat (list mon) (pcst ar a)) ar *)
trivial.
Qed.
Lemma pWF_pcst ar a : pWF (pcst ar a).
Proof.
(* Goal: pWF (pcst ar a) *)
compute; intros; tauto.
Qed.
Lemma pcst_correct : forall ar k l, peval (pcst ar k) l = k.
Proof.
(* Goal: forall (ar k : nat) (l : list nat), @eq nat (peval (pcst ar k) l) k *)
unfold peval, peval_mon, peval_pow; simpl; intros; omega.
Qed.
Definition pproj (ar i:nat) : pol :=
(ar,[(1,[(i,1)])]).
Lemma parity_pproj n i :
parity (pproj n i) = n.
Proof.
(* Goal: @eq nat (@fst nat (list mon) (pproj n i)) n *)
trivial.
Qed.
Lemma pWF_pproj ar i : i < ar -> pWF (pproj ar i).
Proof.
(* Goal: forall _ : lt i ar, pWF (pproj ar i) *)
compute; intros; tauto.
Qed.
Lemma pproj_correct : forall ar i l,
peval (pproj ar i) l = nth i l 0.
Proof.
(* Goal: forall (ar i : nat) (l : list nat), @eq nat (peval (pproj ar i) l) (@nth nat i l O) *)
unfold peval, peval_mon, peval_pow; simpl; intros; omega.
Qed.
Definition pscalar_mon (n:nat)(m:mon) : mon :=
(n * fst m, snd m).
Definition pscalar (n:nat)(p:pol) : pol :=
(fst p, map (pscalar_mon n) (snd p)).
Lemma parity_pscalar n p :
parity (pscalar n p) = parity p.
Proof.
(* Goal: @eq nat (@fst nat (list mon) (pscalar n p)) (@fst nat (list mon) p) *)
trivial.
Qed.
Lemma pWF_pscalar : forall n p,
pWF p -> pWF (pscalar n p).
Proof.
(* Goal: forall (n : nat) (p : pol) (_ : pWF p), pWF (pscalar n p) *)
unfold pWF, pWF_mon, pWF_pow; intros n [ar ml] H.
(* Goal: pWF' (@fst nat (list mon) (pscalar n (@pair nat (list mon) ar ml))) (@snd nat (list mon) (pscalar n (@pair nat (list mon) ar ml))) *)
induction ml; simpl in *; trivial; tauto.
Qed.
Lemma pscalar_mon_correct : forall n m l,
peval_mon (pscalar_mon n m) l = n * peval_mon m l.
Proof.
(* Goal: forall (n : nat) (m : mon) (l : list nat), @eq nat (peval_mon (pscalar_mon n m) l) (Init.Nat.mul n (peval_mon m l)) *)
unfold peval_mon; intros n [a xl] l; simpl; ring.
Qed.
Lemma map_pscalar_mon n ml l :
plusl (map (fun m => peval_mon (pscalar_mon n m) l) ml) =
n * plusl (map (fun m => peval_mon m l) ml).
Proof.
(* Goal: @eq nat (plusl (@map mon nat (fun m : mon => peval_mon (pscalar_mon n m) l) ml)) (Init.Nat.mul n (plusl (@map mon nat (fun m : mon => peval_mon m l) ml))) *)
induction ml; simpl; trivial.
(* Goal: @eq nat (Init.Nat.add (peval_mon (pscalar_mon n a) l) (plusl (@map mon nat (fun m : mon => peval_mon (pscalar_mon n m) l) ml))) (Init.Nat.mul n (Init.Nat.add (peval_mon a l) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml)))) *)
rewrite pscalar_mon_correct, IHml; ring.
Qed.
Lemma pscalar_correct : forall n p l,
peval (pscalar n p) l = n * peval p l.
Proof.
(* Goal: forall (n : nat) (p : pol) (l : list nat), @eq nat (peval (pscalar n p) l) (Init.Nat.mul n (peval p l)) *)
unfold peval, pscalar; intros n [ar pl] l.
(* Goal: @eq nat (plusl (@map mon nat (fun m : mon => peval_mon m l) (@snd nat (list mon) (@pair nat (list mon) (@fst nat (list mon) (@pair nat (list mon) ar pl)) (@map mon mon (pscalar_mon n) (@snd nat (list mon) (@pair nat (list mon) ar pl))))))) (Init.Nat.mul n (plusl (@map mon nat (fun m : mon => peval_mon m l) (@snd nat (list mon) (@pair nat (list mon) ar pl))))) *)
induction pl; simpl in *; trivial.
(* Goal: @eq nat (Init.Nat.add (peval_mon (pscalar_mon n a) l) (plusl (@map mon nat (fun m : mon => peval_mon m l) (@map mon mon (pscalar_mon n) pl)))) (Init.Nat.mul n (Init.Nat.add (peval_mon a l) (plusl (@map mon nat (fun m : mon => peval_mon m l) pl)))) *)
rewrite map_map in *.
(* Goal: @eq nat (Init.Nat.add (peval_mon (pscalar_mon n a) l) (plusl (@map mon nat (fun x : mon => peval_mon (pscalar_mon n x) l) pl))) (Init.Nat.mul n (Init.Nat.add (peval_mon a l) (plusl (@map mon nat (fun m : mon => peval_mon m l) pl)))) *)
rewrite pscalar_mon_correct; simpl in IHpl.
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul n (peval_mon a l)) (plusl (@map mon nat (fun x : mon => peval_mon (pscalar_mon n x) l) pl))) (Init.Nat.mul n (Init.Nat.add (peval_mon a l) (plusl (@map mon nat (fun m : mon => peval_mon m l) pl)))) *)
rewrite IHpl; ring.
Qed.
Definition pplus (p1 p2:pol) : pol :=
(max (fst p1) (fst p2), snd p1 ++ snd p2).
Lemma parity_pplus : forall p1 p2,
parity (pplus p1 p2) = max (parity p1) (parity p2).
Proof.
(* Goal: forall p1 p2 : pol, @eq nat (@fst nat (list mon) (pplus p1 p2)) (Init.Nat.max (@fst nat (list mon) p1) (@fst nat (list mon) p2)) *)
intros [ar1 ml1] [ar2 ml2]; trivial.
Qed.
Lemma pWF_pplus : forall p1 p2,
pWF p1 -> pWF p2 -> pWF (pplus p1 p2).
Proof.
(* Goal: forall (p1 p2 : pol) (_ : pWF p1) (_ : pWF p2), pWF (pplus p1 p2) *)
unfold pWF, pWF_mon, pWF_pow.
(* Goal: forall (p1 p2 : pol) (_ : pWF' (@fst nat (list mon) p1) (@snd nat (list mon) p1)) (_ : pWF' (@fst nat (list mon) p2) (@snd nat (list mon) p2)), pWF' (@fst nat (list mon) (pplus p1 p2)) (@snd nat (list mon) (pplus p1 p2)) *)
intros [ar1 ml1] [ar2 ml2] H1 H2; simpl in *.
(* Goal: pWF' (Init.Nat.max ar1 ar2) (@app mon ml1 ml2) *)
induction ml1 as [ | m1 ml1' IH]; simpl in *.
(* Goal: and (pWF_mon (Init.Nat.max ar1 ar2) m1) (pWF' (Init.Nat.max ar1 ar2) (@app mon ml1' ml2)) *)
(* Goal: pWF' (Init.Nat.max ar1 ar2) ml2 *)
apply pWF'_le with ar2; auto with arith.
(* Goal: and (pWF_mon (Init.Nat.max ar1 ar2) m1) (pWF' (Init.Nat.max ar1 ar2) (@app mon ml1' ml2)) *)
split;[ | tauto ].
(* Goal: pWF_mon (Init.Nat.max ar1 ar2) m1 *)
apply pWF_mon_le with ar1; auto with arith; tauto.
Qed.
Lemma pplus_correct : forall p1 p2 l,
peval (pplus p1 p2) l = peval p1 l + peval p2 l.
Proof.
(* Goal: forall (p1 p2 : pol) (l : list nat), @eq nat (peval (pplus p1 p2) l) (Init.Nat.add (peval p1 l) (peval p2 l)) *)
unfold peval, peval_mon, peval_pow.
(* Goal: forall (p1 p2 : pol) (l : list nat), @eq nat (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) (pplus p1 p2)))) (Init.Nat.add (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) p1))) (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) p2)))) *)
intros [ar1 ml1] [ar2 ml2] l.
(* Goal: @eq nat (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) (pplus (@pair nat (list mon) ar1 ml1) (@pair nat (list mon) ar2 ml2))))) (Init.Nat.add (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) (@pair nat (list mon) ar1 ml1)))) (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@snd nat (list mon) (@pair nat (list mon) ar2 ml2))))) *)
induction ml1 as [ | m1 ml1' IH]; simpl in *; trivial.
(* Goal: @eq nat (Init.Nat.add (Init.Nat.mul (@fst nat (list pow) m1) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m1)))) (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) (@app mon ml1' ml2)))) (Init.Nat.add (Init.Nat.add (Init.Nat.mul (@fst nat (list pow) m1) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m1)))) (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) ml1'))) (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m)))) ml2))) *)
unfold peval, pplus in IH; rewrite IH; ring.
Qed.
Definition pplusl (pl:list pol) : pol :=
fold_right pplus (pcst 0 0) pl.
Lemma parity_pplusl : forall pl,
parity (pplusl pl) = maxl (map parity pl).
Proof.
(* Goal: forall pl : list pol, @eq nat (@fst nat (list mon) (pplusl pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
induction pl; trivial; simpl pplusl.
(* Goal: @eq nat (@fst nat (list mon) (pplus a (pplusl pl))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) (@cons pol a pl))) *)
rewrite parity_pplus, IHpl; trivial.
Qed.
Definition pWF_pplusl : forall pl,
andl pWF pl -> pWF (pplusl pl).
Proof.
(* Goal: forall (pl : list pol) (_ : @andl pol pWF pl), pWF (pplusl pl) *)
unfold pWF, pWF_mon, pWF_pow.
(* Goal: forall (pl : list pol) (_ : @andl pol (fun p : pol => pWF' (@fst nat (list mon) p) (@snd nat (list mon) p)) pl), pWF' (@fst nat (list mon) (pplusl pl)) (@snd nat (list mon) (pplusl pl)) *)
induction pl; intros;[ simpl; tauto |].
(* Goal: pWF' (@fst nat (list mon) (pplusl (@cons pol a pl))) (@snd nat (list mon) (pplusl (@cons pol a pl))) *)
apply pWF_pplus; simpl in *; tauto.
Qed.
Lemma pplusl_correct : forall pl l,
peval (pplusl pl) l = plusl (map (fun p => peval p l) pl).
Proof.
(* Goal: forall (pl : list pol) (l : list nat), @eq nat (peval (pplusl pl) l) (plusl (@map pol nat (fun p : pol => peval p l) pl)) *)
induction pl; simpl; intros; trivial.
(* Goal: @eq nat (peval (pplus a (pplusl pl)) l) (Init.Nat.add (peval a l) (plusl (@map pol nat (fun p : pol => peval p l) pl))) *)
rewrite pplus_correct, IHpl; trivial.
Qed.
Lemma peval_nth_pplus : forall pl l i n,
peval (nth i pl (pcst n 0)) l <=
peval (pplusl pl) l.
Proof.
(* Goal: forall (pl : list pol) (l : list nat) (i n : nat), le (peval (@nth pol i pl (pcst n O)) l) (peval (pplusl pl) l) *)
induction pl; simpl; intros; case i; trivial; rewrite pplus_correct; [ omega | ].
(* Goal: forall n0 : nat, le (peval (@nth pol n0 pl (pcst n O)) l) (Init.Nat.add (peval a l) (peval (pplusl pl) l)) *)
intros; eapply le_trans;[ apply IHpl | ].
(* Goal: le (peval (pplusl pl) l) (Init.Nat.add (peval a l) (peval (pplusl pl) l)) *)
omega.
Qed.
Definition pmult_mon (m12:mon*mon) : mon :=
(fst (fst m12) * fst (snd m12), snd (fst m12) ++ snd (snd m12)).
Definition pmult (p1 p2:pol) : pol :=
(max (fst p1) (fst p2), map pmult_mon (list_prod (snd p1) (snd p2))).
Lemma parity_pmult : forall p1 p2,
parity (pmult p1 p2) = max (parity p1) (parity p2).
Proof.
(* Goal: forall p1 p2 : pol, @eq nat (@fst nat (list mon) (pmult p1 p2)) (Init.Nat.max (@fst nat (list mon) p1) (@fst nat (list mon) p2)) *)
intros [ar1 ml1] [ar2 ml2]; trivial.
Qed.
Lemma pWF_pmult_mon : forall ar1 m1 ar2 m2,
pWF_mon ar1 m1 -> pWF_mon ar2 m2 ->
pWF_mon (max ar1 ar2) (pmult_mon (m1, m2)).
Proof.
(* Goal: forall (ar1 : nat) (m1 : mon) (ar2 : nat) (m2 : mon) (_ : pWF_mon ar1 m1) (_ : pWF_mon ar2 m2), pWF_mon (Init.Nat.max ar1 ar2) (pmult_mon (@pair mon mon m1 m2)) *)
intros ar1 [a1 xl1] ar2 [a2 xl2]; simpl pmult_mon; intros.
(* Goal: pWF_mon (Init.Nat.max ar1 ar2) (pmult_mon (@pair mon mon (@pair nat (list pow) a1 xl1) (@pair nat (list pow) a2 xl2))) *)
apply pWF_mon_app.
(* Goal: pWF_mon (Init.Nat.max ar1 ar2) (@pair nat (list pow) (@fst nat (list pow) (@snd mon mon (@pair mon mon (@pair nat (list pow) a1 xl1) (@pair nat (list pow) a2 xl2)))) (@snd nat (list pow) (@snd mon mon (@pair mon mon (@pair nat (list pow) a1 xl1) (@pair nat (list pow) a2 xl2))))) *)
(* Goal: pWF_mon (Init.Nat.max ar1 ar2) (@pair nat (list pow) (@fst nat (list pow) (@fst mon mon (@pair mon mon (@pair nat (list pow) a1 xl1) (@pair nat (list pow) a2 xl2)))) (@snd nat (list pow) (@fst mon mon (@pair mon mon (@pair nat (list pow) a1 xl1) (@pair nat (list pow) a2 xl2))))) *)
apply pWF_mon_le with ar1; auto with arith.
(* Goal: pWF_mon (Init.Nat.max ar1 ar2) (@pair nat (list pow) (@fst nat (list pow) (@snd mon mon (@pair mon mon (@pair nat (list pow) a1 xl1) (@pair nat (list pow) a2 xl2)))) (@snd nat (list pow) (@snd mon mon (@pair mon mon (@pair nat (list pow) a1 xl1) (@pair nat (list pow) a2 xl2))))) *)
apply pWF_mon_le with ar2; auto with arith.
Qed.
Lemma pWF_pmult : forall p1 p2,
pWF p1 -> pWF p2 -> pWF (pmult p1 p2).
Proof.
(* Goal: forall (p1 p2 : pol) (_ : pWF p1) (_ : pWF p2), pWF (pmult p1 p2) *)
unfold pWF, pWF_mon, pWF_pow.
(* Goal: forall (p1 p2 : pol) (_ : pWF' (@fst nat (list mon) p1) (@snd nat (list mon) p1)) (_ : pWF' (@fst nat (list mon) p2) (@snd nat (list mon) p2)), pWF' (@fst nat (list mon) (pmult p1 p2)) (@snd nat (list mon) (pmult p1 p2)) *)
intros [ar1 ml1] [ar2 ml2] H1 H2; simpl in *.
(* Goal: pWF' (Init.Nat.max ar1 ar2) (@map (prod mon mon) mon pmult_mon (@list_prod mon mon ml1 ml2)) *)
induction ml1 as [ | m1 ml1' IH1]; simpl in *; intros; trivial.
(* Goal: pWF' (Init.Nat.max ar1 ar2) (@map (prod mon mon) mon pmult_mon (@app (prod mon mon) (@map mon (prod mon mon) (fun y : mon => @pair mon mon m1 y) ml2) (@list_prod mon mon ml1' ml2))) *)
rewrite map_app, map_map.
(* Goal: pWF' (Init.Nat.max ar1 ar2) (@app mon (@map mon mon (fun x : mon => pmult_mon (@pair mon mon m1 x)) ml2) (@map (prod mon mon) mon pmult_mon (@list_prod mon mon ml1' ml2))) *)
apply pWF'_app;[ | tauto ].
(* Goal: pWF' (Init.Nat.max ar1 ar2) (@map mon mon (fun x : mon => pmult_mon (@pair mon mon m1 x)) ml2) *)
clear IH1.
(* Goal: pWF' (Init.Nat.max ar1 ar2) (@map mon mon (fun x : mon => pmult_mon (@pair mon mon m1 x)) ml2) *)
induction ml2 as [ | m2 ml2' IH2]; simpl in *; intros; trivial.
(* Goal: and (pWF_mon (Init.Nat.max ar1 ar2) (pmult_mon (@pair mon mon m1 m2))) (pWF' (Init.Nat.max ar1 ar2) (@map mon mon (fun x : mon => pmult_mon (@pair mon mon m1 x)) ml2')) *)
split;[ | tauto ].
(* Goal: pWF_mon (Init.Nat.max ar1 ar2) (pmult_mon (@pair mon mon m1 m2)) *)
apply pWF_pmult_mon; tauto.
Qed.
Lemma pmult_mon_correct : forall m12 l,
peval_mon (pmult_mon m12) l =
peval_mon (fst m12) l * peval_mon (snd m12) l.
Proof.
(* Goal: forall (m12 : prod mon mon) (l : list nat), @eq nat (peval_mon (pmult_mon m12) l) (Init.Nat.mul (peval_mon (@fst mon mon m12) l) (peval_mon (@snd mon mon m12) l)) *)
unfold peval_mon, peval_pow.
(* Goal: forall (m12 : prod mon mon) (l : list nat), @eq nat (Init.Nat.mul (@fst nat (list pow) (pmult_mon m12)) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) (pmult_mon m12))))) (Init.Nat.mul (Init.Nat.mul (@fst nat (list pow) (@fst mon mon m12)) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) (@fst mon mon m12))))) (Init.Nat.mul (@fst nat (list pow) (@snd mon mon m12)) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) (@snd mon mon m12)))))) *)
intros [[a1 xl1] [a2 xl2]] l; simpl.
(* Goal: @eq nat (Init.Nat.mul (Init.Nat.mul a1 a2) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@app pow xl1 xl2)))) (Init.Nat.mul (Init.Nat.mul a1 (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) xl1))) (Init.Nat.mul a2 (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) xl2)))) *)
induction xl1 as [ | x1 xl1' IH]; simpl;[ ring | ring [IH] ].
Qed.
Lemma map_pmult_mon : forall m1 ml2 l,
map (fun m2 => peval_mon (pmult_mon (m1, m2)) l) ml2 =
map (fun m2 => peval_mon m1 l * peval_mon m2 l) ml2.
Proof.
(* Goal: forall (m1 : mon) (ml2 : list mon) (l : list nat), @eq (list nat) (@map mon nat (fun m2 : mon => peval_mon (pmult_mon (@pair mon mon m1 m2)) l) ml2) (@map mon nat (fun m2 : mon => Init.Nat.mul (peval_mon m1 l) (peval_mon m2 l)) ml2) *)
unfold peval_mon, peval_pow.
(* Goal: forall (m1 : mon) (ml2 : list mon) (l : list nat), @eq (list nat) (@map mon nat (fun m2 : mon => Init.Nat.mul (@fst nat (list pow) (pmult_mon (@pair mon mon m1 m2))) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) (pmult_mon (@pair mon mon m1 m2)))))) ml2) (@map mon nat (fun m2 : mon => Init.Nat.mul (Init.Nat.mul (@fst nat (list pow) m1) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m1)))) (Init.Nat.mul (@fst nat (list pow) m2) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m2))))) ml2) *)
intros [a1 xl1] ml2 l; simpl.
(* Goal: @eq (list nat) (@map mon nat (fun m2 : mon => Init.Nat.mul (Init.Nat.mul a1 (@fst nat (list pow) m2)) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@app pow xl1 (@snd nat (list pow) m2))))) ml2) (@map mon nat (fun m2 : mon => Init.Nat.mul (Init.Nat.mul a1 (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) xl1))) (Init.Nat.mul (@fst nat (list pow) m2) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m2))))) ml2) *)
induction ml2 as [ | [a2 xl2] ml2' IH]; simpl; trivial.
(* Goal: @eq (list nat) (@cons nat (Init.Nat.mul (Init.Nat.mul a1 a2) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@app pow xl1 xl2)))) (@map mon nat (fun m2 : mon => Init.Nat.mul (Init.Nat.mul a1 (@fst nat (list pow) m2)) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@app pow xl1 (@snd nat (list pow) m2))))) ml2')) (@cons nat (Init.Nat.mul (Init.Nat.mul a1 (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) xl1))) (Init.Nat.mul a2 (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) xl2)))) (@map mon nat (fun m2 : mon => Init.Nat.mul (Init.Nat.mul a1 (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) xl1))) (Init.Nat.mul (@fst nat (list pow) m2) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) l O) (@snd nat nat x)) (@snd nat (list pow) m2))))) ml2')) *)
rewrite IH, map_app, multl_app; f_equal; ring.
Qed.
Lemma pmult_correct : forall p1 p2 l,
peval (pmult p1 p2) l = peval p1 l * peval p2 l.
Proof.
(* Goal: forall (p1 p2 : pol) (l : list nat), @eq nat (peval (pmult p1 p2) l) (Init.Nat.mul (peval p1 l) (peval p2 l)) *)
unfold peval; intros [ar1 ml1] [ar2 ml2] l; simpl.
(* Goal: @eq nat (plusl (@map mon nat (fun m : mon => peval_mon m l) (@map (prod mon mon) mon pmult_mon (@list_prod mon mon ml1 ml2)))) (Init.Nat.mul (plusl (@map mon nat (fun m : mon => peval_mon m l) ml1)) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2))) *)
induction ml1 as [ | m1 ml1' IH]; simpl; trivial.
(* Goal: @eq nat (plusl (@map mon nat (fun m : mon => peval_mon m l) (@map (prod mon mon) mon pmult_mon (@app (prod mon mon) (@map mon (prod mon mon) (fun y : mon => @pair mon mon m1 y) ml2) (@list_prod mon mon ml1' ml2))))) (Init.Nat.mul (Init.Nat.add (peval_mon m1 l) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml1'))) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2))) *)
rewrite !map_app, !map_map, map_pmult_mon, plusl_app.
(* Goal: @eq nat (Init.Nat.add (plusl (@map mon nat (fun m2 : mon => Init.Nat.mul (peval_mon m1 l) (peval_mon m2 l)) ml2)) (plusl (@map (prod mon mon) nat (fun x : prod mon mon => peval_mon (pmult_mon x) l) (@list_prod mon mon ml1' ml2)))) (Init.Nat.mul (Init.Nat.add (peval_mon m1 l) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml1'))) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2))) *)
rewrite map_map in IH; rewrite IH.
(* Goal: @eq nat (Init.Nat.add (plusl (@map mon nat (fun m2 : mon => Init.Nat.mul (peval_mon m1 l) (peval_mon m2 l)) ml2)) (Init.Nat.mul (plusl (@map mon nat (fun m : mon => peval_mon m l) ml1')) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2)))) (Init.Nat.mul (Init.Nat.add (peval_mon m1 l) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml1'))) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2))) *)
rewrite mult_plus_distr_r.
(* Goal: @eq nat (Init.Nat.add (plusl (@map mon nat (fun m2 : mon => Init.Nat.mul (peval_mon m1 l) (peval_mon m2 l)) ml2)) (Init.Nat.mul (plusl (@map mon nat (fun m : mon => peval_mon m l) ml1')) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2)))) (Nat.add (Nat.mul (peval_mon m1 l) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2))) (Nat.mul (plusl (@map mon nat (fun m : mon => peval_mon m l) ml1')) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2)))) *)
f_equal.
(* Goal: @eq nat (plusl (@map mon nat (fun m2 : mon => Init.Nat.mul (peval_mon m1 l) (peval_mon m2 l)) ml2)) (Nat.mul (peval_mon m1 l) (plusl (@map mon nat (fun m : mon => peval_mon m l) ml2))) *)
rewrite multl_plus_distr_l, map_map; trivial.
Qed.
Definition pmultl (pl:list pol) : pol :=
fold_right pmult (pcst 0 1) pl.
Lemma parity_pmultl pl :
parity (pmultl pl) = maxl (map parity pl).
Proof.
(* Goal: @eq nat (@fst nat (list mon) (pmultl pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
induction pl; simpl pmultl; trivial.
(* Goal: @eq nat (@fst nat (list mon) (pmult a (pmultl pl))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) (@cons pol a pl))) *)
rewrite parity_pmult, IHpl; trivial.
Qed.
Definition pWF_pmultl pl :
andl pWF pl -> pWF (pmultl pl).
Proof.
(* Goal: forall _ : @andl pol pWF pl, pWF (pmultl pl) *)
induction pl; simpl pmultl; intros.
(* Goal: pWF (pmult a (pmultl pl)) *)
(* Goal: pWF (pcst O (S O)) *)
apply pWF_pcst.
(* Goal: pWF (pmult a (pmultl pl)) *)
apply pWF_pmult; simpl in *; tauto.
Qed.
Lemma pmultl_correct pl l :
peval (pmultl pl) l = multl (map (fun p => peval p l) pl).
Proof.
(* Goal: @eq nat (peval (pmultl pl) l) (multl (@map pol nat (fun p : pol => peval p l) pl)) *)
induction pl; simpl; intros; trivial.
(* Goal: @eq nat (peval (pmult a (pmultl pl)) l) (Init.Nat.mul (peval a l) (multl (@map pol nat (fun p : pol => peval p l) pl))) *)
rewrite pmult_correct, IHpl; trivial.
Qed.
Fixpoint ppower (p:pol)(n:nat) : pol :=
match n with
| 0 => pcst (fst p) 1
| S n' => pmult p (ppower p n')
end.
Lemma parity_ppower p n :
parity (ppower p n) = parity p.
Proof.
(* Goal: @eq nat (@fst nat (list mon) (ppower p n)) (@fst nat (list mon) p) *)
induction n; simpl ppower; trivial.
(* Goal: @eq nat (@fst nat (list mon) (pmult p (ppower p n))) (@fst nat (list mon) p) *)
rewrite parity_pmult, IHn; auto with arith.
Qed.
Lemma pWF_ppower p n :
pWF p -> pWF (ppower p n).
Proof.
(* Goal: forall _ : pWF p, pWF (ppower p n) *)
induction n; simpl ppower; intros.
(* Goal: pWF (pmult p (ppower p n)) *)
(* Goal: pWF (pcst (@fst nat (list mon) p) (S O)) *)
apply pWF_pcst.
(* Goal: pWF (pmult p (ppower p n)) *)
apply pWF_pmult; tauto.
Qed.
Lemma ppower_correct p n l :
peval (ppower p n) l = power (peval p l) n.
Proof.
(* Goal: @eq nat (peval (ppower p n) l) (power (peval p l) n) *)
induction n; simpl; intros; trivial.
(* Goal: @eq nat (peval (pmult p (ppower p n)) l) (Init.Nat.mul (peval p l) (power (peval p l) n)) *)
rewrite pmult_correct, IHn;trivial.
Qed.
Definition pcomp_pow' (xn:pow)(pl:list pol) : pol :=
ppower (nth (fst xn) pl (pcst 0 0)) (snd xn).
Definition pcomp_pow (xn:pow)(pl:list pol) : pol :=
(maxl (map parity pl), snd (pcomp_pow' xn pl)).
Definition pcomp_mon' (m:mon)(pl:list pol) : pol :=
pscalar (fst m) (pmultl (map (fun xn => pcomp_pow xn pl) (snd m))).
Definition pcomp_mon (m:mon)(pl:list pol) : pol :=
(maxl (map parity pl), snd (pcomp_mon' m pl)).
Definition pcomp' (p:pol)(pl:list pol) : pol :=
pplusl (map (fun m => pcomp_mon m pl) (snd p)).
Definition pcomp (p:pol)(pl:list pol) : pol :=
(maxl (map parity pl), snd (pcomp' p pl)).
Lemma parity_pcomp_pow : forall xn pl,
parity (pcomp_pow xn pl) = maxl (map parity pl).
Proof.
(* Goal: forall (xn : pow) (pl : list pol), @eq nat (@fst nat (list mon) (pcomp_pow xn pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
unfold pcomp_pow; intros [x n] pl; simpl.
(* Goal: @eq nat (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
case_eq (ppower (nth x pl (pcst 0 0)) n); trivial.
Qed.
Lemma map_parity_pcomp_pow xl pl :
map (fun xn => parity (pcomp_pow xn pl)) xl = map (fun _ => maxl (map parity pl)) xl.
Proof.
(* Goal: @eq (list nat) (@map pow nat (fun xn : pow => @fst nat (list mon) (pcomp_pow xn pl)) xl) (@map pow nat (fun _ : pow => maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) xl) *)
destruct xl; simpl; trivial.
Qed.
Lemma parity_pcomp_mon' : forall m pl,
parity (pcomp_mon' m pl) <= maxl (map parity pl).
Proof.
(* Goal: forall (m : mon) (pl : list pol), le (@fst nat (list mon) (pcomp_mon' m pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
intros [a xl] pl; simpl.
(* Goal: le (@fst nat (list mon) (pmultl (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
rewrite parity_pmultl.
(* Goal: le (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
induction xl; simpl.
(* Goal: le (Init.Nat.max (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl)))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
(* Goal: le O (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
omega.
(* Goal: le (Init.Nat.max (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl)))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
apply Nat.max_lub; trivial.
Qed.
Lemma parity_pcomp_mon : forall m pl,
parity (pcomp_mon m pl) = maxl (map parity pl).
Proof.
(* Goal: forall (m : mon) (pl : list pol), @eq nat (@fst nat (list mon) (pcomp_mon m pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
unfold pcomp_mon; intros [a xl] pl; simpl; trivial.
Qed.
Lemma parity_pcomp p pl :
parity (pcomp p pl) = maxl (map parity pl).
Proof.
(* Goal: @eq nat (@fst nat (list mon) (pcomp p pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
unfold pcomp; intros.
(* Goal: @eq nat (@fst nat (list mon) (@pair nat (list mon) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) (@snd nat (list mon) (pcomp' p pl)))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
case (pcomp' p pl); trivial.
Qed.
Lemma pWF_pcomp_pow' : forall xn pl,
andl pWF pl -> pWF (pcomp_pow' xn pl).
Proof.
(* Goal: forall (xn : pow) (pl : list pol) (_ : @andl pol pWF pl), pWF (pcomp_pow' xn pl) *)
intros [x n] pl H; simpl.
(* Goal: pWF (pcomp_pow' (@pair nat nat x n) pl) *)
apply pWF_ppower.
(* Goal: pWF (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O)) *)
apply pWF_nth; trivial.
(* Goal: pWF (pcst O O) *)
apply pWF_pcst.
Qed.
Lemma pWF_pcomp_pow : forall xn pl,
andl pWF pl -> pWF (pcomp_pow xn pl).
Proof.
(* Goal: forall (xn : pow) (pl : list pol) (_ : @andl pol pWF pl), pWF (pcomp_pow xn pl) *)
intros [x n] pl H.
(* Goal: pWF (pcomp_pow (@pair nat nat x n) pl) *)
apply pWF'_le with (ar1 := fst (pcomp_pow' (x, n) pl)).
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: le (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@fst nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
rewrite parity_pcomp_pow.
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: le (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
unfold pcomp_pow'.
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: le (@fst nat (list mon) (ppower (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O)) (@snd nat nat (@pair nat nat x n)))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
rewrite parity_ppower.
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: le (@fst nat (list mon) (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
destruct (le_lt_dec (length pl) x).
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: le (@fst nat (list mon) (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
(* Goal: le (@fst nat (list mon) (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
rewrite nth_overflow; auto with arith.
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: le (@fst nat (list mon) (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
apply in_le_maxl.
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: @In nat (@fst nat (list mon) (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O))) (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl) *)
apply in_map.
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
(* Goal: @In (prod nat (list mon)) (@nth pol (@fst nat nat (@pair nat nat x n)) pl (pcst O O)) pl *)
apply nth_In; trivial.
(* Goal: pWF' (@fst nat (list mon) (pcomp_pow' (@pair nat nat x n) pl)) (@snd nat (list mon) (pcomp_pow (@pair nat nat x n) pl)) *)
apply pWF_pcomp_pow'; trivial.
Qed.
Lemma pWF_pcomp_mon' : forall m pl,
andl pWF pl -> pWF (pcomp_mon' m pl).
Proof.
(* Goal: forall (m : mon) (pl : list pol) (_ : @andl pol pWF pl), pWF (pcomp_mon' m pl) *)
unfold pWF, pWF', pWF_mon, pWF_pow.
(* Goal: forall (m : mon) (pl : list pol) (_ : @andl pol (fun p : pol => @andl mon (fun m0 : mon => @andl pow (fun xn : pow => lt (@fst nat nat xn) (@fst nat (list mon) p)) (@snd nat (list pow) m0)) (@snd nat (list mon) p)) pl), @andl mon (fun m0 : mon => @andl pow (fun xn : pow => lt (@fst nat nat xn) (@fst nat (list mon) (pcomp_mon' m pl))) (@snd nat (list pow) m0)) (@snd nat (list mon) (pcomp_mon' m pl)) *)
intros [a xl] pl H.
(* Goal: @andl mon (fun m : mon => @andl pow (fun xn : pow => lt (@fst nat nat xn) (@fst nat (list mon) (pcomp_mon' (@pair nat (list pow) a xl) pl))) (@snd nat (list pow) m)) (@snd nat (list mon) (pcomp_mon' (@pair nat (list pow) a xl) pl)) *)
induction xl as [ | [x n] xl' IH].
(* Goal: @andl mon (fun m : mon => @andl pow (fun xn : pow => lt (@fst nat nat xn) (@fst nat (list mon) (pcomp_mon' (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl')) pl))) (@snd nat (list pow) m)) (@snd nat (list mon) (pcomp_mon' (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl')) pl)) *)
(* Goal: @andl mon (fun m : mon => @andl pow (fun xn : pow => lt (@fst nat nat xn) (@fst nat (list mon) (pcomp_mon' (@pair nat (list pow) a (@nil pow)) pl))) (@snd nat (list pow) m)) (@snd nat (list mon) (pcomp_mon' (@pair nat (list pow) a (@nil pow)) pl)) *)
simpl; tauto.
(* Goal: @andl mon (fun m : mon => @andl pow (fun xn : pow => lt (@fst nat nat xn) (@fst nat (list mon) (pcomp_mon' (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl')) pl))) (@snd nat (list pow) m)) (@snd nat (list mon) (pcomp_mon' (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl')) pl)) *)
apply pWF_pscalar.
(* Goal: pWF (pmultl (@map pow pol (fun xn : pow => pcomp_pow xn pl) (@snd nat (list pow) (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl'))))) *)
apply pWF_pmultl.
(* Goal: @andl pol pWF (@map pow pol (fun xn : pow => pcomp_pow xn pl) (@snd nat (list pow) (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl')))) *)
clear IH.
(* Goal: @andl pol pWF (@map pow pol (fun xn : pow => pcomp_pow xn pl) (@snd nat (list pow) (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl')))) *)
induction xl'; simpl in *.
(* Goal: and (pWF (pcomp_pow (@pair nat nat x n) pl)) (and (pWF (pcomp_pow a0 pl)) (@andl pol pWF (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl'))) *)
(* Goal: and (pWF (pcomp_pow (@pair nat nat x n) pl)) True *)
split; trivial.
(* Goal: and (pWF (pcomp_pow (@pair nat nat x n) pl)) (and (pWF (pcomp_pow a0 pl)) (@andl pol pWF (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl'))) *)
(* Goal: pWF (pcomp_pow (@pair nat nat x n) pl) *)
apply pWF_pcomp_pow; trivial.
(* Goal: and (pWF (pcomp_pow (@pair nat nat x n) pl)) (and (pWF (pcomp_pow a0 pl)) (@andl pol pWF (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl'))) *)
split;[ tauto | split ].
(* Goal: @andl pol pWF (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl') *)
(* Goal: pWF (pcomp_pow a0 pl) *)
apply pWF_pcomp_pow; trivial.
(* Goal: @andl pol pWF (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl') *)
apply IHxl'.
Qed.
Lemma pWF_pcomp_mon : forall m pl,
andl pWF pl -> pWF (pcomp_mon m pl).
Proof.
(* Goal: forall (m : mon) (pl : list pol) (_ : @andl pol pWF pl), pWF (pcomp_mon m pl) *)
intros [a xl] pl H.
(* Goal: pWF (pcomp_mon (@pair nat (list pow) a xl) pl) *)
apply pWF'_le with (ar1 := fst (pcomp_mon' (a, xl) pl)).
(* Goal: pWF' (@fst nat (list mon) (pcomp_mon' (@pair nat (list pow) a xl) pl)) (@snd nat (list mon) (pcomp_mon (@pair nat (list pow) a xl) pl)) *)
(* Goal: le (@fst nat (list mon) (pcomp_mon' (@pair nat (list pow) a xl) pl)) (@fst nat (list mon) (pcomp_mon (@pair nat (list pow) a xl) pl)) *)
apply parity_pcomp_mon'.
(* Goal: pWF' (@fst nat (list mon) (pcomp_mon' (@pair nat (list pow) a xl) pl)) (@snd nat (list mon) (pcomp_mon (@pair nat (list pow) a xl) pl)) *)
apply pWF_pcomp_mon'; trivial.
Qed.
Lemma pWF_pcomp' : forall p pl,
andl pWF pl -> pWF (pcomp' p pl).
Proof.
(* Goal: forall (p : pol) (pl : list pol) (_ : @andl pol pWF pl), pWF (pcomp' p pl) *)
intros [ar ml] pl H; simpl.
(* Goal: pWF (pcomp' (@pair nat (list mon) ar ml) pl) *)
apply pWF_pplusl.
(* Goal: @andl pol pWF (@map mon pol (fun m : mon => pcomp_mon m pl) (@snd nat (list mon) (@pair nat (list mon) ar ml))) *)
induction ml; simpl in *; trivial.
(* Goal: and (pWF (pcomp_mon a pl)) (@andl pol pWF (@map mon pol (fun m : mon => pcomp_mon m pl) ml)) *)
split; trivial.
(* Goal: pWF (pcomp_mon a pl) *)
apply pWF_pcomp_mon; trivial.
Qed.
Lemma pWF_pcomp : forall p pl,
andl pWF pl -> pWF (pcomp p pl).
Proof.
(* Goal: forall (p : pol) (pl : list pol) (_ : @andl pol pWF pl), pWF (pcomp p pl) *)
intros [ar ml] pl H.
(* Goal: pWF (pcomp (@pair nat (list mon) ar ml) pl) *)
apply pWF'_le with (ar1 := fst (pcomp' (ar, ml) pl)).
(* Goal: pWF' (@fst nat (list mon) (pcomp' (@pair nat (list mon) ar ml) pl)) (@snd nat (list mon) (pcomp (@pair nat (list mon) ar ml) pl)) *)
(* Goal: le (@fst nat (list mon) (pcomp' (@pair nat (list mon) ar ml) pl)) (@fst nat (list mon) (pcomp (@pair nat (list mon) ar ml) pl)) *)
rewrite parity_pcomp; unfold pcomp'.
(* Goal: pWF' (@fst nat (list mon) (pcomp' (@pair nat (list mon) ar ml) pl)) (@snd nat (list mon) (pcomp (@pair nat (list mon) ar ml) pl)) *)
(* Goal: le (@fst nat (list mon) (pplusl (@map mon pol (fun m : mon => pcomp_mon m pl) (@snd nat (list mon) (@pair nat (list mon) ar ml))))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
rewrite parity_pplusl, map_map.
(* Goal: pWF' (@fst nat (list mon) (pcomp' (@pair nat (list mon) ar ml) pl)) (@snd nat (list mon) (pcomp (@pair nat (list mon) ar ml) pl)) *)
(* Goal: le (maxl (@map mon nat (fun x : mon => @fst nat (list mon) (pcomp_mon x pl)) (@snd nat (list mon) (@pair nat (list mon) ar ml)))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
induction ml; simpl.
(* Goal: pWF' (@fst nat (list mon) (pcomp' (@pair nat (list mon) ar ml) pl)) (@snd nat (list mon) (pcomp (@pair nat (list mon) ar ml) pl)) *)
(* Goal: le (Init.Nat.max (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) (maxl (@map mon nat (fun _ : mon => maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) ml))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
(* Goal: le O (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
omega.
(* Goal: pWF' (@fst nat (list mon) (pcomp' (@pair nat (list mon) ar ml) pl)) (@snd nat (list mon) (pcomp (@pair nat (list mon) ar ml) pl)) *)
(* Goal: le (Init.Nat.max (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) (maxl (@map mon nat (fun _ : mon => maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) ml))) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) *)
apply Nat.max_lub; trivial.
(* Goal: pWF' (@fst nat (list mon) (pcomp' (@pair nat (list mon) ar ml) pl)) (@snd nat (list mon) (pcomp (@pair nat (list mon) ar ml) pl)) *)
apply pWF_pcomp'; trivial.
Qed.
Lemma pcomp_pow'_correct : forall xn pl l,
peval (pcomp_pow' xn pl) l =
power (peval (nth (fst xn) pl (pcst 0 0)) l) (snd xn).
Proof.
(* Goal: forall (xn : pow) (pl : list pol) (l : list nat), @eq nat (peval (pcomp_pow' xn pl) l) (power (peval (@nth pol (@fst nat nat xn) pl (pcst O O)) l) (@snd nat nat xn)) *)
intros [x n] pl l; simpl; apply ppower_correct.
Qed.
Lemma pcomp_pow_correct xn pl l :
peval (pcomp_pow xn pl) l =
power (peval (nth (fst xn) pl (pcst 0 0)) l) (snd xn).
Proof.
(* Goal: @eq nat (peval (pcomp_pow xn pl) l) (power (peval (@nth pol (@fst nat nat xn) pl (pcst O O)) l) (@snd nat nat xn)) *)
intros; unfold pcomp_pow; apply pcomp_pow'_correct.
Qed.
Lemma pcomp_mon'_correct : forall m pl l,
peval (pcomp_mon' m pl) l = peval_mon m (map (fun p => peval p l) pl).
Proof.
(* Goal: forall (m : mon) (pl : list pol) (l : list nat), @eq nat (peval (pcomp_mon' m pl) l) (peval_mon m (@map pol nat (fun p : pol => peval p l) pl)) *)
intros [a xl] pl l; induction xl.
(* Goal: @eq nat (peval (pcomp_mon' (@pair nat (list pow) a (@cons pow a0 xl)) pl) l) (peval_mon (@pair nat (list pow) a (@cons pow a0 xl)) (@map pol nat (fun p : pol => peval p l) pl)) *)
(* Goal: @eq nat (peval (pcomp_mon' (@pair nat (list pow) a (@nil pow)) pl) l) (peval_mon (@pair nat (list pow) a (@nil pow)) (@map pol nat (fun p : pol => peval p l) pl)) *)
unfold peval, peval_mon.
(* Goal: @eq nat (peval (pcomp_mon' (@pair nat (list pow) a (@cons pow a0 xl)) pl) l) (peval_mon (@pair nat (list pow) a (@cons pow a0 xl)) (@map pol nat (fun p : pol => peval p l) pl)) *)
(* Goal: @eq nat (plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x : pow => peval_pow x l) (@snd nat (list pow) m)))) (@snd nat (list mon) (pcomp_mon' (@pair nat (list pow) a (@nil pow)) pl)))) (Init.Nat.mul (@fst nat (list pow) (@pair nat (list pow) a (@nil pow))) (multl (@map pow nat (fun x : pow => peval_pow x (@map pol nat (fun p : pol => plusl (@map mon nat (fun m : mon => Init.Nat.mul (@fst nat (list pow) m) (multl (@map pow nat (fun x0 : pow => peval_pow x0 l) (@snd nat (list pow) m)))) (@snd nat (list mon) p))) pl)) (@snd nat (list pow) (@pair nat (list pow) a (@nil pow)))))) *)
simpl; ring.
(* Goal: @eq nat (peval (pcomp_mon' (@pair nat (list pow) a (@cons pow a0 xl)) pl) l) (peval_mon (@pair nat (list pow) a (@cons pow a0 xl)) (@map pol nat (fun p : pol => peval p l) pl)) *)
unfold pcomp_mon' in *; simpl in *.
(* Goal: @eq nat (peval (pscalar a (pmult (pcomp_pow a0 pl) (pmultl (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl)))) l) (peval_mon (@pair nat (list pow) a (@cons pow a0 xl)) (@map pol nat (fun p : pol => peval p l) pl)) *)
rewrite pscalar_correct, pmult_correct, pmultl_correct in *.
(* Goal: @eq nat (Init.Nat.mul a (Init.Nat.mul (peval (pcomp_pow a0 pl) l) (multl (@map pol nat (fun p : pol => peval p l) (@map pow pol (fun xn : pow => pcomp_pow xn pl) xl))))) (peval_mon (@pair nat (list pow) a (@cons pow a0 xl)) (@map pol nat (fun p : pol => peval p l) pl)) *)
rewrite mult_assoc, (mult_comm a), <- mult_assoc, IHxl, pcomp_pow_correct, peval_nth.
(* Goal: @eq nat (Nat.mul (power (@nth nat (@fst nat nat a0) (@map pol nat (fun p : pol => peval p l) pl) (peval (pcst O O) l)) (@snd nat nat a0)) (peval_mon (@pair nat (list pow) a xl) (@map pol nat (fun p : pol => peval p l) pl))) (peval_mon (@pair nat (list pow) a (@cons pow a0 xl)) (@map pol nat (fun p : pol => peval p l) pl)) *)
destruct a0 as [x n].
(* Goal: @eq nat (Nat.mul (power (@nth nat (@fst nat nat (@pair nat nat x n)) (@map pol nat (fun p : pol => peval p l) pl) (peval (pcst O O) l)) (@snd nat nat (@pair nat nat x n))) (peval_mon (@pair nat (list pow) a xl) (@map pol nat (fun p : pol => peval p l) pl))) (peval_mon (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl)) (@map pol nat (fun p : pol => peval p l) pl)) *)
unfold peval_mon, peval_pow.
(* Goal: @eq nat (Nat.mul (power (@nth nat (@fst nat nat (@pair nat nat x n)) (@map pol nat (fun p : pol => peval p l) pl) (peval (pcst O O) l)) (@snd nat nat (@pair nat nat x n))) (Init.Nat.mul (@fst nat (list pow) (@pair nat (list pow) a xl)) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@map pol nat (fun p : pol => peval p l) pl) O) (@snd nat nat x)) (@snd nat (list pow) (@pair nat (list pow) a xl)))))) (Init.Nat.mul (@fst nat (list pow) (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl))) (multl (@map pow nat (fun x : pow => power (@nth nat (@fst nat nat x) (@map pol nat (fun p : pol => peval p l) pl) O) (@snd nat nat x)) (@snd nat (list pow) (@pair nat (list pow) a (@cons pow (@pair nat nat x n) xl)))))) *)
rewrite pcst_correct; simpl; ring.
Qed.
Lemma pcomp_mon_correct : forall m pl l,
peval (pcomp_mon m pl) l = peval_mon m (map (fun p => peval p l) pl).
Proof.
(* Goal: forall (m : mon) (pl : list pol) (l : list nat), @eq nat (peval (pcomp_mon m pl) l) (peval_mon m (@map pol nat (fun p : pol => peval p l) pl)) *)
intros [a xl] pl l; unfold pcomp_mon.
(* Goal: @eq nat (peval (@pair nat (list mon) (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) pl)) (@snd nat (list mon) (pcomp_mon' (@pair nat (list pow) a xl) pl))) l) (peval_mon (@pair nat (list pow) a xl) (@map pol nat (fun p : pol => peval p l) pl)) *)
rewrite peval_parity.
(* Goal: @eq nat (peval (pcomp_mon' (@pair nat (list pow) a xl) pl) l) (peval_mon (@pair nat (list pow) a xl) (@map pol nat (fun p : pol => peval p l) pl)) *)
apply pcomp_mon'_correct.
Qed.
Lemma pcomp'_correct : forall p pl l,
peval (pcomp' p pl) l = peval p (map (fun p' => peval p' l) pl).
Proof.
(* Goal: forall (p : pol) (pl : list pol) (l : list nat), @eq nat (peval (pcomp' p pl) l) (peval p (@map pol nat (fun p' : pol => peval p' l) pl)) *)
unfold pcomp'; intros [ar ml] pl l.
(* Goal: @eq nat (peval (pplusl (@map mon pol (fun m : mon => pcomp_mon m pl) (@snd nat (list mon) (@pair nat (list mon) ar ml)))) l) (peval (@pair nat (list mon) ar ml) (@map pol nat (fun p' : pol => peval p' l) pl)) *)
induction ml; simpl in *; trivial.
(* Goal: @eq nat (peval (pplus (pcomp_mon a pl) (pplusl (@map mon pol (fun m : mon => pcomp_mon m pl) ml))) l) (peval (@pair nat (list mon) ar (@cons mon a ml)) (@map pol nat (fun p' : pol => peval p' l) pl)) *)
rewrite pplus_correct, pcomp_mon_correct, IHml; trivial.
Qed.
Lemma pcomp_correct p pl l :
peval (pcomp p pl) l = peval p (map (fun p => peval p l) pl).
Proof.
(* Goal: @eq nat (peval (pcomp p pl) l) (peval p (@map pol nat (fun p : pol => peval p l) pl)) *)
intros; unfold pcomp; rewrite peval_parity.
(* Goal: @eq nat (peval (pcomp' p pl) l) (peval p (@map pol nat (fun p : pol => peval p l) pl)) *)
apply pcomp'_correct.
Qed.
Definition pshift_pow (xn:pow) : pow :=
(S (fst xn), snd xn).
Definition pshift_mon (m:mon) : mon :=
(fst m, map pshift_pow (snd m)).
Definition pshift (p:pol) : pol :=
(S (fst p), map pshift_mon (snd p)).
Lemma parity_pshift : forall p,
parity (pshift p) = S (parity p).
Proof.
(* Goal: forall p : pol, @eq nat (@fst nat (list mon) (pshift p)) (S (@fst nat (list mon) p)) *)
intros [ar ml]; trivial.
Qed.
Lemma pWF_pshift_mon : forall ar m,
pWF_mon ar m -> pWF_mon (S ar) (pshift_mon m).
Proof.
(* Goal: forall (ar : nat) (m : mon) (_ : pWF_mon ar m), pWF_mon (S ar) (pshift_mon m) *)
unfold pWF_mon, pWF_pow.
(* Goal: forall (ar : nat) (m : mon) (_ : @andl pow (fun xn : pow => lt (@fst nat nat xn) ar) (@snd nat (list pow) m)), @andl pow (fun xn : pow => lt (@fst nat nat xn) (S ar)) (@snd nat (list pow) (pshift_mon m)) *)
intros ar [a xl] H; simpl.
(* Goal: @andl pow (fun xn : pow => lt (@fst nat nat xn) (S ar)) (@map pow pow pshift_pow xl) *)
induction xl as [ | [x n] xl' IH]; simpl in *; trivial.
(* Goal: and (lt (S x) (S ar)) (@andl pow (fun xn : pow => lt (@fst nat nat xn) (S ar)) (@map pow pow pshift_pow xl')) *)
split; [ omega | tauto ].
Qed.
Lemma pWF_pshift : forall p, pWF p -> pWF (pshift p).
Proof.
(* Goal: forall (p : pol) (_ : pWF p), pWF (pshift p) *)
unfold pWF; intros [ar ml] H; simpl.
(* Goal: pWF' (S ar) (@map mon mon pshift_mon ml) *)
induction ml; simpl in *; trivial.
(* Goal: and (pWF_mon (S ar) (pshift_mon a)) (pWF' (S ar) (@map mon mon pshift_mon ml)) *)
split;[ | tauto].
(* Goal: pWF_mon (S ar) (pshift_mon a) *)
apply pWF_pshift_mon; tauto.
Qed.
Lemma pshift_pow_correct : forall xn l,
peval_pow (pshift_pow xn) l = peval_pow xn (tl l).
Proof.
(* Goal: forall (xn : pow) (l : list nat), @eq nat (peval_pow (pshift_pow xn) l) (peval_pow xn (@tl nat l)) *)
unfold peval_pow; intros [x n] l; simpl; f_equal.
(* Goal: @eq nat (@nth nat (S x) l O) (@nth nat x (@tl nat l) O) *)
rewrite nth_S_tl; trivial.
Qed.
Lemma pshift_mon_correct : forall m l,
peval_mon (pshift_mon m) l = peval_mon m (tl l).
Proof.
(* Goal: forall (m : mon) (l : list nat), @eq nat (peval_mon (pshift_mon m) l) (peval_mon m (@tl nat l)) *)
unfold peval_mon; intros [a xl] l.
(* Goal: @eq nat (Init.Nat.mul (@fst nat (list pow) (pshift_mon (@pair nat (list pow) a xl))) (multl (@map pow nat (fun x : pow => peval_pow x l) (@snd nat (list pow) (pshift_mon (@pair nat (list pow) a xl)))))) (Init.Nat.mul (@fst nat (list pow) (@pair nat (list pow) a xl)) (multl (@map pow nat (fun x : pow => peval_pow x (@tl nat l)) (@snd nat (list pow) (@pair nat (list pow) a xl))))) *)
induction xl; simpl in * ;trivial.
(* Goal: @eq nat (Init.Nat.mul a (Init.Nat.mul (peval_pow (pshift_pow a0) l) (multl (@map pow nat (fun x : pow => peval_pow x l) (@map pow pow pshift_pow xl))))) (Init.Nat.mul a (Init.Nat.mul (peval_pow a0 (@tl nat l)) (multl (@map pow nat (fun x : pow => peval_pow x (@tl nat l)) xl)))) *)
rewrite mult_assoc, (mult_comm a), <- mult_assoc, pshift_pow_correct, IHxl; ring.
Qed.
Lemma pshift_correct : forall p l,
peval (pshift p) l = peval p (tl l).
Proof.
(* Goal: forall (p : pol) (l : list nat), @eq nat (peval (pshift p) l) (peval p (@tl nat l)) *)
unfold peval; intros [ar ml] l.
(* Goal: @eq nat (plusl (@map mon nat (fun m : mon => peval_mon m l) (@snd nat (list mon) (pshift (@pair nat (list mon) ar ml))))) (plusl (@map mon nat (fun m : mon => peval_mon m (@tl nat l)) (@snd nat (list mon) (@pair nat (list mon) ar ml)))) *)
induction ml; simpl in *; trivial.
(* Goal: @eq nat (Init.Nat.add (peval_mon (pshift_mon a) l) (plusl (@map mon nat (fun m : mon => peval_mon m l) (@map mon mon pshift_mon ml)))) (Init.Nat.add (peval_mon a (@tl nat l)) (plusl (@map mon nat (fun m : mon => peval_mon m (@tl nat l)) ml))) *)
rewrite pshift_mon_correct, IHml; trivial.
Qed.
Definition psum (start len : nat) : pol :=
pplus (pcst (start+len) 0) (pplusl (map (pproj (start+len)) (seq start len))).
Lemma psum_correct start len l :
peval (psum start len) l =
plusl (map (fun i => nth i l 0) (seq start len)).
Proof.
(* Goal: @eq nat (peval (psum start len) l) (plusl (@map nat nat (fun i : nat => @nth nat i l O) (seq start len))) *)
intros; unfold psum.
(* Goal: @eq nat (peval (pplus (pcst (Init.Nat.add start len) O) (pplusl (@map nat pol (pproj (Init.Nat.add start len)) (seq start len)))) l) (plusl (@map nat nat (fun i : nat => @nth nat i l O) (seq start len))) *)
rewrite pplus_correct, pcst_correct, pplusl_correct; simpl; f_equal.
(* Goal: @eq (list nat) (@map pol nat (fun p : pol => peval p l) (@map nat pol (pproj (Init.Nat.add start len)) (seq start len))) (@map nat nat (fun i : nat => @nth nat i l O) (seq start len)) *)
induction (seq start len); simpl; intros; trivial.
(* Goal: @eq (list nat) (@cons nat (peval (pproj (Init.Nat.add start len) a) l) (@map pol nat (fun p : pol => peval p l) (@map nat pol (pproj (Init.Nat.add start len)) l0))) (@cons nat (@nth nat a l O) (@map nat nat (fun i : nat => @nth nat i l O) l0)) *)
rewrite pproj_correct; congruence.
Qed.
Lemma pWF_psum start len : pWF (psum start len).
Proof.
(* Goal: pWF (psum start len) *)
intros;unfold psum.
(* Goal: pWF (pplus (pcst (Init.Nat.add start len) O) (pplusl (@map nat pol (pproj (Init.Nat.add start len)) (seq start len)))) *)
apply pWF_pplus.
(* Goal: pWF (pplusl (@map nat pol (pproj (Init.Nat.add start len)) (seq start len))) *)
(* Goal: pWF (pcst (Init.Nat.add start len) O) *)
apply pWF_pcst.
(* Goal: pWF (pplusl (@map nat pol (pproj (Init.Nat.add start len)) (seq start len))) *)
apply pWF_pplusl.
(* Goal: @andl pol pWF (@map nat pol (pproj (Init.Nat.add start len)) (seq start len)) *)
rewrite <- forall_andl; intros.
(* Goal: pWF x *)
rewrite in_map_iff in H.
(* Goal: pWF x *)
destruct H as (y & H1 & H2); subst.
(* Goal: pWF (pproj (Init.Nat.add start len) y) *)
apply pWF_pproj.
(* Goal: lt y (Init.Nat.add start len) *)
rewrite in_seq_iff in H2.
(* Goal: lt y (Init.Nat.add start len) *)
tauto.
Qed.
Lemma parity_psum start len :
parity (psum start len) = start + len.
Proof.
(* Goal: @eq nat (@fst nat (list mon) (psum start len)) (Init.Nat.add start len) *)
intros; unfold psum.
(* Goal: @eq nat (@fst nat (list mon) (pplus (pcst (Init.Nat.add start len) O) (pplusl (@map nat pol (pproj (Init.Nat.add start len)) (seq start len))))) (Init.Nat.add start len) *)
rewrite parity_pplus, parity_pcst, parity_pplusl, max_l; trivial.
(* Goal: le (maxl (@map (prod nat (list mon)) nat (@fst nat (list mon)) (@map nat pol (pproj (Init.Nat.add start len)) (seq start len)))) (Init.Nat.add start len) *)
apply maxl_map.
(* Goal: forall (x : prod nat (list mon)) (_ : @In (prod nat (list mon)) x (@map nat pol (pproj (Init.Nat.add start len)) (seq start len))), @eq nat (@fst nat (list mon) x) (Init.Nat.add start len) *)
intros p H.
(* Goal: @eq nat (@fst nat (list mon) p) (Init.Nat.add start len) *)
rewrite in_map_iff in H.
(* Goal: @eq nat (@fst nat (list mon) p) (Init.Nat.add start len) *)
destruct H as (x & H & _).
(* Goal: @eq nat (@fst nat (list mon) p) (Init.Nat.add start len) *)
subst; trivial.
Qed.
Ltac pWF :=
match goal with
| |- pWF (pcst _ _) => apply pWF_pcst
| |- pWF (pproj _ _) => apply pWF_pproj; try omega
| |- pWF (pscalar _ _) => apply pWF_pscalar; pWF
| |- pWF (pplus _ _) => apply pWF_pplus; pWF
| |- pWF (pplusl _) => apply pWF_pplusl; rewrite <- forall_andl; intros; pWF
| |- pWF (pmult _ _) => apply pWF_pmult; pWF
| |- pWF (pmultl _) => apply pWF_pmultl; rewrite <- forall_andl; intros; pWF
| |- pWF (ppower _ _) => apply pWF_ppower; pWF
| |- pWF (pcomp _ _) => apply pWF_pcomp; rewrite <- forall_andl; intros; pWF
| |- pWF (pshift _) => apply pWF_pshift; pWF
| |- pWF (psum _ _) => apply pWF_psum
| |- _ => idtac
end.
Definition deg_mon (m:mon) : nat :=
plusl (map (@snd _ _) (snd m)).
Definition deg (p:pol) : nat :=
maxl (map deg_mon (snd p)).
|
Require Import List.
Import ListNotations.
Require Import StructTact.StructTactics.
Require Import StructTact.ListTactics.
Require Import StructTact.ListUtil.
Require Import StructTact.RemoveAll.
Require Import StructTact.PropUtil.
Require Import FunctionalExtensionality.
Require Import Sumbool.
Require Import Sorting.Permutation.
Require Import Relation_Definitions.
Require Import RelationClasses.
Definition update2 {A B : Type} (A_eq_dec : forall x y : A, {x = y} + {x <> y}) (f : A -> A -> B) (x y : A) (v : B) :=
fun x' y' => if sumbool_and _ _ _ _ (A_eq_dec x x') (A_eq_dec y y') then v else f x' y'.
Fixpoint collate {A B : Type} (A_eq_dec : forall x y : A, {x = y} + {x <> y}) (from : A) (f : A -> A -> list B) (ms : list (A * B)) :=
match ms with
| [] => f
| (to, m) :: ms' => collate A_eq_dec from (update2 A_eq_dec f from to (f from to ++ [m])) ms'
end.
Fixpoint collate_ls {A B : Type} (A_eq_dec : forall x y : A, {x = y} + {x <> y}) (s : list A) (f : A -> A -> list B) (to : A) (m : B) :=
match s with
| [] => f
| from :: s' => collate_ls A_eq_dec s' (update2 A_eq_dec f from to (f from to ++ [m])) to m
end.
Fixpoint filter_rel {A : Type} {rel : relation A} (A_rel_dec : forall x y : A, {rel x y} + {~ rel x y}) (x : A) (l : list A) :=
match l with
| [] => []
| y :: tl => if A_rel_dec x y then y :: filter_rel A_rel_dec x tl else filter_rel A_rel_dec x tl
end.
Definition map2fst {A B : Type} (a : A) := map (fun (b : B) => (a, b)).
Definition map2snd {A B : Type} (b : B) := map (fun (a : A) => (a, b)).
Section Update2.
Variables A B : Type.
Hypothesis A_eq_dec : forall x y : A, {x = y} + {x <> y}.
Lemma update2_diff1 :
forall (sigma : A -> A -> B) x y v x' y',
x <> x' ->
update2 A_eq_dec sigma x y v x' y' = sigma x' y'.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B) (x' y' : A) (_ : not (@eq A x x')), @eq B (@update2 A B A_eq_dec sigma x y v x' y') (sigma x' y') *)
unfold update2.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B) (x' y' : A) (_ : not (@eq A x x')), @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then v else sigma x' y') (sigma x' y') *)
intros.
(* Goal: @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then v else sigma x' y') (sigma x' y') *)
break_if; intuition congruence.
Qed.
Lemma update2_diff2 :
forall (sigma : A -> A -> B) x y v x' y',
y <> y' ->
update2 A_eq_dec sigma x y v x' y' = sigma x' y'.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B) (x' y' : A) (_ : not (@eq A y y')), @eq B (@update2 A B A_eq_dec sigma x y v x' y') (sigma x' y') *)
unfold update2.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B) (x' y' : A) (_ : not (@eq A y y')), @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then v else sigma x' y') (sigma x' y') *)
intros.
(* Goal: @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then v else sigma x' y') (sigma x' y') *)
break_if; intuition congruence.
Qed.
Lemma update2_diff_prod :
forall (sigma : A -> A -> B) x y v x' y',
(x, y) <> (x', y') ->
update2 A_eq_dec sigma x y v x' y' = sigma x' y'.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B) (x' y' : A) (_ : not (@eq (prod A A) (@pair A A x y) (@pair A A x' y'))), @eq B (@update2 A B A_eq_dec sigma x y v x' y') (sigma x' y') *)
unfold update2.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B) (x' y' : A) (_ : not (@eq (prod A A) (@pair A A x y) (@pair A A x' y'))), @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then v else sigma x' y') (sigma x' y') *)
intros.
(* Goal: @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then v else sigma x' y') (sigma x' y') *)
break_if; intuition congruence.
Qed.
Lemma update2_nop :
forall (sigma : A -> A -> B) x y x' y',
update2 A_eq_dec sigma x y (sigma x y) x' y' = sigma x' y'.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y x' y' : A), @eq B (@update2 A B A_eq_dec sigma x y (sigma x y) x' y') (sigma x' y') *)
unfold update2.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y x' y' : A), @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then sigma x y else sigma x' y') (sigma x' y') *)
intros.
(* Goal: @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then sigma x y else sigma x' y') (sigma x' y') *)
break_if; intuition congruence.
Qed.
Lemma update2_eq :
forall (sigma : A -> A -> B) x y x' y' v,
x = x' ->
y = y' ->
update2 A_eq_dec sigma x y v x' y' = v.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y x' y' : A) (v : B) (_ : @eq A x x') (_ : @eq A y y'), @eq B (@update2 A B A_eq_dec sigma x y v x' y') v *)
intros.
(* Goal: @eq B (@update2 A B A_eq_dec sigma x y v x' y') v *)
subst.
(* Goal: @eq B (@update2 A B A_eq_dec sigma x' y' v x' y') v *)
unfold update2.
(* Goal: @eq B (if sumbool_and (@eq A x' x') (not (@eq A x' x')) (@eq A y' y') (not (@eq A y' y')) (A_eq_dec x' x') (A_eq_dec y' y') then v else sigma x' y') v *)
break_if; intuition congruence.
Qed.
Lemma update2_eq_prod :
forall (sigma : A -> A -> B) x y x' y' v,
(x, y) = (x', y') ->
update2 A_eq_dec sigma x y v x' y' = v.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y x' y' : A) (v : B) (_ : @eq (prod A A) (@pair A A x y) (@pair A A x' y')), @eq B (@update2 A B A_eq_dec sigma x y v x' y') v *)
intros.
(* Goal: @eq B (@update2 A B A_eq_dec sigma x y v x' y') v *)
subst.
(* Goal: @eq B (@update2 A B A_eq_dec sigma x y v x' y') v *)
unfold update2.
(* Goal: @eq B (if sumbool_and (@eq A x x') (not (@eq A x x')) (@eq A y y') (not (@eq A y y')) (A_eq_dec x x') (A_eq_dec y y') then v else sigma x' y') v *)
break_if; intuition congruence.
Qed.
Lemma update2_same :
forall (sigma : A -> A -> B) x y v,
update2 A_eq_dec sigma x y v x y = v.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B), @eq B (@update2 A B A_eq_dec sigma x y v x y) v *)
intros.
(* Goal: @eq B (@update2 A B A_eq_dec sigma x y v x y) v *)
rewrite update2_eq; auto.
Qed.
Lemma update2_nop_ext :
forall (sigma : A -> A -> B) x y,
update2 A_eq_dec sigma x y (sigma x y) = sigma.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A), @eq (forall (_ : A) (_ : A), B) (@update2 A B A_eq_dec sigma x y (sigma x y)) sigma *)
intros.
(* Goal: @eq (forall (_ : A) (_ : A), B) (@update2 A B A_eq_dec sigma x y (sigma x y)) sigma *)
do 2 (apply functional_extensionality; intros).
(* Goal: @eq B (@update2 A B A_eq_dec sigma x y (sigma x y) x0 x1) (sigma x0 x1) *)
apply update2_nop.
Qed.
Lemma update2_nop_ext' :
forall (sigma : A -> A -> B) x y v,
sigma x y = v ->
update2 A_eq_dec sigma x y v = sigma.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (v : B) (_ : @eq B (sigma x y) v), @eq (forall (_ : A) (_ : A), B) (@update2 A B A_eq_dec sigma x y v) sigma *)
intros.
(* Goal: @eq (forall (_ : A) (_ : A), B) (@update2 A B A_eq_dec sigma x y v) sigma *)
subst.
(* Goal: @eq (forall (_ : A) (_ : A), B) (@update2 A B A_eq_dec sigma x y (sigma x y)) sigma *)
apply update2_nop_ext.
Qed.
Lemma update2_overwrite :
forall (sigma : A -> A -> B) x y st st',
update2 A_eq_dec (update2 A_eq_dec sigma x y st) x y st' = update2 A_eq_dec sigma x y st'.
Proof.
(* Goal: forall (sigma : forall (_ : A) (_ : A), B) (x y : A) (st st' : B), @eq (forall (_ : A) (_ : A), B) (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st') (@update2 A B A_eq_dec sigma x y st') *)
intros.
(* Goal: @eq (forall (_ : A) (_ : A), B) (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st') (@update2 A B A_eq_dec sigma x y st') *)
do 2 (apply functional_extensionality; intros).
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
destruct (A_eq_dec x x0); destruct (A_eq_dec y x1).
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
-
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
repeat rewrite update2_eq; auto.
(* BG Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
(* BG Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
(* BG Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
-
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
repeat rewrite update2_diff2; auto.
(* BG Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
(* BG Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
-
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
repeat rewrite update2_diff1; auto.
(* BG Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
-
(* Goal: @eq B (@update2 A B A_eq_dec (@update2 A B A_eq_dec sigma x y st) x y st' x0 x1) (@update2 A B A_eq_dec sigma x y st' x0 x1) *)
repeat rewrite update2_diff1; auto.
Qed.
End Update2.
Lemma update2_fun_comm :
forall A B C A_eq_dec (f : B -> C) (st : A -> A -> B) x y v x' y',
f (update2 A_eq_dec st x y v x' y') = update2 A_eq_dec (fun x y => f (st x y)) x y (f v) x' y'.
Proof.
(* Goal: forall (A B C : Type) (A_eq_dec : forall x y : A, sumbool (@eq A x y) (not (@eq A x y))) (f : forall _ : B, C) (st : forall (_ : A) (_ : A), B) (x y : A) (v : B) (x' y' : A), @eq C (f (@update2 A B A_eq_dec st x y v x' y')) (@update2 A C A_eq_dec (fun x0 y0 : A => f (st x0 y0)) x y (f v) x' y') *)
intros.
(* Goal: @eq C (f (@update2 A B A_eq_dec st x y v x' y')) (@update2 A C A_eq_dec (fun x y : A => f (st x y)) x y (f v) x' y') *)
destruct (prod_eq_dec A_eq_dec A_eq_dec (x, y) (x', y')); subst; repeat first [rewrite update2_diff_prod by congruence | rewrite update2_eq_prod by auto ]; auto.
Qed.
Ltac update2_destruct_goal :=
match goal with
| [ |- context [ update2 ?eq_dec _ ?x ?y _ ?x' ?y' ] ] =>
destruct (prod_eq_dec eq_dec eq_dec (x, y) (x', y'))
end.
Ltac update2_destruct_hyp :=
match goal with
| [ _ : context [ update2 ?eq_dec _ ?x ?y _ ?x' ?y' ] |- _ ] =>
destruct (prod_eq_dec eq_dec eq_dec (x, y) (x', y'))
end.
Ltac update2_destruct := update2_destruct_goal || update2_destruct_hyp.
Ltac rewrite_update2' H :=
first [rewrite update2_diff_prod in H by congruence |
rewrite update2_eq_prod in H by auto ].
Ltac rewrite_update2 :=
repeat match goal with
| [ H : context [ update2 _ _ _ _ _ _ _ ] |- _ ] =>
rewrite_update2' H; repeat rewrite_update2' H
| [ |- _ ] => repeat (try rewrite update2_diff_prod by congruence;
try rewrite update2_eq_prod by auto)
end.
Ltac destruct_update2 :=
repeat (update2_destruct; subst; rewrite_update2).
Ltac destruct_update2_hyp :=
repeat ((update2_destruct_hyp || update2_destruct_goal); subst; rewrite_update2).
Ltac update2_destruct_simplify :=
update2_destruct; subst; rewrite_update2; simpl in *.
Ltac update2_destruct_simplify_hyp :=
update2_destruct_hyp || update2_destruct_goal; subst; rewrite_update2; simpl in *.
Ltac update2_destruct_max_simplify :=
update2_destruct; subst_max; rewrite_update2; simpl in *.
Section Update2Rel.
Variables A B : Type.
Variable R : relation A.
Hypothesis A_eq_dec : forall x y : A, {x = y} + {x <> y}.
Hypothesis R_dec : forall x y : A, {R x y} + {~ R x y}.
Lemma filter_rel_related :
forall n n' ns,
In n' (filter_rel R_dec n ns) ->
In n' ns /\ R n n'.
Proof.
(* Goal: forall (n n' : A) (ns : list A) (_ : @In A n' (@filter_rel A R R_dec n ns)), and (@In A n' ns) (R n n') *)
intros.
(* Goal: and (@In A n' ns) (R n n') *)
induction ns; simpl in *; [ intuition | idtac ].
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
break_if; simpl in *.
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
-
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
break_or_hyp; auto.
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
concludes.
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
break_and.
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
auto.
(* BG Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
-
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
concludes.
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
break_and.
(* Goal: and (or (@eq A a n') (@In A n' ns)) (R n n') *)
auto.
Qed.
Lemma related_filter_rel :
forall n n' ns,
In n' ns ->
R n n' ->
In n' (filter_rel R_dec n ns).
Proof.
(* Goal: forall (n n' : A) (ns : list A) (_ : @In A n' ns) (_ : R n n'), @In A n' (@filter_rel A R R_dec n ns) *)
intros.
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
induction ns; simpl in *; [ intuition | idtac ].
(* Goal: @In A n' (if R_dec n a then @cons A a (@filter_rel A R R_dec n ns) else @filter_rel A R R_dec n ns) *)
break_if.
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
(* Goal: @In A n' (@cons A a (@filter_rel A R R_dec n ns)) *)
-
(* Goal: @In A n' (@cons A a (@filter_rel A R R_dec n ns)) *)
break_or_hyp.
(* Goal: @In A n' (@cons A a (@filter_rel A R R_dec n ns)) *)
(* Goal: @In A n' (@cons A n' (@filter_rel A R R_dec n ns)) *)
*
(* Goal: @In A n' (@cons A n' (@filter_rel A R R_dec n ns)) *)
left; auto.
(* BG Goal: @In A n' (@filter_rel A R R_dec n ns) *)
(* BG Goal: @In A n' (@cons A a (@filter_rel A R R_dec n ns)) *)
*
(* Goal: @In A n' (@cons A a (@filter_rel A R R_dec n ns)) *)
concludes.
(* Goal: @In A n' (@cons A a (@filter_rel A R R_dec n ns)) *)
right; auto.
(* BG Goal: @In A n' (@filter_rel A R R_dec n ns) *)
-
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
break_or_hyp.
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
*
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
intuition.
(* BG Goal: @In A n' (@filter_rel A R R_dec n ns) *)
*
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
concludes.
(* Goal: @In A n' (@filter_rel A R R_dec n ns) *)
assumption.
Qed.
Lemma not_in_not_in_filter_rel :
forall ns n h,
~ In n ns ->
~ In n (filter_rel R_dec h ns).
Proof.
(* Goal: forall (ns : list A) (n h : A) (_ : not (@In A n ns)), not (@In A n (@filter_rel A R R_dec h ns)) *)
induction ns; intros; auto.
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
assert (H_neq: a <> n).
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
(* Goal: not (@eq A a n) *)
intro.
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
(* Goal: False *)
subst.
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
(* Goal: False *)
auto with datatypes.
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
assert (H_not_in: ~ In n ns).
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
(* Goal: not (@In A n ns) *)
intro.
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
(* Goal: False *)
intuition.
(* Goal: not (@In A n (@filter_rel A R R_dec h (@cons A a ns))) *)
simpl.
(* Goal: not (@In A n (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) *)
break_if; auto.
(* Goal: not (@In A n (@cons A a (@filter_rel A R R_dec h ns))) *)
simpl.
(* Goal: not (or (@eq A a n) (@In A n (@filter_rel A R R_dec h ns))) *)
intro.
(* Goal: False *)
break_or_hyp; auto.
(* Goal: False *)
intuition eauto.
Qed.
Lemma NoDup_filter_rel:
forall h ns,
NoDup ns ->
NoDup (filter_rel R_dec h ns).
Proof.
(* Goal: forall (h : A) (ns : list A) (_ : @NoDup A ns), @NoDup A (@filter_rel A R R_dec h ns) *)
intros.
(* Goal: @NoDup A (@filter_rel A R R_dec h ns) *)
induction ns; auto.
(* Goal: @NoDup A (@filter_rel A R R_dec h (@cons A a ns)) *)
invc_NoDup.
(* Goal: @NoDup A (@filter_rel A R R_dec h (@cons A a ns)) *)
concludes.
(* Goal: @NoDup A (@filter_rel A R R_dec h (@cons A a ns)) *)
simpl in *.
(* Goal: @NoDup A (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) *)
break_if; auto.
(* Goal: @NoDup A (@cons A a (@filter_rel A R R_dec h ns)) *)
apply NoDup_cons; auto.
(* Goal: not (@In A a (@filter_rel A R R_dec h ns)) *)
apply not_in_not_in_filter_rel.
(* Goal: not (@In A a ns) *)
assumption.
Qed.
Lemma filter_rel_self_eq {irreflexive_R : Irreflexive R} :
forall ns0 ns1 h,
filter_rel R_dec h (ns0 ++ h :: ns1) = filter_rel R_dec h (ns0 ++ ns1).
Proof.
(* Goal: forall (ns0 ns1 : list A) (h : A), @eq (list A) (@filter_rel A R R_dec h (@app A ns0 (@cons A h ns1))) (@filter_rel A R R_dec h (@app A ns0 ns1)) *)
induction ns0; intros; simpl in *.
(* Goal: @eq (list A) (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@app A ns0 (@cons A h ns1))) else @filter_rel A R R_dec h (@app A ns0 (@cons A h ns1))) (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@app A ns0 ns1)) else @filter_rel A R R_dec h (@app A ns0 ns1)) *)
(* Goal: @eq (list A) (if R_dec h h then @cons A h (@filter_rel A R R_dec h ns1) else @filter_rel A R R_dec h ns1) (@filter_rel A R R_dec h ns1) *)
-
(* Goal: @eq (list A) (if R_dec h h then @cons A h (@filter_rel A R R_dec h ns1) else @filter_rel A R R_dec h ns1) (@filter_rel A R R_dec h ns1) *)
break_if; auto.
(* Goal: @eq (list A) (@cons A h (@filter_rel A R R_dec h ns1)) (@filter_rel A R R_dec h ns1) *)
find_apply_lem_hyp irreflexive_R.
(* Goal: @eq (list A) (@cons A h (@filter_rel A R R_dec h ns1)) (@filter_rel A R R_dec h ns1) *)
intuition.
(* BG Goal: @eq (list A) (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@app A ns0 (@cons A h ns1))) else @filter_rel A R R_dec h (@app A ns0 (@cons A h ns1))) (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@app A ns0 ns1)) else @filter_rel A R R_dec h (@app A ns0 ns1)) *)
-
(* Goal: @eq (list A) (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@app A ns0 (@cons A h ns1))) else @filter_rel A R R_dec h (@app A ns0 (@cons A h ns1))) (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@app A ns0 ns1)) else @filter_rel A R R_dec h (@app A ns0 ns1)) *)
break_if; auto.
(* Goal: @eq (list A) (@cons A a (@filter_rel A R R_dec h (@app A ns0 (@cons A h ns1)))) (@cons A a (@filter_rel A R R_dec h (@app A ns0 ns1))) *)
find_higher_order_rewrite.
(* Goal: @eq (list A) (@cons A a (@filter_rel A R R_dec h (@app A ns0 ns1))) (@cons A a (@filter_rel A R R_dec h (@app A ns0 ns1))) *)
trivial.
Qed.
Lemma collate_f_eq :
forall (f : A -> A -> list B) g h n n' l,
f n n' = g n n' ->
collate A_eq_dec h f l n n' = collate A_eq_dec h g l n n'.
Proof.
(* Goal: forall (f g : forall (_ : A) (_ : A), list B) (h n n' : A) (l : list (prod A B)) (_ : @eq (list B) (f n n') (g n n')), @eq (list B) (@collate A B A_eq_dec h f l n n') (@collate A B A_eq_dec h g l n n') *)
intros f g h n n' l.
(* Goal: forall _ : @eq (list B) (f n n') (g n n'), @eq (list B) (@collate A B A_eq_dec h f l n n') (@collate A B A_eq_dec h g l n n') *)
generalize f g; clear f g.
(* Goal: forall (f g : forall (_ : A) (_ : A), list B) (_ : @eq (list B) (f n n') (g n n')), @eq (list B) (@collate A B A_eq_dec h f l n n') (@collate A B A_eq_dec h g l n n') *)
induction l; auto.
(* Goal: forall (f g : forall (_ : A) (_ : A), list B) (_ : @eq (list B) (f n n') (g n n')), @eq (list B) (@collate A B A_eq_dec h f (@cons (prod A B) a l) n n') (@collate A B A_eq_dec h g (@cons (prod A B) a l) n n') *)
intros.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@cons (prod A B) a l) n n') (@collate A B A_eq_dec h g (@cons (prod A B) a l) n n') *)
simpl in *.
(* Goal: @eq (list B) ((let (to, m) := a in @collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h to (@app B (f h to) (@cons B m (@nil B)))) l) n n') ((let (to, m) := a in @collate A B A_eq_dec h (@update2 A (list B) A_eq_dec g h to (@app B (g h to) (@cons B m (@nil B)))) l) n n') *)
break_let.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l n n') (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec g h a0 (@app B (g h a0) (@cons B b (@nil B)))) l n n') *)
destruct a.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l n n') (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec g h a0 (@app B (g h a0) (@cons B b (@nil B)))) l n n') *)
find_injection.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l n n') (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec g h a0 (@app B (g h a0) (@cons B b (@nil B)))) l n n') *)
set (f' := update2 _ _ _ _ _).
(* Goal: @eq (list B) (@collate A B A_eq_dec h f' l n n') (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec g h a0 (@app B (g h a0) (@cons B b (@nil B)))) l n n') *)
set (g' := update2 _ _ _ _ _).
(* Goal: @eq (list B) (@collate A B A_eq_dec h f' l n n') (@collate A B A_eq_dec h g' l n n') *)
rewrite (IHl f' g'); auto.
(* Goal: @eq (list B) (f' n n') (g' n n') *)
unfold f', g', update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h n) (not (@eq A h n)) (@eq A a0 n') (not (@eq A a0 n')) (A_eq_dec h n) (A_eq_dec a0 n') then @app B (f h a0) (@cons B b (@nil B)) else f n n') (if sumbool_and (@eq A h n) (not (@eq A h n)) (@eq A a0 n') (not (@eq A a0 n')) (A_eq_dec h n) (A_eq_dec a0 n') then @app B (g h a0) (@cons B b (@nil B)) else g n n') *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h a0) (@cons B b (@nil B))) (@app B (g h a0) (@cons B b (@nil B))) *)
break_and.
(* Goal: @eq (list B) (@app B (f h a0) (@cons B b (@nil B))) (@app B (g h a0) (@cons B b (@nil B))) *)
subst.
(* Goal: @eq (list B) (@app B (f n n') (@cons B b (@nil B))) (@app B (g n n') (@cons B b (@nil B))) *)
find_rewrite.
(* Goal: @eq (list B) (@app B (g n n') (@cons B b (@nil B))) (@app B (g n n') (@cons B b (@nil B))) *)
trivial.
Qed.
Lemma collate_in_in :
forall l h n n' (f : A -> A -> list B) a,
In a (f n' n) ->
In a ((collate A_eq_dec h f l) n' n).
Proof.
(* Goal: forall (l : list (prod A B)) (h n n' : A) (f : forall (_ : A) (_ : A), list B) (a : B) (_ : @In B a (f n' n)), @In B a (@collate A B A_eq_dec h f l n' n) *)
induction l; intros; auto.
(* Goal: @In B a0 (@collate A B A_eq_dec h f (@cons (prod A B) a l) n' n) *)
destruct a.
(* Goal: @In B a0 (@collate A B A_eq_dec h f (@cons (prod A B) (@pair A B a b) l) n' n) *)
apply IHl.
(* Goal: @In B a0 (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B))) n' n) *)
unfold update2.
(* Goal: @In B a0 (if sumbool_and (@eq A h n') (not (@eq A h n')) (@eq A a n) (not (@eq A a n)) (A_eq_dec h n') (A_eq_dec a n) then @app B (f h a) (@cons B b (@nil B)) else f n' n) *)
break_if; auto.
(* Goal: @In B a0 (@app B (f h a) (@cons B b (@nil B))) *)
break_and.
(* Goal: @In B a0 (@app B (f h a) (@cons B b (@nil B))) *)
subst.
(* Goal: @In B a0 (@app B (f n' n) (@cons B b (@nil B))) *)
apply in_or_app.
(* Goal: or (@In B a0 (f n' n)) (@In B a0 (@cons B b (@nil B))) *)
left.
(* Goal: @In B a0 (f n' n) *)
assumption.
Qed.
Lemma collate_head_head :
forall l h n n' (f : A -> A -> list B) a,
head (f n' n) = Some a ->
head ((collate A_eq_dec h f l) n' n) = Some a.
Proof.
(* Goal: forall (l : list (prod A B)) (h n n' : A) (f : forall (_ : A) (_ : A), list B) (a : B) (_ : @eq (option B) (@hd_error B (f n' n)) (@Some B a)), @eq (option B) (@hd_error B (@collate A B A_eq_dec h f l n' n)) (@Some B a) *)
induction l; intros; auto.
(* Goal: @eq (option B) (@hd_error B (@collate A B A_eq_dec h f (@cons (prod A B) a l) n' n)) (@Some B a0) *)
destruct a.
(* Goal: @eq (option B) (@hd_error B (@collate A B A_eq_dec h f (@cons (prod A B) (@pair A B a b) l) n' n)) (@Some B a0) *)
simpl.
(* Goal: @eq (option B) (@hd_error B (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l n' n)) (@Some B a0) *)
apply IHl.
(* Goal: @eq (option B) (@hd_error B (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B))) n' n)) (@Some B a0) *)
unfold update2.
(* Goal: @eq (option B) (@hd_error B (if sumbool_and (@eq A h n') (not (@eq A h n')) (@eq A a n) (not (@eq A a n)) (A_eq_dec h n') (A_eq_dec a n) then @app B (f h a) (@cons B b (@nil B)) else f n' n)) (@Some B a0) *)
break_if; auto.
(* Goal: @eq (option B) (@hd_error B (@app B (f h a) (@cons B b (@nil B)))) (@Some B a0) *)
break_and; subst.
(* Goal: @eq (option B) (@hd_error B (@app B (f n' n) (@cons B b (@nil B)))) (@Some B a0) *)
destruct (f n' n); auto.
(* Goal: @eq (option B) (@hd_error B (@app B (@nil B) (@cons B b (@nil B)))) (@Some B a0) *)
find_apply_lem_hyp hd_error_some_nil.
(* Goal: @eq (option B) (@hd_error B (@app B (@nil B) (@cons B b (@nil B)))) (@Some B a0) *)
intuition.
Qed.
Lemma collate_neq :
forall h n n' ns (f : A -> A -> list B),
h <> n ->
collate A_eq_dec h f ns n n' = f n n'.
Proof.
(* Goal: forall (h n n' : A) (ns : list (prod A B)) (f : forall (_ : A) (_ : A), list B) (_ : not (@eq A h n)), @eq (list B) (@collate A B A_eq_dec h f ns n n') (f n n') *)
intros.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f ns n n') (f n n') *)
revert f.
(* Goal: forall f : forall (_ : A) (_ : A), list B, @eq (list B) (@collate A B A_eq_dec h f ns n n') (f n n') *)
induction ns; intros; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@cons (prod A B) a ns) n n') (f n n') *)
destruct a.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@cons (prod A B) (@pair A B a b) ns) n n') (f n n') *)
simpl in *.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) ns n n') (f n n') *)
rewrite IHns.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B))) n n') (f n n') *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h n) (not (@eq A h n)) (@eq A a n') (not (@eq A a n')) (A_eq_dec h n) (A_eq_dec a n') then @app B (f h a) (@cons B b (@nil B)) else f n n') (f n n') *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h a) (@cons B b (@nil B))) (f n n') *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f n n') (@cons B b (@nil B))) (f n n') *)
intuition.
Qed.
Lemma collate_not_in_eq :
forall h' h (f : A -> A -> list B) l,
~ In h (map fst l) ->
collate A_eq_dec h' f l h' h = f h' h.
Proof.
(* Goal: forall (h' h : A) (f : forall (_ : A) (_ : A), list B) (l : list (prod A B)) (_ : not (@In A h (@map (prod A B) A (@fst A B) l))), @eq (list B) (@collate A B A_eq_dec h' f l h' h) (f h' h) *)
intros.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' f l h' h) (f h' h) *)
revert f.
(* Goal: forall f : forall (_ : A) (_ : A), list B, @eq (list B) (@collate A B A_eq_dec h' f l h' h) (f h' h) *)
induction l; intros; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' f (@cons (prod A B) a l) h' h) (f h' h) *)
simpl in *.
(* Goal: @eq (list B) ((let (to, m) := a in @collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' to (@app B (f h' to) (@cons B m (@nil B)))) l) h' h) (f h' h) *)
break_let.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l h' h) (f h' h) *)
destruct a.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l h' h) (f h' h) *)
find_injection.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l h' h) (f h' h) *)
rewrite IHl; unfold update2.
(* Goal: not (@In A h (@map (prod A B) A (@fst A B) l)) *)
(* Goal: @eq (list B) (if sumbool_and (@eq A h' h') (not (@eq A h' h')) (@eq A a0 h) (not (@eq A a0 h)) (A_eq_dec h' h') (A_eq_dec a0 h) then @app B (f h' a0) (@cons B b (@nil B)) else f h' h) (f h' h) *)
-
(* Goal: @eq (list B) (if sumbool_and (@eq A h' h') (not (@eq A h' h')) (@eq A a0 h) (not (@eq A a0 h)) (A_eq_dec h' h') (A_eq_dec a0 h) then @app B (f h' a0) (@cons B b (@nil B)) else f h' h) (f h' h) *)
break_if.
(* Goal: @eq (list B) (f h' h) (f h' h) *)
(* Goal: @eq (list B) (@app B (f h' a0) (@cons B b (@nil B))) (f h' h) *)
*
(* Goal: @eq (list B) (@app B (f h' a0) (@cons B b (@nil B))) (f h' h) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f h' h) (@cons B b (@nil B))) (f h' h) *)
simpl in *.
(* Goal: @eq (list B) (@app B (f h' h) (@cons B b (@nil B))) (f h' h) *)
contradict H.
(* Goal: or (@eq A h h) (@In A h (@map (prod A B) A (@fst A B) l)) *)
left.
(* Goal: @eq A h h *)
trivial.
(* BG Goal: not (@In A h (@map (prod A B) A (@fst A B) l)) *)
(* BG Goal: @eq (list B) (f h' h) (f h' h) *)
*
(* Goal: @eq (list B) (f h' h) (f h' h) *)
intros.
(* Goal: @eq (list B) (f h' h) (f h' h) *)
trivial.
(* BG Goal: not (@In A h (@map (prod A B) A (@fst A B) l)) *)
-
(* Goal: not (@In A h (@map (prod A B) A (@fst A B) l)) *)
intro.
(* Goal: False *)
contradict H.
(* Goal: or (@eq A (@fst A B (@pair A B a0 b)) h) (@In A h (@map (prod A B) A (@fst A B) l)) *)
right.
(* Goal: @In A h (@map (prod A B) A (@fst A B) l) *)
assumption.
Qed.
Lemma collate_app :
forall h' l1 l2 (f : A -> A -> list B),
collate A_eq_dec h' f (l1 ++ l2) = collate A_eq_dec h' (collate A_eq_dec h' f l1) l2.
Proof.
(* Goal: forall (h' : A) (l1 l2 : list (prod A B)) (f : forall (_ : A) (_ : A), list B), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' f (@app (prod A B) l1 l2)) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' f l1) l2) *)
induction l1; intros; auto.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' f (@app (prod A B) (@cons (prod A B) a l1) l2)) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' f (@cons (prod A B) a l1)) l2) *)
simpl.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (let (to, m) := a in @collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' to (@app B (f h' to) (@cons B m (@nil B)))) (@app (prod A B) l1 l2)) (@collate A B A_eq_dec h' (let (to, m) := a in @collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' to (@app B (f h' to) (@cons B m (@nil B)))) l1) l2) *)
break_let.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) (@app (prod A B) l1 l2)) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l1) l2) *)
destruct a.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) (@app (prod A B) l1 l2)) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l1) l2) *)
find_injection.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) (@app (prod A B) l1 l2)) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l1) l2) *)
rewrite IHl1.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l1) l2) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' a0 (@app B (f h' a0) (@cons B b (@nil B)))) l1) l2) *)
trivial.
Qed.
Lemma collate_neq_update2 :
forall h h' n (f : A -> A -> list B) l ms,
n <> h' ->
collate A_eq_dec h (update2 A_eq_dec f h n ms) l h h' = collate A_eq_dec h f l h h'.
Proof.
(* Goal: forall (h h' n : A) (f : forall (_ : A) (_ : A), list B) (l : list (prod A B)) (ms : list B) (_ : not (@eq A n h')), @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n ms) l h h') (@collate A B A_eq_dec h f l h h') *)
intros.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n ms) l h h') (@collate A B A_eq_dec h f l h h') *)
assert (H_eq: update2 A_eq_dec f h n ms h h' = f h h').
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n ms) l h h') (@collate A B A_eq_dec h f l h h') *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h n ms h h') (f h h') *)
unfold update2.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n ms) l h h') (@collate A B A_eq_dec h f l h h') *)
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A n h') (not (@eq A n h')) (A_eq_dec h h) (A_eq_dec n h') then ms else f h h') (f h h') *)
break_if; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n ms) l h h') (@collate A B A_eq_dec h f l h h') *)
(* Goal: @eq (list B) ms (f h h') *)
break_and; subst.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n ms) l h h') (@collate A B A_eq_dec h f l h h') *)
(* Goal: @eq (list B) ms (f h h') *)
intuition.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n ms) l h h') (@collate A B A_eq_dec h f l h h') *)
rewrite (collate_f_eq _ _ _ _ _ _ H_eq).
(* Goal: @eq (list B) (@collate A B A_eq_dec h f l h h') (@collate A B A_eq_dec h f l h h') *)
trivial.
Qed.
Lemma collate_not_in :
forall h h' l1 l2 (f : A -> A -> list B),
~ In h' (map fst l1) ->
collate A_eq_dec h f (l1 ++ l2) h h' = collate A_eq_dec h f l2 h h'.
Proof.
(* Goal: forall (h h' : A) (l1 l2 : list (prod A B)) (f : forall (_ : A) (_ : A), list B) (_ : not (@In A h' (@map (prod A B) A (@fst A B) l1))), @eq (list B) (@collate A B A_eq_dec h f (@app (prod A B) l1 l2) h h') (@collate A B A_eq_dec h f l2 h h') *)
intros.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@app (prod A B) l1 l2) h h') (@collate A B A_eq_dec h f l2 h h') *)
rewrite collate_app.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@collate A B A_eq_dec h f l1) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
revert f.
(* Goal: forall f : forall (_ : A) (_ : A), list B, @eq (list B) (@collate A B A_eq_dec h (@collate A B A_eq_dec h f l1) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
induction l1; intros; simpl in *; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (let (to, m) := a in @collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h to (@app B (f h to) (@cons B m (@nil B)))) l1) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
break_let.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l1) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
rewrite IHl1.
(* Goal: not (@In A h' (@map (prod A B) A (@fst A B) l1)) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
destruct a.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
find_injection.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
simpl in *.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
assert (H_neq: a0 <> h').
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
(* Goal: not (@eq A a0 h') *)
intro.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
(* Goal: False *)
contradict H.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
(* Goal: or (@eq A a0 h') (@In A h' (@map (prod A B) A (@fst A B) l1)) *)
left.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
(* Goal: @eq A a0 h' *)
trivial.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a0 (@app B (f h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l2 h h') *)
rewrite collate_neq_update2; trivial.
(* BG Goal: not (@In A h' (@map (prod A B) A (@fst A B) l1)) *)
-
(* Goal: not (@In A h' (@map (prod A B) A (@fst A B) l1)) *)
intro.
(* Goal: False *)
contradict H.
(* Goal: or (@eq A (@fst A B (@pair A B a0 b)) h') (@In A h' (@map (prod A B) A (@fst A B) l1)) *)
right.
(* Goal: @In A h' (@map (prod A B) A (@fst A B) l1) *)
trivial.
Qed.
Lemma collate_not_in_rest :
forall h h' l1 l2 (f : A -> A -> list B),
~ In h' (map fst l2) ->
collate A_eq_dec h f (l1 ++ l2) h h' = collate A_eq_dec h f l1 h h'.
Proof.
(* Goal: forall (h h' : A) (l1 l2 : list (prod A B)) (f : forall (_ : A) (_ : A), list B) (_ : not (@In A h' (@map (prod A B) A (@fst A B) l2))), @eq (list B) (@collate A B A_eq_dec h f (@app (prod A B) l1 l2) h h') (@collate A B A_eq_dec h f l1 h h') *)
intros.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@app (prod A B) l1 l2) h h') (@collate A B A_eq_dec h f l1 h h') *)
rewrite collate_app.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@collate A B A_eq_dec h f l1) l2 h h') (@collate A B A_eq_dec h f l1 h h') *)
revert f.
(* Goal: forall f : forall (_ : A) (_ : A), list B, @eq (list B) (@collate A B A_eq_dec h (@collate A B A_eq_dec h f l1) l2 h h') (@collate A B A_eq_dec h f l1 h h') *)
induction l2; intros; simpl in *; auto.
(* Goal: @eq (list B) ((let (to, m) := a in @collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@collate A B A_eq_dec h f l1) h to (@app B (@collate A B A_eq_dec h f l1 h to) (@cons B m (@nil B)))) l2) h h') (@collate A B A_eq_dec h f l1 h h') *)
break_let.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@collate A B A_eq_dec h f l1) h a0 (@app B (@collate A B A_eq_dec h f l1 h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l1 h h') *)
subst_max.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@collate A B A_eq_dec h f l1) h a0 (@app B (@collate A B A_eq_dec h f l1 h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l1 h h') *)
simpl in *.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@collate A B A_eq_dec h f l1) h a0 (@app B (@collate A B A_eq_dec h f l1 h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l1 h h') *)
assert (H_neq: a0 <> h'); auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@collate A B A_eq_dec h f l1) h a0 (@app B (@collate A B A_eq_dec h f l1 h a0) (@cons B b (@nil B)))) l2 h h') (@collate A B A_eq_dec h f l1 h h') *)
rewrite collate_neq_update2; auto.
Qed.
Lemma collate_not_in_mid :
forall h h' l1 l2 (f : A -> A -> list B) m,
~ In h (map fst (l1 ++ l2)) ->
collate A_eq_dec h' (update2 A_eq_dec f h' h (f h' h ++ [m])) (l1 ++ l2) = collate A_eq_dec h' f (l1 ++ (h, m) :: l2).
Proof.
(* Goal: forall (h h' : A) (l1 l2 : list (prod A B)) (f : forall (_ : A) (_ : A), list B) (m : B) (_ : not (@In A h (@map (prod A B) A (@fst A B) (@app (prod A B) l1 l2)))), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2)) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2))) *)
intros h h' l1 l2 f m H_in.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2)) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2))) *)
apply functional_extensionality; intro from.
(* Goal: @eq (forall _ : A, list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from) *)
apply functional_extensionality; intro to.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
case (A_eq_dec h' from); intro H_dec.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
rewrite <- H_dec.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
case (A_eq_dec h to); intro H_dec'.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
rewrite <- H_dec'.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' h) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' h) *)
rewrite collate_not_in.
(* Goal: not (@In A h (@map (prod A B) A (@fst A B) l1)) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) l2 h' h) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' h) *)
+
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) l2 h' h) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' h) *)
subst.
(* Goal: @eq (list B) (@collate A B A_eq_dec from (@update2 A (list B) A_eq_dec f from to (@app B (f from to) (@cons B m (@nil B)))) l2 from to) (@collate A B A_eq_dec from f (@app (prod A B) l1 (@cons (prod A B) (@pair A B to m) l2)) from to) *)
rewrite collate_not_in; auto.
(* Goal: not (@In A to (@map (prod A B) A (@fst A B) l1)) *)
intro.
(* Goal: False *)
contradict H_in.
(* Goal: @In A to (@map (prod A B) A (@fst A B) (@app (prod A B) l1 l2)) *)
rewrite map_app.
(* Goal: @In A to (@app A (@map (prod A B) A (@fst A B) l1) (@map (prod A B) A (@fst A B) l2)) *)
apply in_or_app.
(* Goal: or (@In A to (@map (prod A B) A (@fst A B) l1)) (@In A to (@map (prod A B) A (@fst A B) l2)) *)
left.
(* Goal: @In A to (@map (prod A B) A (@fst A B) l1) *)
assumption.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
(* BG Goal: not (@In A h (@map (prod A B) A (@fst A B) l1)) *)
+
(* Goal: not (@In A h (@map (prod A B) A (@fst A B) l1)) *)
intro.
(* Goal: False *)
contradict H_in.
(* Goal: @In A h (@map (prod A B) A (@fst A B) (@app (prod A B) l1 l2)) *)
rewrite map_app.
(* Goal: @In A h (@app A (@map (prod A B) A (@fst A B) l1) (@map (prod A B) A (@fst A B) l2)) *)
apply in_or_app.
(* Goal: or (@In A h (@map (prod A B) A (@fst A B) l1)) (@In A h (@map (prod A B) A (@fst A B) l2)) *)
left.
(* Goal: @In A h (@map (prod A B) A (@fst A B) l1) *)
assumption.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
rewrite collate_neq_update2; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' f (@app (prod A B) l1 l2) h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
rewrite collate_app.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' f l1) l2 h' to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) h' to) *)
rewrite collate_app.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' f l1) l2 h' to) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' f l1) (@cons (prod A B) (@pair A B h m) l2) h' to) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@collate A B A_eq_dec h' f l1) l2 h' to) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec (@collate A B A_eq_dec h' f l1) h' h (@app B (@collate A B A_eq_dec h' f l1 h' h) (@cons B m (@nil B)))) l2 h' to) *)
rewrite collate_neq_update2; auto.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h' (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) (@app (prod A B) l1 l2) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
rewrite collate_neq; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) from to) (@collate A B A_eq_dec h' f (@app (prod A B) l1 (@cons (prod A B) (@pair A B h m) l2)) from to) *)
rewrite collate_neq; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) from to) (f from to) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h' from) (not (@eq A h' from)) (@eq A h to) (not (@eq A h to)) (A_eq_dec h' from) (A_eq_dec h to) then @app B (f h' h) (@cons B m (@nil B)) else f from to) (f from to) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h' h) (@cons B m (@nil B))) (f from to) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f from to) (@cons B m (@nil B))) (f from to) *)
intuition.
Qed.
Lemma NoDup_Permutation_collate_eq :
forall h (f : A -> A -> list B) l l',
NoDup (map fst l) ->
Permutation l l' ->
collate A_eq_dec h f l = collate A_eq_dec h f l'.
Proof.
(* Goal: forall (h : A) (f : forall (_ : A) (_ : A), list B) (l l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) l)) (_ : @Permutation (prod A B) l l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f l) (@collate A B A_eq_dec h f l') *)
intros h f l.
(* Goal: forall (l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) l)) (_ : @Permutation (prod A B) l l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f l) (@collate A B A_eq_dec h f l') *)
revert h f.
(* Goal: forall (h : A) (f : forall (_ : A) (_ : A), list B) (l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) l)) (_ : @Permutation (prod A B) l l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f l) (@collate A B A_eq_dec h f l') *)
induction l.
(* Goal: forall (h : A) (f : forall (_ : A) (_ : A), list B) (l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) (@cons (prod A B) a l))) (_ : @Permutation (prod A B) (@cons (prod A B) a l) l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@cons (prod A B) a l)) (@collate A B A_eq_dec h f l') *)
(* Goal: forall (h : A) (f : forall (_ : A) (_ : A), list B) (l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) (@nil (prod A B)))) (_ : @Permutation (prod A B) (@nil (prod A B)) l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@nil (prod A B))) (@collate A B A_eq_dec h f l') *)
-
(* Goal: forall (h : A) (f : forall (_ : A) (_ : A), list B) (l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) (@nil (prod A B)))) (_ : @Permutation (prod A B) (@nil (prod A B)) l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@nil (prod A B))) (@collate A B A_eq_dec h f l') *)
intros.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@nil (prod A B))) (@collate A B A_eq_dec h f l') *)
find_apply_lem_hyp Permutation_nil.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@nil (prod A B))) (@collate A B A_eq_dec h f l') *)
subst.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@nil (prod A B))) (@collate A B A_eq_dec h f (@nil (prod A B))) *)
trivial.
(* BG Goal: forall (h : A) (f : forall (_ : A) (_ : A), list B) (l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) (@cons (prod A B) a l))) (_ : @Permutation (prod A B) (@cons (prod A B) a l) l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@cons (prod A B) a l)) (@collate A B A_eq_dec h f l') *)
-
(* Goal: forall (h : A) (f : forall (_ : A) (_ : A), list B) (l' : list (prod A B)) (_ : @NoDup A (@map (prod A B) A (@fst A B) (@cons (prod A B) a l))) (_ : @Permutation (prod A B) (@cons (prod A B) a l) l'), @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@cons (prod A B) a l)) (@collate A B A_eq_dec h f l') *)
intros.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@cons (prod A B) a l)) (@collate A B A_eq_dec h f l') *)
destruct a.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h f (@cons (prod A B) (@pair A B a b) l)) (@collate A B A_eq_dec h f l') *)
simpl in *.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f l') *)
invc_NoDup.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f l') *)
assert (H_in': In (a, b) ((a, b) :: l)).
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f l') *)
(* Goal: @In (prod A B) (@pair A B a b) (@cons (prod A B) (@pair A B a b) l) *)
left.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f l') *)
(* Goal: @eq (prod A B) (@pair A B a b) (@pair A B a b) *)
trivial.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f l') *)
pose proof (Permutation_in _ H0 H_in') as H_pm'.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f l') *)
apply in_split in H_pm'.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f l') *)
break_exists; subst.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f (@app (prod A B) x (@cons (prod A B) (@pair A B a b) x0))) *)
find_apply_lem_hyp Permutation_cons_app_inv.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f (@app (prod A B) x (@cons (prod A B) (@pair A B a b) x0))) *)
pose proof (IHl h (update2 A_eq_dec f h a (f h a ++ [b])) _ H4 H0) as IHl'.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) l) (@collate A B A_eq_dec h f (@app (prod A B) x (@cons (prod A B) (@pair A B a b) x0))) *)
rewrite IHl'.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B b (@nil B)))) (@app (prod A B) x x0)) (@collate A B A_eq_dec h f (@app (prod A B) x (@cons (prod A B) (@pair A B a b) x0))) *)
rewrite collate_not_in_mid; auto.
(* Goal: not (@In A a (@map (prod A B) A (@fst A B) (@app (prod A B) x x0))) *)
intro.
(* Goal: False *)
assert (H_pm': Permutation (map (fun nm : A * B => fst nm) l) (map (fun nm : A * B => fst nm) (x ++ x0))).
(* Goal: False *)
(* Goal: @Permutation A (@map (prod A B) A (fun nm : prod A B => @fst A B nm) l) (@map (prod A B) A (fun nm : prod A B => @fst A B nm) (@app (prod A B) x x0)) *)
apply Permutation_map_fst.
(* Goal: False *)
(* Goal: @Permutation (prod A B) l (@app (prod A B) x x0) *)
trivial.
(* Goal: False *)
contradict H3.
(* Goal: @In A a (@map (prod A B) A (@fst A B) l) *)
revert H.
(* Goal: forall _ : @In A a (@map (prod A B) A (@fst A B) (@app (prod A B) x x0)), @In A a (@map (prod A B) A (@fst A B) l) *)
apply Permutation_in.
(* Goal: @Permutation A (@map (prod A B) A (@fst A B) (@app (prod A B) x x0)) (@map (prod A B) A (@fst A B) l) *)
apply Permutation_sym.
(* Goal: @Permutation A (@map (prod A B) A (@fst A B) l) (@map (prod A B) A (@fst A B) (@app (prod A B) x x0)) *)
trivial.
Qed.
Lemma collate_map2snd_not_related :
forall m n h ns (f : A -> A -> list B),
~ R h n ->
collate A_eq_dec h f (map2snd m (filter_rel R_dec h ns)) h n = f h n.
Proof.
(* Goal: forall (m : B) (n h : A) (ns : list A) (f : forall (_ : A) (_ : A), list B) (_ : not (R h n)), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
intros m n h ns f H_adj.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
revert f.
(* Goal: forall f : forall (_ : A) (_ : A), list B, @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
induction ns; intros; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns))) h n) (f h n) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (f h n) *)
break_if; simpl; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B)))) (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
rewrite IHns.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B))) h n) (f h n) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A a n) (not (@eq A a n)) (A_eq_dec h h) (A_eq_dec a n) then @app B (f h a) (@cons B m (@nil B)) else f h n) (f h n) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h a) (@cons B m (@nil B))) (f h n) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f h n) (@cons B m (@nil B))) (f h n) *)
intuition.
Qed.
Lemma collate_map2snd_in_neq_in_before :
forall from (f : A -> A -> list B) m dsts a b x,
In x (collate A_eq_dec from f (map2snd m dsts) a b) ->
x <> m ->
In x (f a b).
Proof.
(* Goal: forall (from : A) (f : forall (_ : A) (_ : A), list B) (m : B) (dsts : list A) (a b : A) (x : B) (_ : @In B x (@collate A B A_eq_dec from f (@map2snd A B m dsts) a b)) (_ : not (@eq B x m)), @In B x (f a b) *)
intros.
(* Goal: @In B x (f a b) *)
generalize dependent f.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (@collate A B A_eq_dec from f (@map2snd A B m dsts) a b)), @In B x (f a b) *)
induction dsts.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (@collate A B A_eq_dec from f (@map2snd A B m (@cons A a0 dsts)) a b)), @In B x (f a b) *)
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (@collate A B A_eq_dec from f (@map2snd A B m (@nil A)) a b)), @In B x (f a b) *)
-
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (@collate A B A_eq_dec from f (@map2snd A B m (@nil A)) a b)), @In B x (f a b) *)
auto.
(* BG Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (@collate A B A_eq_dec from f (@map2snd A B m (@cons A a0 dsts)) a b)), @In B x (f a b) *)
-
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (@collate A B A_eq_dec from f (@map2snd A B m (@cons A a0 dsts)) a b)), @In B x (f a b) *)
simpl; intros f H_coll.
(* Goal: @In B x (f a b) *)
eapply IHdsts in H_coll.
(* Goal: @In B x (f a b) *)
destruct (A_eq_dec from a), (A_eq_dec a0 b); subst.
(* Goal: @In B x (f a b) *)
(* Goal: @In B x (f a b) *)
(* Goal: @In B x (f a b) *)
(* Goal: @In B x (f a b) *)
+
(* Goal: @In B x (f a b) *)
rewrite update2_same in *.
(* Goal: @In B x (f a b) *)
find_eapply_lem_hyp in_app_or; break_or_hyp.
(* Goal: @In B x (f a b) *)
(* Goal: @In B x (f a b) *)
*
(* Goal: @In B x (f a b) *)
assumption.
(* BG Goal: @In B x (f a b) *)
(* BG Goal: @In B x (f a b) *)
(* BG Goal: @In B x (f a b) *)
(* BG Goal: @In B x (f a b) *)
*
(* Goal: @In B x (f a b) *)
exfalso; find_eapply_lem_hyp in_inv; break_or_hyp; exfalso; auto.
(* BG Goal: @In B x (f a b) *)
(* BG Goal: @In B x (f a b) *)
(* BG Goal: @In B x (f a b) *)
+
(* Goal: @In B x (f a b) *)
rewrite update2_diff2 in *; auto.
(* BG Goal: @In B x (f a b) *)
(* BG Goal: @In B x (f a b) *)
+
(* Goal: @In B x (f a b) *)
rewrite update2_diff1 in *; auto.
(* BG Goal: @In B x (f a b) *)
+
(* Goal: @In B x (f a b) *)
rewrite update2_diff1 in *; auto.
Qed.
Lemma collate_map2snd_not_in :
forall m n h ns (f : A -> A -> list B),
~ In n ns ->
collate A_eq_dec h f (map2snd m (filter_rel R_dec h ns)) h n = f h n.
Proof.
(* Goal: forall (m : B) (n h : A) (ns : list A) (f : forall (_ : A) (_ : A), list B) (_ : not (@In A n ns)), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
intros m n h ns f.
(* Goal: forall _ : not (@In A n ns), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
revert f.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : not (@In A n ns)), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
induction ns; intros; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns))) h n) (f h n) *)
simpl in *.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (f h n) *)
break_if; simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B)))) (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B)))) (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
rewrite IHns.
(* Goal: not (@In A n ns) *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B))) h n) (f h n) *)
*
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B))) h n) (f h n) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A a n) (not (@eq A a n)) (A_eq_dec h h) (A_eq_dec a n) then @app B (f h a) (@cons B m (@nil B)) else f h n) (f h n) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h a) (@cons B m (@nil B))) (f h n) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f h n) (@cons B m (@nil B))) (f h n) *)
contradict H.
(* Goal: or (@eq A n n) (@In A n ns) *)
left.
(* Goal: @eq A n n *)
trivial.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
(* BG Goal: not (@In A n ns) *)
*
(* Goal: not (@In A n ns) *)
intro.
(* Goal: False *)
contradict H.
(* Goal: or (@eq A a n) (@In A n ns) *)
right.
(* Goal: @In A n ns *)
assumption.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h ns)) h n) (f h n) *)
rewrite IHns; auto.
Qed.
Lemma collate_map2snd_not_in_remove_all :
forall m n h ns (f : A -> A -> list B) ns',
~ In n ns ->
collate A_eq_dec h f (map2snd m (filter_rel R_dec h (remove_all A_eq_dec ns' ns))) h n = f h n.
Proof.
(* Goal: forall (m : B) (n h : A) (ns : list A) (f : forall (_ : A) (_ : A), list B) (ns' : list A) (_ : not (@In A n ns)), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
intros m n h ns f ns' H_in.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
apply collate_map2snd_not_in.
(* Goal: not (@In A n (@remove_all A A_eq_dec ns' ns)) *)
intro.
(* Goal: False *)
find_apply_lem_hyp in_remove_all_was_in.
(* Goal: False *)
intuition.
Qed.
Lemma collate_map2snd_not_in_related :
forall m n h ns (f : A -> A -> list B) ns',
~ In n ns' ->
R h n ->
In n ns ->
NoDup ns ->
collate A_eq_dec h f (map2snd m (filter_rel R_dec h (remove_all A_eq_dec ns' ns))) h n = f h n ++ [m].
Proof.
(* Goal: forall (m : B) (n h : A) (ns : list A) (f : forall (_ : A) (_ : A), list B) (ns' : list A) (_ : not (@In A n ns')) (_ : R h n) (_ : @In A n ns) (_ : @NoDup A ns), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
intros m n h ns f ns' H_in H_adj.
(* Goal: forall (_ : @In A n ns) (_ : @NoDup A ns), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
revert f.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In A n ns) (_ : @NoDup A ns), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
induction ns; intros; [ contradict H | idtac ].
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
invc_NoDup.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
simpl in *.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
break_or_hyp.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A n ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A n ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
pose proof (remove_all_cons A_eq_dec ns' n ns) as H_ra.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A n ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
break_or_hyp; break_and; intuition.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A n ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
find_rewrite.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@cons A n (@remove_all A A_eq_dec ns' ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (if R_dec h n then @cons A n (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) else @filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
break_if; intuition.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@cons A n (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B m (@nil B)))) (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
rewrite collate_map2snd_not_in_remove_all; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B m (@nil B))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A n n) (not (@eq A n n)) (A_eq_dec h h) (A_eq_dec n n) then @app B (f h n) (@cons B m (@nil B)) else f h n) (@app B (f h n) (@cons B m (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (f h n) (@app B (f h n) (@cons B m (@nil B))) *)
intuition.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
assert (H_neq: a <> n).
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
(* Goal: not (@eq A a n) *)
intro.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
(* Goal: False *)
subst.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
(* Goal: False *)
intuition.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
pose proof (remove_all_cons A_eq_dec ns' a ns) as H_ra.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
break_or_hyp; break_and.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
find_rewrite.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
rewrite IHns; auto.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
find_rewrite.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@cons A a (@remove_all A A_eq_dec ns' ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) else @filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@cons A a (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B)))) (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (@app B (f h n) (@cons B m (@nil B))) *)
rewrite IHns; auto.
(* Goal: @eq (list B) (@app B (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B))) h n) (@cons B m (@nil B))) (@app B (f h n) (@cons B m (@nil B))) *)
unfold update2.
(* Goal: @eq (list B) (@app B (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A a n) (not (@eq A a n)) (A_eq_dec h h) (A_eq_dec a n) then @app B (f h a) (@cons B m (@nil B)) else f h n) (@cons B m (@nil B))) (@app B (f h n) (@cons B m (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (@app B (f h a) (@cons B m (@nil B))) (@cons B m (@nil B))) (@app B (f h n) (@cons B m (@nil B))) *)
break_and.
(* Goal: @eq (list B) (@app B (@app B (f h a) (@cons B m (@nil B))) (@cons B m (@nil B))) (@app B (f h n) (@cons B m (@nil B))) *)
subst.
(* Goal: @eq (list B) (@app B (@app B (f h n) (@cons B m (@nil B))) (@cons B m (@nil B))) (@app B (f h n) (@cons B m (@nil B))) *)
intuition.
Qed.
Lemma collate_map2snd_in :
forall m n h ns (f : A -> A -> list B) ns',
In n ns' ->
collate A_eq_dec h f (map2snd m (filter_rel R_dec h (remove_all A_eq_dec ns' ns))) h n = f h n.
Proof.
(* Goal: forall (m : B) (n h : A) (ns : list A) (f : forall (_ : A) (_ : A), list B) (ns' : list A) (_ : @In A n ns'), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
intros m n h ns f ns'.
(* Goal: forall _ : @In A n ns', @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
revert f.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In A n ns'), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
induction ns; intros.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (f h n) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@nil A)))) h n) (f h n) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@nil A)))) h n) (f h n) *)
rewrite remove_all_nil.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@nil A))) h n) (f h n) *)
trivial.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (f h n) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (f h n) *)
pose proof (remove_all_cons A_eq_dec ns' a ns) as H_ra.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns)))) h n) (f h n) *)
break_or_hyp; break_and; find_rewrite.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@cons A a (@remove_all A A_eq_dec ns' ns)))) h n) (f h n) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
rewrite IHns; trivial.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@cons A a (@remove_all A A_eq_dec ns' ns)))) h n) (f h n) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@cons A a (@remove_all A A_eq_dec ns' ns)))) h n) (f h n) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) else @filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
break_if.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@cons A a (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)))) h n) (f h n) *)
+
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@cons A a (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)))) h n) (f h n) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B)))) (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
rewrite IHns; simpl; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B m (@nil B))) h n) (f h n) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A a n) (not (@eq A a n)) (A_eq_dec h h) (A_eq_dec a n) then @app B (f h a) (@cons B m (@nil B)) else f h n) (f h n) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h a) (@cons B m (@nil B))) (f h n) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f h n) (@cons B m (@nil B))) (f h n) *)
intuition.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
+
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B m (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) h n) (f h n) *)
rewrite IHns; trivial.
Qed.
Lemma collate_map2snd_related_not_in :
forall a n h ns (f : A -> A -> list B),
R h n ->
~ In n ns ->
collate A_eq_dec h f (map2snd a (filter_rel R_dec h (n :: ns))) h n = f h n ++ [a].
Proof.
(* Goal: forall (a : B) (n h : A) (ns : list A) (f : forall (_ : A) (_ : A), list B) (_ : R h n) (_ : not (@In A n ns)), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B a (@filter_rel A R R_dec h (@cons A n ns))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
intros a n h ns f H_adj H_in.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B a (@filter_rel A R R_dec h (@cons A n ns))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B a (if R_dec h n then @cons A n (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
break_if; intuition.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B a (@cons A n (@filter_rel A R R_dec h ns))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
clear r.
(* Goal: @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B a (@cons A n (@filter_rel A R R_dec h ns))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
revert f n h H_in H_adj.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (n h : A) (_ : forall _ : @In A n ns, False) (_ : R h n), @eq (list B) (@collate A B A_eq_dec h f (@map2snd A B a (@cons A n (@filter_rel A R R_dec h ns))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
induction ns; intros; simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
-
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A n n) (not (@eq A n n)) (A_eq_dec h h) (A_eq_dec n n) then @app B (f h n) (@cons B a (@nil B)) else f h n) (@app B (f h n) (@cons B a (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (f h n) (@app B (f h n) (@cons B a (@nil B))) *)
intuition.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
-
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
assert (H_in': ~ In n ns).
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: not (@In A n ns) *)
intro.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: False *)
contradict H_in.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: @In A n (@cons A a0 ns) *)
right.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: @In A n ns *)
trivial.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
assert (H_neq: n <> a0).
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: not (@eq A n a0) *)
intro.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: False *)
subst.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: False *)
contradict H_in.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: @In A a0 (@cons A a0 ns) *)
left.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: @eq A a0 a0 *)
trivial.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
simpl in *.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (if R_dec h a0 then @cons A a0 (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
break_if.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (@filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (@cons A a0 (@filter_rel A R R_dec h ns))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (@cons A a0 (@filter_rel A R R_dec h ns))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
simpl.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) h a0 (@app B (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B))) h a0) (@cons B a (@nil B)))) (@map2snd A B a (@filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
unfold update2 at 3.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) h a0 (@app B (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A n a0) (not (@eq A n a0)) (A_eq_dec h h) (A_eq_dec n a0) then @app B (f h n) (@cons B a (@nil B)) else f h a0) (@cons B a (@nil B)))) (@map2snd A B a (@filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
break_if; intuition eauto.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) h a0 (@app B (f h a0) (@cons B a (@nil B)))) (@map2snd A B a (@filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
pose proof (IHns f) as IH'.
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) h a0 (@app B (f h a0) (@cons B a (@nil B)))) (@map2snd A B a (@filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
rewrite collate_map2snd_not_in; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) h a0 (@app B (f h a0) (@cons B a (@nil B))) h n) (@app B (f h n) (@cons B a (@nil B))) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A a0 n) (not (@eq A a0 n)) (A_eq_dec h h) (A_eq_dec a0 n) then @app B (f h a0) (@cons B a (@nil B)) else if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A n n) (not (@eq A n n)) (A_eq_dec h h) (A_eq_dec n n) then @app B (f h n) (@cons B a (@nil B)) else f h n) (@app B (f h n) (@cons B a (@nil B))) *)
break_if; intuition eauto.
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (forall _ : @eq A h h, False) (@eq A n n) (forall _ : @eq A n n, False) (A_eq_dec h h) (A_eq_dec n n) then @app B (f h n) (@cons B a (@nil B)) else f h n) (@app B (f h n) (@cons B a (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (f h n) (@app B (f h n) (@cons B a (@nil B))) *)
intuition.
(* BG Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (@filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
*
(* Goal: @eq (list B) (@collate A B A_eq_dec h (@update2 A (list B) A_eq_dec f h n (@app B (f h n) (@cons B a (@nil B)))) (@map2snd A B a (@filter_rel A R R_dec h ns)) h n) (@app B (f h n) (@cons B a (@nil B))) *)
rewrite IHns; auto.
Qed.
Lemma in_collate_in :
forall ns n h (f : A -> A -> list B) a,
~ In n ns ->
In a (collate A_eq_dec h f (map2snd a (filter_rel R_dec h ns)) h n) ->
In a (f h n).
Proof.
(* Goal: forall (ns : list A) (n h : A) (f : forall (_ : A) (_ : A), list B) (a : B) (_ : not (@In A n ns)) (_ : @In B a (@collate A B A_eq_dec h f (@map2snd A B a (@filter_rel A R R_dec h ns)) h n)), @In B a (f h n) *)
induction ns; intros; auto.
(* Goal: @In B a0 (f h n) *)
assert (H_in': ~ In n ns).
(* Goal: @In B a0 (f h n) *)
(* Goal: not (@In A n ns) *)
intro.
(* Goal: @In B a0 (f h n) *)
(* Goal: False *)
contradict H.
(* Goal: @In B a0 (f h n) *)
(* Goal: @In A n (@cons A a ns) *)
right.
(* Goal: @In B a0 (f h n) *)
(* Goal: @In A n ns *)
trivial.
(* Goal: @In B a0 (f h n) *)
assert (H_neq: n <> a).
(* Goal: @In B a0 (f h n) *)
(* Goal: not (@eq A n a) *)
intro.
(* Goal: @In B a0 (f h n) *)
(* Goal: False *)
subst.
(* Goal: @In B a0 (f h n) *)
(* Goal: False *)
contradict H.
(* Goal: @In B a0 (f h n) *)
(* Goal: @In A a (@cons A a ns) *)
left.
(* Goal: @In B a0 (f h n) *)
(* Goal: @eq A a a *)
trivial.
(* Goal: @In B a0 (f h n) *)
simpl in *.
(* Goal: @In B a0 (f h n) *)
break_if; auto.
(* Goal: @In B a0 (f h n) *)
simpl in *.
(* Goal: @In B a0 (f h n) *)
assert (H_eq_f: update2 A_eq_dec f h a (f h a ++ [a0]) h n = f h n).
(* Goal: @In B a0 (f h n) *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h a (@app B (f h a) (@cons B a0 (@nil B))) h n) (f h n) *)
unfold update2.
(* Goal: @In B a0 (f h n) *)
(* Goal: @eq (list B) (if sumbool_and (@eq A h h) (not (@eq A h h)) (@eq A a n) (not (@eq A a n)) (A_eq_dec h h) (A_eq_dec a n) then @app B (f h a) (@cons B a0 (@nil B)) else f h n) (f h n) *)
break_if; auto.
(* Goal: @In B a0 (f h n) *)
(* Goal: @eq (list B) (@app B (f h a) (@cons B a0 (@nil B))) (f h n) *)
break_and; subst.
(* Goal: @In B a0 (f h n) *)
(* Goal: @eq (list B) (@app B (f h n) (@cons B a0 (@nil B))) (f h n) *)
intuition.
(* Goal: @In B a0 (f h n) *)
rewrite (collate_f_eq _ _ _ _ _ _ H_eq_f) in H0.
(* Goal: @In B a0 (f h n) *)
apply IHns; auto.
Qed.
Lemma not_in_map2snd :
forall n h (m : B) ns,
~ In n ns ->
~ In (n, m) (map2snd m (filter_rel R_dec h ns)).
Proof.
(* Goal: forall (n h : A) (m : B) (ns : list A) (_ : not (@In A n ns)), not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
intros.
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
induction ns; intros; auto.
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns)))) *)
simpl in *.
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns))) *)
break_if.
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@cons A a (@filter_rel A R R_dec h ns)))) *)
-
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@cons A a (@filter_rel A R R_dec h ns)))) *)
simpl.
(* Goal: not (or (@eq (prod A B) (@pair A B a m) (@pair A B n m)) (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns)))) *)
intro.
(* Goal: False *)
break_or_hyp.
(* Goal: False *)
(* Goal: False *)
*
(* Goal: False *)
find_injection.
(* Goal: False *)
contradict H.
(* Goal: or (@eq A n n) (@In A n ns) *)
left.
(* Goal: @eq A n n *)
trivial.
(* BG Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
(* BG Goal: False *)
*
(* Goal: False *)
contradict H1.
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
apply IHns.
(* Goal: not (@In A n ns) *)
intro.
(* Goal: False *)
contradict H.
(* Goal: or (@eq A a n) (@In A n ns) *)
right.
(* Goal: @In A n ns *)
assumption.
(* BG Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
-
(* Goal: not (@In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
apply IHns.
(* Goal: not (@In A n ns) *)
intro.
(* Goal: False *)
contradict H.
(* Goal: or (@eq A a n) (@In A n ns) *)
right.
(* Goal: @In A n ns *)
assumption.
Qed.
Lemma NoDup_map2snd :
forall h (m : B) ns,
NoDup ns ->
NoDup (map2snd m (filter_rel R_dec h ns)).
Proof.
(* Goal: forall (h : A) (m : B) (ns : list A) (_ : @NoDup A ns), @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h ns)) *)
intros.
(* Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h ns)) *)
induction ns.
(* Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns))) *)
(* Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h (@nil A))) *)
-
(* Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h (@nil A))) *)
apply NoDup_nil.
(* BG Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns))) *)
-
(* Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns))) *)
invc_NoDup.
(* Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns))) *)
concludes.
(* Goal: @NoDup (prod A B) (@map2snd A B m (@filter_rel A R R_dec h (@cons A a ns))) *)
simpl.
(* Goal: @NoDup (prod A B) (@map2snd A B m (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns)) *)
break_if; auto.
(* Goal: @NoDup (prod A B) (@map2snd A B m (@cons A a (@filter_rel A R R_dec h ns))) *)
simpl.
(* Goal: @NoDup (prod A B) (@cons (prod A B) (@pair A B a m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
apply NoDup_cons; auto.
(* Goal: not (@In (prod A B) (@pair A B a m) (@map2snd A B m (@filter_rel A R R_dec h ns))) *)
apply not_in_map2snd.
(* Goal: not (@In A a ns) *)
assumption.
Qed.
Lemma in_map2snd_snd :
forall h (m : B) ns nm,
In nm (map2snd m (filter_rel R_dec h ns)) ->
snd nm = m.
Proof.
(* Goal: forall (h : A) (m : B) (ns : list A) (nm : prod A B) (_ : @In (prod A B) nm (@map2snd A B m (@filter_rel A R R_dec h ns))), @eq B (@snd A B nm) m *)
intros.
(* Goal: @eq B (@snd A B nm) m *)
induction ns; intros; simpl in *; intuition.
(* Goal: @eq B (@snd A B nm) m *)
break_if.
(* Goal: @eq B (@snd A B nm) m *)
(* Goal: @eq B (@snd A B nm) m *)
-
(* Goal: @eq B (@snd A B nm) m *)
simpl in *.
(* Goal: @eq B (@snd A B nm) m *)
break_or_hyp; intuition eauto.
(* BG Goal: @eq B (@snd A B nm) m *)
-
(* Goal: @eq B (@snd A B nm) m *)
apply IHns.
(* Goal: @In (prod A B) nm (@map2snd A B m (@filter_rel A R R_dec h ns)) *)
assumption.
Qed.
Lemma in_map2snd_related_in :
forall (m : B) ns n h,
In (n, m) (map2snd m (filter_rel R_dec h ns)) ->
R h n /\ In n ns.
Proof.
(* Goal: forall (m : B) (ns : list A) (n h : A) (_ : @In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))), and (R h n) (@In A n ns) *)
intros m.
(* Goal: forall (ns : list A) (n h : A) (_ : @In (prod A B) (@pair A B n m) (@map2snd A B m (@filter_rel A R R_dec h ns))), and (R h n) (@In A n ns) *)
induction ns; intros; simpl in *; [ intuition | idtac ].
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
break_if; simpl in *.
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
-
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
break_or_hyp.
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
*
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
find_injection; auto.
(* BG Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
(* BG Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
*
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
find_apply_hyp_hyp.
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
break_and.
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
auto.
(* BG Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
-
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
find_apply_hyp_hyp.
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
break_and.
(* Goal: and (R h n) (or (@eq A a n) (@In A n ns)) *)
auto.
Qed.
Lemma collate_ls_not_in :
forall ns (f : A -> A -> list B) h mg from to,
~ In from ns ->
collate_ls A_eq_dec ns f h mg from to = f from to.
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (h : A) (mg : B) (from to : A) (_ : not (@In A from ns)), @eq (list B) (@collate_ls A B A_eq_dec ns f h mg from to) (f from to) *)
induction ns; intros; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
assert (H_neq: a <> from).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: not (@eq A a from) *)
intro.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: False *)
subst.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: False *)
contradict H.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: @In A from (@cons A from ns) *)
left.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: @eq A from from *)
trivial.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
assert (H_in': ~ In from ns).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: not (@In A from ns) *)
intro.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: False *)
contradict H.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: @In A from (@cons A a ns) *)
right.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
(* Goal: @In A from ns *)
assumption.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
simpl.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from to) (f from to) *)
rewrite IHns; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B))) from to) (f from to) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A a from) (not (@eq A a from)) (@eq A h to) (not (@eq A h to)) (A_eq_dec a from) (A_eq_dec h to) then @app B (f a h) (@cons B mg (@nil B)) else f from to) (f from to) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f a h) (@cons B mg (@nil B))) (f from to) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f from to) (@cons B mg (@nil B))) (f from to) *)
intuition.
Qed.
Lemma collate_ls_in_in :
forall ns (f : A -> A -> list B) to m x a b,
In x (f a b) ->
In x (collate_ls A_eq_dec ns f to m a b).
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (to : A) (m x : B) (a b : A) (_ : @In B x (f a b)), @In B x (@collate_ls A B A_eq_dec ns f to m a b) *)
intros.
(* Goal: @In B x (@collate_ls A B A_eq_dec ns f to m a b) *)
generalize dependent f.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (f a b)), @In B x (@collate_ls A B A_eq_dec ns f to m a b) *)
induction ns.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (f a b)), @In B x (@collate_ls A B A_eq_dec (@cons A a0 ns) f to m a b) *)
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (f a b)), @In B x (@collate_ls A B A_eq_dec (@nil A) f to m a b) *)
-
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (f a b)), @In B x (@collate_ls A B A_eq_dec (@nil A) f to m a b) *)
auto.
(* BG Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (f a b)), @In B x (@collate_ls A B A_eq_dec (@cons A a0 ns) f to m a b) *)
-
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (_ : @In B x (f a b)), @In B x (@collate_ls A B A_eq_dec (@cons A a0 ns) f to m a b) *)
intros.
(* Goal: @In B x (@collate_ls A B A_eq_dec (@cons A a0 ns) f to m a b) *)
simpl.
(* Goal: @In B x (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B)))) to m a b) *)
eapply IHns; eauto.
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a b) *)
destruct (A_eq_dec a a0), (A_eq_dec to b); subst.
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a b) *)
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 b (@app B (f a0 b) (@cons B m (@nil B))) a b) *)
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a0 b) *)
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 b (@app B (f a0 b) (@cons B m (@nil B))) a0 b) *)
+
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 b (@app B (f a0 b) (@cons B m (@nil B))) a0 b) *)
rewrite update2_eq; auto using in_or_app.
(* BG Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a b) *)
(* BG Goal: @In B x (@update2 A (list B) A_eq_dec f a0 b (@app B (f a0 b) (@cons B m (@nil B))) a b) *)
(* BG Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a0 b) *)
+
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a0 b) *)
rewrite update2_diff2; auto using in_or_app.
(* BG Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a b) *)
(* BG Goal: @In B x (@update2 A (list B) A_eq_dec f a0 b (@app B (f a0 b) (@cons B m (@nil B))) a b) *)
+
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 b (@app B (f a0 b) (@cons B m (@nil B))) a b) *)
rewrite update2_diff1; auto using in_or_app.
(* BG Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a b) *)
+
(* Goal: @In B x (@update2 A (list B) A_eq_dec f a0 to (@app B (f a0 to) (@cons B m (@nil B))) a b) *)
rewrite update2_diff1; auto using in_or_app.
Qed.
Lemma collate_ls_neq_to :
forall ns (f : A -> A -> list B) h mg from to,
h <> to ->
collate_ls A_eq_dec ns f h mg from to = f from to.
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (h : A) (mg : B) (from to : A) (_ : not (@eq A h to)), @eq (list B) (@collate_ls A B A_eq_dec ns f h mg from to) (f from to) *)
induction ns; intros; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a ns) f h mg from to) (f from to) *)
simpl in *.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from to) (f from to) *)
rewrite IHns; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B))) from to) (f from to) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A a from) (not (@eq A a from)) (@eq A h to) (not (@eq A h to)) (A_eq_dec a from) (A_eq_dec h to) then @app B (f a h) (@cons B mg (@nil B)) else f from to) (f from to) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f a h) (@cons B mg (@nil B))) (f from to) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f from to) (@cons B mg (@nil B))) (f from to) *)
intuition.
Qed.
Lemma collate_ls_NoDup_in :
forall ns (f : A -> A -> list B) h mg from,
NoDup ns ->
In from ns ->
collate_ls A_eq_dec ns f h mg from h = f from h ++ [mg].
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (h : A) (mg : B) (from : A) (_ : @NoDup A ns) (_ : @In A from ns), @eq (list B) (@collate_ls A B A_eq_dec ns f h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
induction ns; intros; simpl in *; [ intuition | idtac ].
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
invc_NoDup.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
break_or_hyp.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f from h (@app B (f from h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f from h (@app B (f from h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
rewrite collate_ls_not_in; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f from h (@app B (f from h) (@cons B mg (@nil B))) from h) (@app B (f from h) (@cons B mg (@nil B))) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A from from) (not (@eq A from from)) (@eq A h h) (not (@eq A h h)) (A_eq_dec from from) (A_eq_dec h h) then @app B (f from h) (@cons B mg (@nil B)) else f from h) (@app B (f from h) (@cons B mg (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (f from h) (@app B (f from h) (@cons B mg (@nil B))) *)
break_or_hyp; intuition.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
assert (H_neq: a <> from).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
(* Goal: not (@eq A a from) *)
intro.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
(* Goal: False *)
find_rewrite.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
(* Goal: False *)
auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
rewrite IHns; auto.
(* Goal: @eq (list B) (@app B (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B))) from h) (@cons B mg (@nil B))) (@app B (f from h) (@cons B mg (@nil B))) *)
unfold update2.
(* Goal: @eq (list B) (@app B (if sumbool_and (@eq A a from) (not (@eq A a from)) (@eq A h h) (not (@eq A h h)) (A_eq_dec a from) (A_eq_dec h h) then @app B (f a h) (@cons B mg (@nil B)) else f from h) (@cons B mg (@nil B))) (@app B (f from h) (@cons B mg (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (@app B (f a h) (@cons B mg (@nil B))) (@cons B mg (@nil B))) (@app B (f from h) (@cons B mg (@nil B))) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (@app B (f from h) (@cons B mg (@nil B))) (@cons B mg (@nil B))) (@app B (f from h) (@cons B mg (@nil B))) *)
intuition.
Qed.
Lemma collate_ls_live_related :
forall ns (f : A -> A -> list B) ns' h mg from,
~ In from ns' ->
R h from ->
In from ns ->
NoDup ns ->
collate_ls A_eq_dec (filter_rel R_dec h (remove_all A_eq_dec ns' ns)) f h mg from h = f from h ++ [mg].
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (ns' : list A) (h : A) (mg : B) (from : A) (_ : not (@In A from ns')) (_ : R h from) (_ : @In A from ns) (_ : @NoDup A ns), @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
intros.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg from h) (@app B (f from h) (@cons B mg (@nil B))) *)
rewrite collate_ls_NoDup_in; auto.
(* Goal: @In A from (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) *)
(* Goal: @NoDup A (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) *)
-
(* Goal: @NoDup A (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) *)
apply NoDup_filter_rel.
(* Goal: @NoDup A (@remove_all A A_eq_dec ns' ns) *)
apply NoDup_remove_all.
(* Goal: @NoDup A ns *)
assumption.
(* BG Goal: @In A from (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) *)
-
(* Goal: @In A from (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) *)
apply related_filter_rel.
(* Goal: R h from *)
(* Goal: @In A from (@remove_all A A_eq_dec ns' ns) *)
apply in_remove_all_preserve; auto.
(* Goal: R h from *)
assumption.
Qed.
Lemma collate_ls_f_eq :
forall ns (f : A -> A -> list B) g h mg n n',
f n n' = g n n' ->
collate_ls A_eq_dec ns f h mg n n' = collate_ls A_eq_dec ns g h mg n n'.
Proof.
(* Goal: forall (ns : list A) (f g : forall (_ : A) (_ : A), list B) (h : A) (mg : B) (n n' : A) (_ : @eq (list B) (f n n') (g n n')), @eq (list B) (@collate_ls A B A_eq_dec ns f h mg n n') (@collate_ls A B A_eq_dec ns g h mg n n') *)
induction ns; intros; simpl in *; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg n n') (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec g a h (@app B (g a h) (@cons B mg (@nil B)))) h mg n n') *)
set (f' := update2 _ _ _ _ _).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns f' h mg n n') (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec g a h (@app B (g a h) (@cons B mg (@nil B)))) h mg n n') *)
set (g' := update2 _ _ _ _ _).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns f' h mg n n') (@collate_ls A B A_eq_dec ns g' h mg n n') *)
rewrite (IHns f' g'); auto.
(* Goal: @eq (list B) (f' n n') (g' n n') *)
unfold f', g', update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A a n) (not (@eq A a n)) (@eq A h n') (not (@eq A h n')) (A_eq_dec a n) (A_eq_dec h n') then @app B (f a h) (@cons B mg (@nil B)) else f n n') (if sumbool_and (@eq A a n) (not (@eq A a n)) (@eq A h n') (not (@eq A h n')) (A_eq_dec a n) (A_eq_dec h n') then @app B (g a h) (@cons B mg (@nil B)) else g n n') *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f a h) (@cons B mg (@nil B))) (@app B (g a h) (@cons B mg (@nil B))) *)
break_and.
(* Goal: @eq (list B) (@app B (f a h) (@cons B mg (@nil B))) (@app B (g a h) (@cons B mg (@nil B))) *)
subst.
(* Goal: @eq (list B) (@app B (f n n') (@cons B mg (@nil B))) (@app B (g n n') (@cons B mg (@nil B))) *)
find_rewrite.
(* Goal: @eq (list B) (@app B (g n n') (@cons B mg (@nil B))) (@app B (g n n') (@cons B mg (@nil B))) *)
trivial.
Qed.
Lemma collate_ls_neq_update2 :
forall ns (f : A -> A -> list B) n h h' ms mg,
n <> h' ->
collate_ls A_eq_dec ns (update2 A_eq_dec f n h ms) h mg h' h = collate_ls A_eq_dec ns f h mg h' h.
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (n h h' : A) (ms : list B) (mg : B) (_ : not (@eq A n h')), @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
intros.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
assert (H_eq: update2 A_eq_dec f n h ms h' h = f h' h).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f n h ms h' h) (f h' h) *)
unfold update2.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
(* Goal: @eq (list B) (if sumbool_and (@eq A n h') (not (@eq A n h')) (@eq A h h) (not (@eq A h h)) (A_eq_dec n h') (A_eq_dec h h) then ms else f h' h) (f h' h) *)
break_if; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
(* Goal: @eq (list B) ms (f h' h) *)
break_and.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
(* Goal: @eq (list B) ms (f h' h) *)
subst.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
(* Goal: @eq (list B) ms (f h' h) *)
intuition.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns (@update2 A (list B) A_eq_dec f n h ms) h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
rewrite (collate_ls_f_eq _ _ _ _ _ _ _ H_eq).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec ns f h mg h' h) (@collate_ls A B A_eq_dec ns f h mg h' h) *)
trivial.
Qed.
Lemma collate_ls_cases :
forall s (f : A -> A -> list B) to m a b,
collate_ls A_eq_dec s f to m a b = f a b \/
exists l,
(forall x, In x l -> x = m) /\
collate_ls A_eq_dec s f to m a b = f a b ++ l.
Proof.
(* Goal: forall (s : list A) (f : forall (_ : A) (_ : A), list B) (to : A) (m : B) (a b : A), or (@eq (list B) (@collate_ls A B A_eq_dec s f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s f to m a b) (@app B (f a b) l)))) *)
intros.
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s f to m a b) (@app B (f a b) l)))) *)
generalize dependent f.
(* Goal: forall f : forall (_ : A) (_ : A), list B, or (@eq (list B) (@collate_ls A B A_eq_dec s f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s f to m a b) (@app B (f a b) l)))) *)
induction s as [|n s].
(* Goal: forall f : forall (_ : A) (_ : A), list B, or (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (@app B (f a b) l)))) *)
(* Goal: forall f : forall (_ : A) (_ : A), list B, or (@eq (list B) (@collate_ls A B A_eq_dec (@nil A) f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec (@nil A) f to m a b) (@app B (f a b) l)))) *)
-
(* Goal: forall f : forall (_ : A) (_ : A), list B, or (@eq (list B) (@collate_ls A B A_eq_dec (@nil A) f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec (@nil A) f to m a b) (@app B (f a b) l)))) *)
auto.
(* BG Goal: forall f : forall (_ : A) (_ : A), list B, or (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (@app B (f a b) l)))) *)
-
(* Goal: forall f : forall (_ : A) (_ : A), list B, or (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (@app B (f a b) l)))) *)
intros.
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec (@cons A n s) f to m a b) (@app B (f a b) l)))) *)
simpl in *.
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
destruct (A_eq_dec b to), (A_eq_dec n a); subst.
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
+
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
specialize (IHs (update2 A_eq_dec f a to (f a to ++ [m]))); break_or_hyp.
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
*
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
find_rewrite.
(* Goal: or (@eq (list B) (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B))) a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B))) a to) (@app B (f a to) l)))) *)
rewrite update2_eq; eauto.
(* Goal: or (@eq (list B) (@app B (f a to) (@cons B m (@nil B))) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@app B (f a to) (@cons B m (@nil B))) (@app B (f a to) l)))) *)
right; eexists; intuition.
(* Goal: @eq B x m *)
find_apply_lem_hyp in_inv; break_or_hyp; [|exfalso]; eauto using in_nil.
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
*
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
break_exists_name l; break_and.
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
repeat find_rewrite.
(* Goal: or (@eq (list B) (@app B (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B))) a to) l) (f a to)) (@ex (list B) (fun l0 : list B => and (forall (x : B) (_ : @In B x l0), @eq B x m) (@eq (list B) (@app B (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B))) a to) l) (@app B (f a to) l0)))) *)
rewrite update2_same.
(* Goal: or (@eq (list B) (@app B (@app B (f a to) (@cons B m (@nil B))) l) (f a to)) (@ex (list B) (fun l0 : list B => and (forall (x : B) (_ : @In B x l0), @eq B x m) (@eq (list B) (@app B (@app B (f a to) (@cons B m (@nil B))) l) (@app B (f a to) l0)))) *)
right; exists (m :: l).
(* Goal: and (forall (x : B) (_ : @In B x (@cons B m l)), @eq B x m) (@eq (list B) (@app B (@app B (f a to) (@cons B m (@nil B))) l) (@app B (f a to) (@cons B m l))) *)
split.
(* Goal: @eq (list B) (@app B (@app B (f a to) (@cons B m (@nil B))) l) (@app B (f a to) (@cons B m l)) *)
(* Goal: forall (x : B) (_ : @In B x (@cons B m l)), @eq B x m *)
--
(* Goal: forall (x : B) (_ : @In B x (@cons B m l)), @eq B x m *)
intros; find_apply_lem_hyp in_inv; intuition.
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
(* BG Goal: @eq (list B) (@app B (@app B (f a to) (@cons B m (@nil B))) l) (@app B (f a to) (@cons B m l)) *)
--
(* Goal: @eq (list B) (@app B (@app B (f a to) (@cons B m (@nil B))) l) (@app B (f a to) (@cons B m l)) *)
rewrite <- app_assoc; auto.
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
+
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (f a to)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a to) (@app B (f a to) l)))) *)
rewrite collate_ls_neq_update2; auto.
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
+
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f a to (@app B (f a to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
rewrite collate_ls_neq_to, update2_diff2; auto.
(* BG Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
+
(* Goal: or (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (f a b)) (@ex (list B) (fun l : list B => and (forall (x : B) (_ : @In B x l), @eq B x m) (@eq (list B) (@collate_ls A B A_eq_dec s (@update2 A (list B) A_eq_dec f n to (@app B (f n to) (@cons B m (@nil B)))) to m a b) (@app B (f a b) l)))) *)
rewrite collate_ls_neq_to, update2_diff2; auto.
Qed.
Lemma collate_ls_in_neq_in_before :
forall s (f : A -> A -> list B) to m a b x,
In x (collate_ls A_eq_dec s f to m a b) ->
x <> m ->
In x (f a b).
Proof.
(* Goal: forall (s : list A) (f : forall (_ : A) (_ : A), list B) (to : A) (m : B) (a b : A) (x : B) (_ : @In B x (@collate_ls A B A_eq_dec s f to m a b)) (_ : not (@eq B x m)), @In B x (f a b) *)
intros.
(* Goal: @In B x (f a b) *)
pose proof (collate_ls_cases s f to m a b); break_or_hyp.
(* Goal: @In B x (f a b) *)
(* Goal: @In B x (f a b) *)
-
(* Goal: @In B x (f a b) *)
now find_rewrite.
(* BG Goal: @In B x (f a b) *)
-
(* Goal: @In B x (f a b) *)
break_exists; break_and.
(* Goal: @In B x (f a b) *)
find_rewrite.
(* Goal: @In B x (f a b) *)
find_apply_lem_hyp in_app_or; break_or_hyp; auto.
(* Goal: @In B x (f a b) *)
find_apply_hyp_hyp; congruence.
Qed.
Lemma collate_ls_not_related :
forall ns (f : A -> A -> list B) n h mg,
~ R h n ->
collate_ls A_eq_dec (filter_rel R_dec h ns) f h mg n h = f n h.
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (n h : A) (mg : B) (_ : not (R h n)), @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
induction ns; intros; simpl in *; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
case (A_eq_dec n a); intro.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
subst.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) f h mg a h) (f a h) *)
break_if; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a (@filter_rel A R R_dec h ns)) f h mg a h) (f a h) *)
intuition.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h ns) else @filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
break_if; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a (@filter_rel A R R_dec h ns)) f h mg n h) (f n h) *)
simpl.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h ns) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg n h) (f n h) *)
rewrite IHns; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B))) n h) (f n h) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A a n) (not (@eq A a n)) (@eq A h h) (not (@eq A h h)) (A_eq_dec a n) (A_eq_dec h h) then @app B (f a h) (@cons B mg (@nil B)) else f n h) (f n h) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f a h) (@cons B mg (@nil B))) (f n h) *)
break_and.
(* Goal: @eq (list B) (@app B (f a h) (@cons B mg (@nil B))) (f n h) *)
subst.
(* Goal: @eq (list B) (@app B (f n h) (@cons B mg (@nil B))) (f n h) *)
intuition.
Qed.
Lemma collate_ls_not_in_related :
forall ns (f : A -> A -> list B) n h mg,
~ In n ns ->
collate_ls A_eq_dec (filter_rel R_dec h ns) f h mg n h = f n h.
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (n h : A) (mg : B) (_ : not (@In A n ns)), @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
intros.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h ns) f h mg n h) (f n h) *)
rewrite collate_ls_not_in; auto.
(* Goal: not (@In A n (@filter_rel A R R_dec h ns)) *)
apply not_in_not_in_filter_rel.
(* Goal: not (@In A n ns) *)
assumption.
Qed.
Lemma collate_ls_not_in_related_remove_all :
forall ns (f : A -> A -> list B) n h mg ns',
~ In n ns ->
collate_ls A_eq_dec (filter_rel R_dec h (remove_all A_eq_dec ns' ns)) f h mg n h = f n h.
Proof.
(* Goal: forall (ns : list A) (f : forall (_ : A) (_ : A), list B) (n h : A) (mg : B) (ns' : list A) (_ : not (@In A n ns)), @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
intros.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
rewrite collate_ls_not_in; auto.
(* Goal: not (@In A n (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) *)
apply not_in_not_in_filter_rel.
(* Goal: not (@In A n (@remove_all A A_eq_dec ns' ns)) *)
intro.
(* Goal: False *)
contradict H.
(* Goal: @In A n ns *)
eapply in_remove_all_was_in; eauto.
Qed.
Lemma collate_ls_in_remove_all :
forall mg n h ns (f : A -> A -> list B) ns',
In n ns' ->
collate_ls A_eq_dec (filter_rel R_dec h (remove_all A_eq_dec ns' ns)) f h mg n h = f n h.
Proof.
(* Goal: forall (mg : B) (n h : A) (ns : list A) (f : forall (_ : A) (_ : A), list B) (ns' : list A) (_ : @In A n ns'), @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
intros.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
revert f.
(* Goal: forall f : forall (_ : A) (_ : A), list B, @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
induction ns; intros.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns))) f h mg n h) (f n h) *)
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@nil A))) f h mg n h) (f n h) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@nil A))) f h mg n h) (f n h) *)
rewrite remove_all_nil.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@nil A)) f h mg n h) (f n h) *)
trivial.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns))) f h mg n h) (f n h) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns))) f h mg n h) (f n h) *)
pose proof (remove_all_cons A_eq_dec ns' a ns) as H_cn.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' (@cons A a ns))) f h mg n h) (f n h) *)
break_or_hyp; break_and; find_rewrite.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@cons A a (@remove_all A A_eq_dec ns' ns))) f h mg n h) (f n h) *)
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
*
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
rewrite IHns.
(* Goal: @eq (list B) (f n h) (f n h) *)
trivial.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@cons A a (@remove_all A A_eq_dec ns' ns))) f h mg n h) (f n h) *)
*
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@cons A a (@remove_all A A_eq_dec ns' ns))) f h mg n h) (f n h) *)
simpl in *.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (if R_dec h a then @cons A a (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) else @filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) f h mg n h) (f n h) *)
break_if; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@cons A a (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns))) f h mg n h) (f n h) *)
simpl.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg n h) (f n h) *)
assert (H_neq: a <> n).
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg n h) (f n h) *)
(* Goal: not (@eq A a n) *)
intro.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg n h) (f n h) *)
(* Goal: False *)
subst.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg n h) (f n h) *)
(* Goal: False *)
intuition.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@filter_rel A R R_dec h (@remove_all A A_eq_dec ns' ns)) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B)))) h mg n h) (f n h) *)
rewrite IHns.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B mg (@nil B))) n h) (f n h) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A a n) (not (@eq A a n)) (@eq A h h) (not (@eq A h h)) (A_eq_dec a n) (A_eq_dec h h) then @app B (f a h) (@cons B mg (@nil B)) else f n h) (f n h) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f a h) (@cons B mg (@nil B))) (f n h) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f n h) (@cons B mg (@nil B))) (f n h) *)
intuition.
Qed.
Lemma collate_ls_app :
forall l1 l2 (f : A -> A -> list B) h m,
collate_ls A_eq_dec (l1 ++ l2) f h m = collate_ls A_eq_dec l2 (collate_ls A_eq_dec l1 f h m) h m.
Proof.
(* Goal: forall (l1 l2 : list A) (f : forall (_ : A) (_ : A), list B) (h : A) (m : B), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@app A l1 l2) f h m) (@collate_ls A B A_eq_dec l2 (@collate_ls A B A_eq_dec l1 f h m) h m) *)
induction l1; simpl in *; intuition eauto.
Qed.
Lemma collate_ls_split_eq :
forall l1 l2 (f : A -> A -> list B) h m from to,
h <> from ->
collate_ls A_eq_dec (l1 ++ h :: l2) f to m from to =
collate_ls A_eq_dec (l1 ++ l2) f to m from to.
Proof.
(* Goal: forall (l1 l2 : list A) (f : forall (_ : A) (_ : A), list B) (h : A) (m : B) (from to : A) (_ : not (@eq A h from)), @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h l2)) f to m from to) (@collate_ls A B A_eq_dec (@app A l1 l2) f to m from to) *)
induction l1; simpl in *; auto.
(* Goal: forall (l2 : list A) (f : forall (_ : A) (_ : A), list B) (h : A) (m : B) (from to : A) (_ : not (@eq A h from)), @eq (list B) (@collate_ls A B A_eq_dec l2 (@update2 A (list B) A_eq_dec f h to (@app B (f h to) (@cons B m (@nil B)))) to m from to) (@collate_ls A B A_eq_dec l2 f to m from to) *)
intros.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec l2 (@update2 A (list B) A_eq_dec f h to (@app B (f h to) (@cons B m (@nil B)))) to m from to) (@collate_ls A B A_eq_dec l2 f to m from to) *)
apply collate_ls_f_eq.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h to (@app B (f h to) (@cons B m (@nil B))) from to) (f from to) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h from) (not (@eq A h from)) (@eq A to to) (not (@eq A to to)) (A_eq_dec h from) (A_eq_dec to to) then @app B (f h to) (@cons B m (@nil B)) else f from to) (f from to) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h to) (@cons B m (@nil B))) (f from to) *)
break_and.
(* Goal: @eq (list B) (@app B (f h to) (@cons B m (@nil B))) (f from to) *)
subst.
(* Goal: @eq (list B) (@app B (f from to) (@cons B m (@nil B))) (f from to) *)
intuition.
Qed.
Lemma collate_ls_not_in_mid :
forall h h' l1 l2 (f : A -> A -> list B) m,
~ In h' (l1 ++ l2) ->
collate_ls A_eq_dec (l1 ++ l2) (update2 A_eq_dec f h' h (f h' h ++ [m])) h m = collate_ls A_eq_dec (l1 ++ h' :: l2) f h m.
Proof.
(* Goal: forall (h h' : A) (l1 l2 : list A) (f : forall (_ : A) (_ : A), list B) (m : B) (_ : not (@In A h' (@app A l1 l2))), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m) *)
intros h h' l1 l2 f m H_in.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m) *)
apply functional_extensionality; intro from.
(* Goal: @eq (forall _ : A, list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from) *)
apply functional_extensionality; intro to.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
case (A_eq_dec h' from); intro H_dec; case (A_eq_dec h to); intro H_dec'.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
rewrite <- H_dec.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m h' to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m h' to) *)
rewrite <- H_dec'.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m h' h) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m h' h) *)
rewrite collate_ls_not_in; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m h' h) *)
rewrite collate_ls_app; simpl.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@collate_ls A B A_eq_dec l2 (@update2 A (list B) A_eq_dec (@collate_ls A B A_eq_dec l1 f h m) h' h (@app B (@collate_ls A B A_eq_dec l1 f h m h' h) (@cons B m (@nil B)))) h m h' h) *)
set (f' := collate_ls _ l1 _ _ _).
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@collate_ls A B A_eq_dec l2 (@update2 A (list B) A_eq_dec f' h' h (@app B (f' h' h) (@cons B m (@nil B)))) h m h' h) *)
rewrite collate_ls_not_in.
(* Goal: not (@In A h' l2) *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@update2 A (list B) A_eq_dec f' h' h (@app B (f' h' h) (@cons B m (@nil B))) h' h) *)
*
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@update2 A (list B) A_eq_dec f' h' h (@app B (f' h' h) (@cons B m (@nil B))) h' h) *)
unfold update2 at 2.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (if sumbool_and (@eq A h' h') (not (@eq A h' h')) (@eq A h h) (not (@eq A h h)) (A_eq_dec h' h') (A_eq_dec h h) then @app B (f' h' h) (@cons B m (@nil B)) else f' h' h) *)
break_if.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (f' h' h) *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@app B (f' h' h) (@cons B m (@nil B))) *)
+
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@app B (f' h' h) (@cons B m (@nil B))) *)
unfold f'.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@app B (@collate_ls A B A_eq_dec l1 f h m h' h) (@cons B m (@nil B))) *)
rewrite collate_ls_not_in.
(* Goal: not (@In A h' l1) *)
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@app B (f h' h) (@cons B m (@nil B))) *)
--
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (@app B (f h' h) (@cons B m (@nil B))) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h' h') (not (@eq A h' h')) (@eq A h h) (not (@eq A h h)) (A_eq_dec h' h') (A_eq_dec h h) then @app B (f h' h) (@cons B m (@nil B)) else f h' h) (@app B (f h' h) (@cons B m (@nil B))) *)
break_if; auto.
(* Goal: @eq (list B) (f h' h) (@app B (f h' h) (@cons B m (@nil B))) *)
break_or_hyp; intuition.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: not (@In A h' l2) *)
(* BG Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (f' h' h) *)
(* BG Goal: not (@In A h' l1) *)
--
(* Goal: not (@In A h' l1) *)
intro.
(* Goal: False *)
contradict H_in.
(* Goal: @In A h' (@app A l1 l2) *)
apply in_or_app.
(* Goal: or (@In A h' l1) (@In A h' l2) *)
left.
(* Goal: @In A h' l1 *)
assumption.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: not (@In A h' l2) *)
(* BG Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (f' h' h) *)
+
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) h' h) (f' h' h) *)
break_or_hyp; intuition.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: not (@In A h' l2) *)
*
(* Goal: not (@In A h' l2) *)
intro.
(* Goal: False *)
contradict H_in.
(* Goal: @In A h' (@app A l1 l2) *)
apply in_or_app.
(* Goal: or (@In A h' l1) (@In A h' l2) *)
right.
(* Goal: @In A h' l2 *)
assumption.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
rewrite collate_ls_neq_to; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
rewrite collate_ls_neq_to; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) from to) (f from to) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h' from) (not (@eq A h' from)) (@eq A h to) (not (@eq A h to)) (A_eq_dec h' from) (A_eq_dec h to) then @app B (f h' h) (@cons B m (@nil B)) else f from to) (f from to) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h' h) (@cons B m (@nil B))) (f from to) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f from to) (@cons B m (@nil B))) (f from to) *)
intuition.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
rewrite H_dec'.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' to (@app B (f h' to) (@cons B m (@nil B)))) to m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f to m from to) *)
rewrite collate_ls_neq_update2; auto.
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) f to m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f to m from to) *)
rewrite collate_ls_split_eq; auto.
(* BG Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
-
(* Goal: @eq (list B) (@collate_ls A B A_eq_dec (@app A l1 l2) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B)))) h m from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
rewrite collate_ls_neq_to; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) from to) (@collate_ls A B A_eq_dec (@app A l1 (@cons A h' l2)) f h m from to) *)
rewrite collate_ls_neq_to; auto.
(* Goal: @eq (list B) (@update2 A (list B) A_eq_dec f h' h (@app B (f h' h) (@cons B m (@nil B))) from to) (f from to) *)
unfold update2.
(* Goal: @eq (list B) (if sumbool_and (@eq A h' from) (not (@eq A h' from)) (@eq A h to) (not (@eq A h to)) (A_eq_dec h' from) (A_eq_dec h to) then @app B (f h' h) (@cons B m (@nil B)) else f from to) (f from to) *)
break_if; auto.
(* Goal: @eq (list B) (@app B (f h' h) (@cons B m (@nil B))) (f from to) *)
break_and; subst.
(* Goal: @eq (list B) (@app B (f from to) (@cons B m (@nil B))) (f from to) *)
intuition.
Qed.
Lemma NoDup_Permutation_collate_ls_eq :
forall l (f : A -> A -> list B) h m l',
NoDup l ->
Permutation l l' ->
collate_ls A_eq_dec l f h m = collate_ls A_eq_dec l' f h m.
Proof.
(* Goal: forall (l : list A) (f : forall (_ : A) (_ : A), list B) (h : A) (m : B) (l' : list A) (_ : @NoDup A l) (_ : @Permutation A l l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l f h m) (@collate_ls A B A_eq_dec l' f h m) *)
intros l f h m l'.
(* Goal: forall (_ : @NoDup A l) (_ : @Permutation A l l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l f h m) (@collate_ls A B A_eq_dec l' f h m) *)
revert f l'.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (l' : list A) (_ : @NoDup A l) (_ : @Permutation A l l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l f h m) (@collate_ls A B A_eq_dec l' f h m) *)
induction l.
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (l' : list A) (_ : @NoDup A (@cons A a l)) (_ : @Permutation A (@cons A a l) l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@cons A a l) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (l' : list A) (_ : @NoDup A (@nil A)) (_ : @Permutation A (@nil A) l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@nil A) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
-
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (l' : list A) (_ : @NoDup A (@nil A)) (_ : @Permutation A (@nil A) l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@nil A) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
intros.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@nil A) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
find_apply_lem_hyp Permutation_nil.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@nil A) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
subst.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@nil A) f h m) (@collate_ls A B A_eq_dec (@nil A) f h m) *)
trivial.
(* BG Goal: forall (f : forall (_ : A) (_ : A), list B) (l' : list A) (_ : @NoDup A (@cons A a l)) (_ : @Permutation A (@cons A a l) l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@cons A a l) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
-
(* Goal: forall (f : forall (_ : A) (_ : A), list B) (l' : list A) (_ : @NoDup A (@cons A a l)) (_ : @Permutation A (@cons A a l) l'), @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@cons A a l) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
intros.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@cons A a l) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
invc_NoDup.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@cons A a l) f h m) (@collate_ls A B A_eq_dec l' f h m) *)
simpl in *.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec l' f h m) *)
assert (H_in: In a (a :: l)).
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec l' f h m) *)
(* Goal: @In A a (@cons A a l) *)
left.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec l' f h m) *)
(* Goal: @eq A a a *)
trivial.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec l' f h m) *)
pose proof (Permutation_in _ H0 H_in) as H_pm'.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec l' f h m) *)
find_apply_lem_hyp in_split.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec l' f h m) *)
break_exists.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec l' f h m) *)
subst_max.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec (@app A x (@cons A a x0)) f h m) *)
find_apply_lem_hyp Permutation_cons_app_inv.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec (@app A x (@cons A a x0)) f h m) *)
set (f' := update2 _ _ _ _ _).
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec l f' h m) (@collate_ls A B A_eq_dec (@app A x (@cons A a x0)) f h m) *)
rewrite (IHl f' _ H4 H0); auto.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@app A x x0) f' h m) (@collate_ls A B A_eq_dec (@app A x (@cons A a x0)) f h m) *)
unfold f'.
(* Goal: @eq (forall (_ : A) (_ : A), list B) (@collate_ls A B A_eq_dec (@app A x x0) (@update2 A (list B) A_eq_dec f a h (@app B (f a h) (@cons B m (@nil B)))) h m) (@collate_ls A B A_eq_dec (@app A x (@cons A a x0)) f h m) *)
rewrite collate_ls_not_in_mid; auto.
(* Goal: not (@In A a (@app A x x0)) *)
intro.
(* Goal: False *)
contradict H3.
(* Goal: @In A a l *)
revert H.
(* Goal: forall _ : @In A a (@app A x x0), @In A a l *)
apply Permutation_in.
(* Goal: @Permutation A (@app A x x0) l *)
apply Permutation_sym.
(* Goal: @Permutation A l (@app A x x0) *)
assumption.
Qed.
End Update2Rel.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrbool ssrfun eqtype ssrnat seq path div choice.
From mathcomp
Require Import fintype bigop ssralg finset fingroup morphism perm.
From mathcomp
Require Import finalg action gproduct commutator cyclic.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GroupScope GRing.Theory FinRing.Theory.
Local Open Scope ring_scope.
Module FiniteModule.
Reserved Notation "u ^@ x" (at level 31, left associativity).
Inductive fmod_of (gT : finGroupType) (A : {group gT}) (abelA : abelian A) :=
Fmod x & x \in A.
Bind Scope ring_scope with fmod_of.
Section OneFinMod.
Let f2sub (gT : finGroupType) (A : {group gT}) (abA : abelian A) :=
fun u : fmod_of abA => let : Fmod x Ax := u in Subg Ax : FinGroup.arg_sort _.
Local Coercion f2sub : fmod_of >-> FinGroup.arg_sort.
Variables (gT : finGroupType) (A : {group gT}) (abelA : abelian A).
Local Notation fmodA := (fmod_of abelA).
Implicit Types (x y z : gT) (u v w : fmodA).
Let sub2f (s : [subg A]) := Fmod abelA (valP s).
Definition fmval u := val (f2sub u).
Canonical fmod_subType := [subType for fmval].
Local Notation valA := (@val _ _ fmod_subType) (only parsing).
Definition fmod_eqMixin := Eval hnf in [eqMixin of fmodA by <:].
Canonical fmod_eqType := Eval hnf in EqType fmodA fmod_eqMixin.
Definition fmod_choiceMixin := [choiceMixin of fmodA by <:].
Canonical fmod_choiceType := Eval hnf in ChoiceType fmodA fmod_choiceMixin.
Definition fmod_countMixin := [countMixin of fmodA by <:].
Canonical fmod_countType := Eval hnf in CountType fmodA fmod_countMixin.
Canonical fmod_subCountType := Eval hnf in [subCountType of fmodA].
Definition fmod_finMixin := [finMixin of fmodA by <:].
Canonical fmod_finType := Eval hnf in FinType fmodA fmod_finMixin.
Canonical fmod_subFinType := Eval hnf in [subFinType of fmodA].
Definition fmod x := sub2f (subg A x).
Definition actr u x := if x \in 'N(A) then fmod (fmval u ^ x) else u.
Definition fmod_opp u := sub2f u^-1.
Definition fmod_add u v := sub2f (u * v).
Fact fmod_add0r : left_id (sub2f 1) fmod_add.
Proof.
(* Goal: @left_id (@fmod_of gT A abelA) (@fmod_of gT A abelA) (sub2f (oneg (@subBaseFinGroupType gT A))) fmod_add *)
by move=> u; apply: val_inj; apply: mul1g.
Qed.
Fact fmod_addrA : associative fmod_add.
Proof.
(* Goal: @associative (@fmod_of gT A abelA) fmod_add *)
by move=> u v w; apply: val_inj; apply: mulgA.
Qed.
Fact fmod_addNr : left_inverse (sub2f 1) fmod_opp fmod_add.
Proof.
(* Goal: @left_inverse (@fmod_of gT A abelA) (@fmod_of gT A abelA) (@fmod_of gT A abelA) (sub2f (oneg (@subBaseFinGroupType gT A))) fmod_opp fmod_add *)
by move=> u; apply: val_inj; apply: mulVg.
Qed.
Fact fmod_addrC : commutative fmod_add.
Proof.
(* Goal: @commutative (@fmod_of gT A abelA) (@fmod_of gT A abelA) fmod_add *)
by case=> x Ax [y Ay]; apply: val_inj; apply: (centsP abelA).
Qed.
Definition fmod_zmodMixin :=
ZmodMixin fmod_addrA fmod_addrC fmod_add0r fmod_addNr.
Canonical fmod_zmodType := Eval hnf in ZmodType fmodA fmod_zmodMixin.
Canonical fmod_finZmodType := Eval hnf in [finZmodType of fmodA].
Canonical fmod_baseFinGroupType :=
Eval hnf in [baseFinGroupType of fmodA for +%R].
Canonical fmod_finGroupType :=
Eval hnf in [finGroupType of fmodA for +%R].
Lemma fmodP u : val u \in A. Proof. exact: valP. Qed.
Proof.
(* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType 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 A)))) *)
exact: valP.
Qed.
Lemma congr_fmod u v : u = v -> fmval u = fmval v.
Proof.
(* Goal: forall _ : @eq (@fmod_of gT A abelA) u v, @eq (FinGroup.arg_sort (FinGroup.base gT)) (fmval u) (fmval v) *)
exact: congr1.
Qed.
Lemma fmvalN : {morph valA : x / - x >-> x^-1%g}. Proof. by []. Qed.
Proof.
(* Goal: @morphism_1 (@sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType) (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType) (fun x : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType => @GRing.opp fmod_zmodType x) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @invg (FinGroup.base gT) x) *)
by [].
Qed.
Canonical fmval_morphism := @Morphism _ _ setT fmval (in2W fmvalA).
Definition fmval_sum := big_morph fmval fmvalA fmval0.
Lemma fmvalZ n : {morph valA : x / x *+ n >-> (x ^+ n)%g}.
Proof.
(* Goal: @morphism_1 (@sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType) (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType) (fun x : @sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType => @GRing.natmul fmod_zmodType x n) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x n) *)
by move=> u; rewrite /= morphX ?inE.
Qed.
Lemma fmodKcond x : val (fmod x) = if x \in A then x else 1%g.
Proof.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType (fmod x)) (if @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 A))) then x else oneg (FinGroup.base gT)) *)
by rewrite /= /fmval /= val_insubd.
Qed.
Lemma fmvalK : cancel val fmod.
Proof.
(* Goal: @cancel (FinGroup.arg_sort (FinGroup.base gT)) (@sub_sort (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType) fmod *)
by case=> x Ax; apply: val_inj; rewrite /fmod /= sgvalK.
Qed.
Lemma fmodM : {in A &, {morph fmod : x y / (x * y)%g >-> x + y}}.
Proof.
(* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (@fmod_of gT A abelA) (fmod ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : @fmod_of gT A abelA => @GRing.add fmod_zmodType x0 y0) (fmod x) (fmod y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (@fmod_of gT A abelA) fmod (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : @fmod_of gT A abelA => @GRing.add fmod_zmodType x y))) *)
by move=> x y Ax Ay /=; apply: val_inj; rewrite /fmod morphM.
Qed.
Canonical fmod_morphism := Morphism fmodM.
Lemma fmodX n : {in A, {morph fmod : x / (x ^+ n)%g >-> x *+ n}}.
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 A))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (@fmod_of gT A abelA) (fmod ((fun x0 : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x0 n) x)) ((fun x0 : @fmod_of gT A abelA => @GRing.natmul fmod_zmodType x0 n) (fmod x))) (inPhantom (@morphism_1 (FinGroup.arg_sort (FinGroup.base gT)) (@fmod_of gT A abelA) fmod (fun x : FinGroup.arg_sort (FinGroup.base gT) => @expgn (FinGroup.base gT) x n) (fun x : @fmod_of gT A abelA => @GRing.natmul fmod_zmodType x n))) *)
exact: morphX.
Qed.
Lemma fmodV : {morph fmod : x / x^-1%g >-> - x}.
Proof.
(* Goal: @morphism_1 (FinGroup.arg_sort (FinGroup.base gT)) (@fmod_of gT A abelA) fmod (fun x : FinGroup.arg_sort (FinGroup.base gT) => @invg (FinGroup.base gT) x) (fun x : @fmod_of gT A abelA => @GRing.opp fmod_zmodType x) *)
move=> x; apply: val_inj; rewrite fmvalN !fmodKcond groupV.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (if @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 A))) then @invg (FinGroup.base gT) x else oneg (FinGroup.base gT)) (@invg (FinGroup.base gT) (if @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 A))) then x else oneg (FinGroup.base gT))) *)
by case: (x \in A); rewrite ?invg1.
Qed.
Lemma injm_fmod : 'injm fmod.
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 fmod_finGroupType (@gval gT A) fmod_morphism (@MorPhantom gT fmod_finGroupType fmod)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
by apply/injmP=> x y Ax Ay []; move/val_inj; apply: (injmP (injm_subg A)).
Qed.
Notation "u ^@ x" := (actr u x) : ring_scope.
Lemma fmvalJcond u x :
val (u ^@ x) = if x \in 'N(A) then val u ^ x else val u.
Proof.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType (actr u x)) (if @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 A)))) then @conjg gT (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) x else @val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) *)
by case: ifP => Nx; rewrite /actr Nx ?fmodK // memJ_norm ?fmodP.
Qed.
Lemma fmvalJ u x : x \in 'N(A) -> val (u ^@ x) = val u ^ 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)) (@normaliser gT (@gval gT A))))), @eq (FinGroup.arg_sort (FinGroup.base gT)) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType (actr u x)) (@conjg gT (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) x) *)
by move=> Nx; rewrite fmvalJcond Nx.
Qed.
Lemma fmodJ x y : y \in 'N(A) -> fmod (x ^ y) = fmod x ^@ y.
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)) (@normaliser gT (@gval gT A))))), @eq (@fmod_of gT A abelA) (fmod (@conjg gT x y)) (actr (fmod x) y) *)
move=> Ny; apply: val_inj; rewrite fmvalJ ?fmodKcond ?memJ_norm //.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (if @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 A))) then @conjg gT x y else oneg (FinGroup.base gT)) (@conjg gT (if @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 A))) then x else oneg (FinGroup.base gT)) y) *)
by case: ifP => // _; rewrite conj1g.
Qed.
Fact actr_is_action : is_action 'N(A) actr.
Proof.
(* Goal: @is_action gT (@normaliser gT (@gval gT A)) (@fmod_of gT A abelA) actr *)
split=> [a u v eq_uv_a | u a b Na Nb].
(* Goal: @eq (@fmod_of gT A abelA) (actr u (@mulg (FinGroup.base gT) a b)) (actr (actr u a) b) *)
(* Goal: @eq (@fmod_of gT A abelA) u v *)
case Na: (a \in 'N(A)); last by rewrite /actr Na in eq_uv_a.
(* Goal: @eq (@fmod_of gT A abelA) (actr u (@mulg (FinGroup.base gT) a b)) (actr (actr u a) b) *)
(* Goal: @eq (@fmod_of gT A abelA) u v *)
by apply: val_inj; apply: (conjg_inj a); rewrite -!fmvalJ ?eq_uv_a.
(* Goal: @eq (@fmod_of gT A abelA) (actr u (@mulg (FinGroup.base gT) a b)) (actr (actr u a) b) *)
by apply: val_inj; rewrite !fmvalJ ?groupM ?conjgM.
Qed.
Canonical actr_action := Action actr_is_action.
Notation "''M'" := actr_action (at level 8) : action_scope.
Lemma act0r x : 0 ^@ x = 0.
Proof.
(* Goal: @eq (@fmod_of gT A abelA) (actr (GRing.zero fmod_zmodType) x) (GRing.zero fmod_zmodType) *)
by rewrite /actr conj1g morph1 if_same.
Qed.
Lemma actAr x : {morph actr^~ x : u v / u + v}.
Proof.
(* Goal: @morphism_2 (@fmod_of gT A abelA) (@fmod_of gT A abelA) (fun x0 : @fmod_of gT A abelA => actr x0 x) (fun u v : @fmod_of gT A abelA => @GRing.add fmod_zmodType u v) (fun u v : @fmod_of gT A abelA => @GRing.add fmod_zmodType u v) *)
by move=> u v; apply: val_inj; rewrite !(fmvalA, fmvalJcond) conjMg; case: ifP.
Qed.
Definition actr_sum x := big_morph _ (actAr x) (act0r x).
Lemma actNr x : {morph actr^~ x : u / - u}.
Proof.
(* Goal: @morphism_1 (@fmod_of gT A abelA) (@fmod_of gT A abelA) (fun x0 : @fmod_of gT A abelA => actr x0 x) (fun u : @fmod_of gT A abelA => @GRing.opp fmod_zmodType u) (fun u : @fmod_of gT A abelA => @GRing.opp fmod_zmodType u) *)
by move=> u; apply: (addrI (u ^@ x)); rewrite -actAr !subrr act0r.
Qed.
Lemma actZr x n : {morph actr^~ x : u / u *+ n}.
Proof.
(* Goal: @morphism_1 (@fmod_of gT A abelA) (@fmod_of gT A abelA) (fun x0 : @fmod_of gT A abelA => actr x0 x) (fun u : @fmod_of gT A abelA => @GRing.natmul fmod_zmodType u n) (fun u : @fmod_of gT A abelA => @GRing.natmul fmod_zmodType u n) *)
by move=> u; elim: n => [|n IHn]; rewrite ?act0r // !mulrS actAr IHn.
Qed.
Fact actr_is_groupAction : is_groupAction setT 'M.
Proof.
(* Goal: @is_groupAction gT fmod_finGroupType (@normaliser gT (@gval gT A)) (@setTfor (FinGroup.arg_finType (FinGroup.base fmod_finGroupType)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base fmod_finGroupType))))) actr_action *)
move=> a Na /=; rewrite inE; apply/andP; split.
(* Goal: is_true (@morphic fmod_finGroupType fmod_finGroupType (@setTfor (FinGroup.arg_finType fmod_baseFinGroupType) (Phant (@fmod_of gT A abelA))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base fmod_finGroupType)) (@actperm gT (@normaliser gT (@gval gT A)) (FinGroup.arg_finType fmod_baseFinGroupType) actr_action a))) *)
(* Goal: is_true (@perm_on (FinGroup.arg_finType (FinGroup.base fmod_finGroupType)) (@setTfor (FinGroup.arg_finType fmod_baseFinGroupType) (Phant (@fmod_of gT A abelA))) (@actperm gT (@normaliser gT (@gval gT A)) (FinGroup.arg_finType fmod_baseFinGroupType) actr_action a)) *)
by apply/subsetP=> u _; rewrite inE.
(* Goal: is_true (@morphic fmod_finGroupType fmod_finGroupType (@setTfor (FinGroup.arg_finType fmod_baseFinGroupType) (Phant (@fmod_of gT A abelA))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base fmod_finGroupType)) (@actperm gT (@normaliser gT (@gval gT A)) (FinGroup.arg_finType fmod_baseFinGroupType) actr_action a))) *)
by apply/morphicP=> u v _ _; rewrite !permE /= actAr.
Qed.
Canonical actr_groupAction := GroupAction actr_is_groupAction.
Notation "''M'" := actr_groupAction (at level 8) : groupAction_scope.
Lemma actr1 u : u ^@ 1 = u.
Proof.
(* Goal: @eq (@fmod_of gT A abelA) (actr u (oneg (FinGroup.base gT))) u *)
exact: act1.
Qed.
Lemma actrM : {in 'N(A) &, forall x y u, u ^@ (x * y) = u ^@ x ^@ y}.
Proof.
(* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT A)))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => forall u : @fmod_of gT A abelA, @eq (@fmod_of gT A abelA) (actr u (@mulg (FinGroup.base gT) x y)) (actr (actr u x) y)) (inPhantom (forall (x y : FinGroup.arg_sort (FinGroup.base gT)) (u : @fmod_of gT A abelA), @eq (@fmod_of gT A abelA) (actr u (@mulg (FinGroup.base gT) x y)) (actr (actr u x) y))) *)
by move=> x y Nx Ny /= u; apply: val_inj; rewrite !fmvalJ ?conjgM ?groupM.
Qed.
Lemma actrK x : cancel (actr^~ x) (actr^~ x^-1%g).
Proof.
(* Goal: @cancel (@fmod_of gT A abelA) (@fmod_of gT A abelA) (fun x0 : @fmod_of gT A abelA => actr x0 x) (fun x0 : @fmod_of gT A abelA => actr x0 (@invg (FinGroup.base gT) x)) *)
move=> u; apply: val_inj; rewrite !fmvalJcond groupV.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) (if @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 (@normaliser_group gT (@gval gT A))))) then @conjg gT (if @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 A)))) then @conjg gT (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) x else @val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) (@invg (FinGroup.base gT) x) else if @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 A)))) then @conjg gT (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) x else @val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) (@val (FinGroup.arg_sort (FinGroup.base gT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT A)))) fmod_subType u) *)
by case: ifP => -> //; rewrite conjgK.
Qed.
Lemma actrKV x : cancel (actr^~ x^-1%g) (actr^~ x).
Proof.
(* Goal: @cancel (@fmod_of gT A abelA) (@fmod_of gT A abelA) (fun x0 : @fmod_of gT A abelA => actr x0 (@invg (FinGroup.base gT) x)) (fun x0 : @fmod_of gT A abelA => actr x0 x) *)
by move=> u; rewrite /= -{2}(invgK x) actrK.
Qed.
End OneFinMod.
Bind Scope ring_scope with fmod_of.
Prenex Implicits fmval fmod actr.
Notation "u ^@ x" := (actr u x) : ring_scope.
Notation "''M'" := actr_action (at level 8) : action_scope.
Notation "''M'" := actr_groupAction : groupAction_scope.
End FiniteModule.
Canonical FiniteModule.fmod_subType.
Canonical FiniteModule.fmod_eqType.
Canonical FiniteModule.fmod_choiceType.
Canonical FiniteModule.fmod_countType.
Canonical FiniteModule.fmod_finType.
Canonical FiniteModule.fmod_subCountType.
Canonical FiniteModule.fmod_subFinType.
Canonical FiniteModule.fmod_zmodType.
Canonical FiniteModule.fmod_finZmodType.
Canonical FiniteModule.fmod_baseFinGroupType.
Canonical FiniteModule.fmod_finGroupType.
Arguments FiniteModule.fmodK {gT A} abelA [x] Ax.
Arguments FiniteModule.fmvalK {gT A abelA} x.
Arguments FiniteModule.actrK {gT A abelA} x.
Arguments FiniteModule.actrKV {gT A abelA} x.
Import FiniteModule GroupScope.
Section Gaschutz.
Variables (gT : finGroupType) (G H P : {group gT}).
Implicit Types K L : {group gT}.
Hypotheses (nsHG : H <| G) (sHP : H \subset P) (sPG : P \subset G).
Hypotheses (abelH : abelian H) (coHiPG : coprime #|H| #|G : P|).
Let sHG := normal_sub nsHG.
Let nHG := subsetP (normal_norm nsHG).
Let m := (expg_invn H #|G : P|).
Implicit Types a b : fmod_of abelH.
Local Notation fmod := (fmod abelH).
Theorem Gaschutz_split : [splits G, over H] = [splits P, over H].
Theorem Gaschutz_transitive : {in [complements to H in G] &,
forall K L, K :&: P = L :&: P -> exists2 x, x \in H & L :=: K :^ x}.
End Gaschutz.
Lemma coprime_abel_cent_TI (gT : finGroupType) (A G : {group gT}) :
A \subset 'N(G) -> coprime #|G| #|A| -> abelian G -> 'C_[~: G, A](A) = 1.
Section Transfer.
Variables (gT aT : finGroupType) (G H : {group gT}).
Variable alpha : {morphism H >-> aT}.
Hypotheses (sHG : H \subset G) (abelA : abelian (alpha @* H)).
Local Notation HG := (rcosets (gval H) (gval G)).
Fact transfer_morph_subproof : H \subset alpha @*^-1 (alpha @* 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)) (@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 aT (@gval gT H) alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) (@morphim gT aT (@gval gT H) alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) (@gval gT H)))))) *)
by rewrite -sub_morphim_pre.
Qed.
Let fmalpha := restrm transfer_morph_subproof (fmod abelA \o alpha).
Let V (rX : {set gT} -> gT) g :=
\sum_(Hx in rcosets H G) fmalpha (rX Hx * g * (rX (Hx :* g))^-1).
Definition transfer g := V repr g.
Lemma transferM : {in G &, {morph transfer : x y / (x * y)%g >-> x + y}}.
Proof.
(* Goal: @prop_in2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (GRing.Zmodule.sort (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA))) (transfer ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : GRing.Zmodule.sort (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA)) => @GRing.add (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA)) x0 y0) (transfer x) (transfer y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (GRing.Zmodule.sort (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA))) transfer (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : GRing.Zmodule.sort (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA)) => @GRing.add (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA)) x y))) *)
move=> s t Gs Gt /=.
(* Goal: @eq (@fmod_of aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA) (transfer (@mulg (FinGroup.base gT) s t)) (@GRing.add (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA)) (transfer s) (transfer t)) *)
rewrite [transfer t](reindex_acts 'Rs _ Gs) ?actsRs_rcosets //= -big_split /=.
(* Goal: @eq (@fmod_of aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA) (transfer (@mulg (FinGroup.base gT) s t)) (@BigOp.bigop (@fmod_of aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA) (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (GRing.zero (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA))) (index_enum (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (fun i : @set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))) => @BigBody (@fmod_of aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA) (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) i (@GRing.add (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA))) (@in_mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) i (@mem (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT)))) (predPredType (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (FinGroup.sort (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@rcosets gT (@gval gT H) (@gval gT G))))) (@GRing.add (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA)) (fmalpha (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) i) s) (@invg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) i (@set1 (FinGroup.arg_finType (FinGroup.base gT)) s)))))) (fmalpha (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) (@rcoset gT i s)) t) (@invg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@rcoset gT i s) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) t))))))))) *)
apply: eq_bigr => _ /rcosetsP[x Gx ->]; rewrite !rcosetE -!rcosetM.
(* Goal: @eq (@fmod_of aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA) (fmalpha (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) (@mulg (FinGroup.base gT) s t)) (@invg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x (@mulg (FinGroup.base gT) s t)))))))) (@GRing.add (FinRing.Zmodule.zmodType (@fmod_finZmodType aT (@morphim_group gT aT H alpha (@MorPhantom gT aT (@mfun gT aT (@gval gT H) alpha)) H) abelA)) (fmalpha (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) s) (@invg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x s))))))) (fmalpha (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x s)))) t) (@invg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x s) t)))))))) *)
rewrite -zmodMgE -morphM -?mem_rcoset; first by rewrite !mulgA mulgKV rcosetM.
(* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x s)))) t) (@mem (Finite.sort (FinGroup.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)) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x s) t))))))))) *)
(* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x))) s) (@mem (Finite.sort (FinGroup.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)) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x s))))))))) *)
by rewrite rcoset_repr rcosetM mem_rcoset mulgK mem_repr_rcoset.
(* Goal: is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) x s)))) t) (@mem (Finite.sort (FinGroup.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)) (@repr (FinGroup.base gT) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.finType (FinGroup.base gT)) (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x s) t))))))))) *)
by rewrite rcoset_repr (rcosetM _ _ t) mem_rcoset mulgK mem_repr_rcoset.
Qed.
Canonical transfer_morphism := Morphism transferM.
Lemma transfer_indep X (rX := transversal_repr 1 X) :
is_transversal X HG G -> {in G, transfer =1 V rX}.
Section FactorTransfer.
Let H_g_rcosets x : {set {set gT}} := rcosets (H :* x) <[g]>.
Let n_ x := #|<[g]> : H :* x|.
Lemma mulg_exp_card_rcosets x : x * (g ^+ n_ x) \in H :* x.
Proof.
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x (@expgn (FinGroup.base gT) g (n_ x))) (@mem (Finite.sort (FinGroup.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)) x))))) *)
rewrite /n_ /indexg -orbitRs -pcycle_actperm ?inE //.
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x (@expgn (FinGroup.base gT) g (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@pcycle (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@actperm gT (@gval gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) g) (@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.arg_finType (FinGroup.base gT)) x))))) *)
rewrite -{2}(iter_pcycle (actperm 'Rs g) (H :* x)) -permX -morphX ?inE //.
(* Goal: is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x (@expgn (FinGroup.base gT) g (@card (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@pcycle (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@actperm gT (@gval gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) g) (@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)) (@PermDef.fun_of_perm (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mfun gT (perm_of_finGroupType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (@gval gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (@actperm_morphism gT (@gval gT (@setT_group gT (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT)) (@expgn (FinGroup.base gT) g (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@pcycle (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@actperm gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) g) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))))))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) x)))))) *)
by rewrite actpermE //= rcosetE -rcosetM rcoset_refl.
Qed.
Let HGg : {set {set {set gT}}} := orbit 'Rs <[g]> @: HG.
Let partHG : partition HG G := rcosets_partition sHG.
Let actsgHG : [acts <[g]>, on HG | 'Rs].
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 g))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@astabs gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.finType (FinGroup.base gT))) (@rcosets gT (@gval gT H) (@gval gT G)) (rcoset_action gT))))) *)
exact: subset_trans sgG (actsRs_rcosets H G).
Qed.
Let partHGg : partition HGg HG := orbit_partition actsgHG.
Let injHGg : {in HGg &, injective cover}.
Proof.
(* Goal: @prop_in2 (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (predPredType (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@SetDef.pred_of_set (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) HGg)) (fun x1 x2 : @set_of (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))))) => forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@cover (FinGroup.arg_finType (FinGroup.base gT)) x1) (@cover (FinGroup.arg_finType (FinGroup.base gT)) x2), @eq (@set_of (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) x1 x2) (inPhantom (@injective (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@set_of (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))))) (@cover (FinGroup.arg_finType (FinGroup.base gT))))) *)
by have [] := partition_partition partHG partHGg.
Qed.
Let defHGg : HG :* <[g]> = cover @: HGg.
Proof.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (group_set_of_baseGroupType (FinGroup.base gT)))) (@mulg (group_set_of_baseGroupType (group_set_of_baseGroupType (FinGroup.base gT))) (@rcosets gT (@gval gT H) (@gval gT G)) (@set1 (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle gT g))) (@Imset.imset (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@cover (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (predPredType (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@SetDef.pred_of_set (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) HGg))) *)
rewrite -imset_comp [_ :* _]imset2_set1r; apply: eq_imset => Hx /=.
(* 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)) Hx (@cycle gT g)) (@cover (FinGroup.arg_finType (FinGroup.base gT)) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) Hx)) *)
by rewrite cover_imset -curry_imset2r.
Qed.
Lemma rcosets_cycle_partition : partition (HG :* <[g]>) G.
Proof.
(* Goal: is_true (@partition (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (group_set_of_baseGroupType (FinGroup.base gT))) (@rcosets gT (@gval gT H) (@gval gT G)) (@set1 (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle gT g))) (@gval gT G)) *)
by rewrite defHGg; have [] := partition_partition partHG partHGg.
Qed.
Lemma rcosets_cycle_transversal : H_g_rcosets @: X = HGg.
Proof.
(* Goal: @eq (@set_of (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (Phant (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) H_g_rcosets (@mem (Finite.sort (FinGroup.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))) HGg *)
have sHXgHGg x: x \in X -> H_g_rcosets x \in HGg.
(* Goal: @eq (@set_of (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (Phant (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) H_g_rcosets (@mem (Finite.sort (FinGroup.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))) HGg *)
(* 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)) X))), is_true (@in_mem (@set_of (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (H_g_rcosets x) (@mem (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (predPredType (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@SetDef.pred_of_set (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) HGg))) *)
by move/sXG=> Gx; apply: mem_imset; rewrite -rcosetE mem_imset.
(* Goal: @eq (@set_of (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (Phant (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))))) (@Imset.imset (FinGroup.arg_finType (FinGroup.base gT)) (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) H_g_rcosets (@mem (Finite.sort (FinGroup.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))) HGg *)
apply/setP=> Hxg; apply/imsetP/idP=> [[x /sHXgHGg HGgHxg -> //] | HGgHxg].
(* 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)) X)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) Hxg (H_g_rcosets x)) *)
have [_ /rcosetsP[z Gz ->] ->] := imsetP HGgHxg.
(* 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)) X)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))) (H_g_rcosets x)) *)
pose Hzg := H :* z * <[g]>; pose x := transversal_repr 1 X Hzg.
(* 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)) X)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))) (H_g_rcosets x)) *)
have HGgHzg: Hzg \in HG :* <[g]>.
(* 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)) X)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))) (H_g_rcosets x)) *)
(* Goal: is_true (@in_mem (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) Hzg (@mem (Finite.sort (FinGroup.arg_finType (group_set_of_baseGroupType (FinGroup.base gT)))) (predPredType (Finite.sort (FinGroup.arg_finType (group_set_of_baseGroupType (FinGroup.base gT))))) (@SetDef.pred_of_set (FinGroup.arg_finType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (group_set_of_baseGroupType (FinGroup.base gT))) (@rcosets gT (@gval gT H) (@gval gT G)) (@set1 (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@cycle gT g)))))) *)
by rewrite mem_mulg ?set11 // -rcosetE mem_imset.
(* 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)) X)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))) (H_g_rcosets x)) *)
have Hzg_x: x \in Hzg by rewrite (repr_mem_pblock trX).
(* 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)) X)))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))) (H_g_rcosets x)) *)
exists x; first by rewrite (repr_mem_transversal trX).
(* Goal: @eq (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) z))) (H_g_rcosets x) *)
case/mulsgP: Hzg_x => y u /rcoset_eqP <- /(orbit_act 'Rs) <- -> /=.
(* Goal: @eq (@set_of (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (@orbit gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (rcoset_action gT) (@cycle gT g) (@rcoset gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@set1 (FinGroup.arg_finType (FinGroup.base gT)) y)) u)) (H_g_rcosets (@mulg (FinGroup.base gT) y u)) *)
by rewrite rcosetE -rcosetM.
Qed.
Local Notation defHgX := rcosets_cycle_transversal.
Let injHg: {in X &, injective H_g_rcosets}.
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)) X)) (fun x1 x2 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => forall _ : @eq (@set_of (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (H_g_rcosets x1) (H_g_rcosets x2), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x1 x2) (inPhantom (@injective (@set_of (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (Phant (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) H_g_rcosets)) *)
apply/imset_injP; rewrite defHgX (card_transversal trX) defHGg.
(* Goal: is_true (@eq_op nat_eqType (@card (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (@mem (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (predPredType (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@SetDef.pred_of_set (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) HGg))) (@card (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@Imset.imset (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))) (@cover (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT))))) (predPredType (Finite.sort (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))))) (@SetDef.pred_of_set (set_of_finType (set_of_finType (FinGroup.arg_finType (FinGroup.base gT)))) HGg))))))) *)
by rewrite (card_in_imset injHGg).
Qed.
Lemma sum_index_rcosets_cycle : (\sum_(x in X) n_ x)%N = #|G : H|.
Proof.
(* Goal: @eq nat (@BigOp.bigop nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) O (index_enum (FinGroup.arg_finType (FinGroup.base gT))) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @BigBody nat (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x addn (@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)) X))) (n_ x))) (@indexg gT (@gval gT G) (@gval gT H)) *)
by rewrite [#|G : H|](card_partition partHGg) -defHgX big_imset.
Qed.
Lemma transfer_cycle_expansion :
transfer g = \sum_(x in X) fmalpha ((g ^+ n_ x) ^ x^-1).
End FactorTransfer.
End Transfer.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrfun ssrbool eqtype ssrnat seq choice fintype.
From mathcomp
Require Import bigop ssralg countalg div ssrnum ssrint.
Import GRing.Theory.
Import Num.Theory.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Local Open Scope ring_scope.
Local Notation sgr := Num.sg.
Record rat : Set := Rat {
valq : (int * int);
_ : (0 < valq.2) && coprime `|valq.1| `|valq.2|
}.
Bind Scope ring_scope with rat.
Delimit Scope rat_scope with Q.
Definition ratz (n : int) := @Rat (n, 1) (coprimen1 _).
Canonical rat_subType := Eval hnf in [subType for valq].
Definition rat_eqMixin := [eqMixin of rat by <:].
Canonical rat_eqType := EqType rat rat_eqMixin.
Definition rat_choiceMixin := [choiceMixin of rat by <:].
Canonical rat_choiceType := ChoiceType rat rat_choiceMixin.
Definition rat_countMixin := [countMixin of rat by <:].
Canonical rat_countType := CountType rat rat_countMixin.
Canonical rat_subCountType := [subCountType of rat].
Definition numq x := nosimpl ((valq x).1).
Definition denq x := nosimpl ((valq x).2).
Lemma denq_gt0 x : 0 < denq x.
Proof.
(* Goal: is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (denq x)) *)
by rewrite /denq; case: x=> [[a b] /= /andP []].
Qed.
Hint Resolve denq_gt0 : core.
Definition denq_ge0 x := ltrW (denq_gt0 x).
Lemma denq_neq0 x : denq x != 0.
Proof.
(* Goal: is_true (negb (@eq_op int_eqType (denq x) (GRing.zero int_ZmodType))) *)
by rewrite /denq gtr_eqF ?denq_gt0.
Qed.
Hint Resolve denq_neq0 : core.
Lemma denq_eq0 x : (denq x == 0) = false.
Proof.
(* Goal: @eq bool (@eq_op int_eqType (denq x) (GRing.zero int_ZmodType)) false *)
exact: negPf (denq_neq0 _).
Qed.
Lemma coprime_num_den x : coprime `|numq x| `|denq x|.
Proof.
(* Goal: is_true (coprime (absz (numq x)) (absz (denq x))) *)
by rewrite /numq /denq; case: x=> [[a b] /= /andP []].
Qed.
Fact RatK x P : @Rat (numq x, denq x) P = x.
Proof.
(* Goal: @eq rat (@Rat (@pair int int (numq x) (denq x)) P) x *)
by move: x P => [[a b] P'] P; apply: val_inj.
Qed.
Fact fracq_subproof : forall x : int * int,
let n :=
if x.2 == 0 then 0 else
Proof.
(* Goal: forall x : prod int int, is_true (let n := if @eq_op int_eqType (@snd int int x) (GRing.zero int_ZmodType) then GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) else @GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType (@snd int int x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType (@fst int int x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (divn (absz (@fst int int x)) (gcdn (absz (@fst int int x)) (absz (@snd int int x))))) in let d := if @eq_op int_eqType (@snd int int x) (GRing.zero int_ZmodType) then GRing.one int_Ring else Posz (divn (absz (@snd int int x)) (gcdn (absz (@fst int int x)) (absz (@snd int int x)))) in andb (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) d) (coprime (absz n) (absz d))) *)
move=> [m n] /=; case: (altP (n =P 0))=> [//|n0].
(* Goal: is_true (andb (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (Posz (divn (absz n) (gcdn (absz m) (absz n))))) (coprime (absz (@GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType m (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (divn (absz m) (gcdn (absz m) (absz n)))))) (absz (Posz (divn (absz n) (gcdn (absz m) (absz n))))))) *)
rewrite ltz_nat divn_gt0 ?gcdn_gt0 ?absz_gt0 ?n0 ?orbT //.
(* Goal: is_true (andb (leq (gcdn (absz m) (absz n)) (absz n)) (coprime (absz (@GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType m (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (divn (absz m) (gcdn (absz m) (absz n)))))) (absz (Posz (divn (absz n) (gcdn (absz m) (absz n))))))) *)
rewrite dvdn_leq ?absz_gt0 ?dvdn_gcdr //= !abszM absz_sign mul1n.
(* Goal: is_true (coprime (absz (Posz (divn (absz m) (gcdn (absz m) (absz n))))) (divn (absz n) (gcdn (absz m) (absz n)))) *)
have [->|m0] := altP (m =P 0); first by rewrite div0n gcd0n divnn absz_gt0 n0.
(* Goal: is_true (coprime (absz (Posz (divn (absz m) (gcdn (absz m) (absz n))))) (divn (absz n) (gcdn (absz m) (absz n)))) *)
move: n0 m0; rewrite -!absz_gt0 absz_nat.
(* Goal: forall (_ : is_true (leq (S O) (absz n))) (_ : is_true (leq (S O) (absz m))), is_true (coprime (divn (absz m) (gcdn (absz m) (absz n))) (divn (absz n) (gcdn (absz m) (absz n)))) *)
move: `|_|%N `|_|%N => {m n} [|m] [|n] // _ _.
(* Goal: is_true (coprime (divn (S m) (gcdn (S m) (S n))) (divn (S n) (gcdn (S m) (S n)))) *)
rewrite /coprime -(@eqn_pmul2l (gcdn m.+1 n.+1)) ?gcdn_gt0 //.
(* Goal: is_true (@eq_op nat_eqType (muln (gcdn (S m) (S n)) (gcdn (divn (S m) (gcdn (S m) (S n))) (divn (S n) (gcdn (S m) (S n))))) (muln (gcdn (S m) (S n)) (S O))) *)
rewrite muln_gcdr; do 2!rewrite muln_divCA ?(dvdn_gcdl, dvdn_gcdr) ?divnn //.
(* Goal: is_true (@eq_op nat_eqType (gcdn (muln (S m) (nat_of_bool (leq (S O) (gcdn (S m) (S n))))) (muln (S n) (nat_of_bool (leq (S O) (gcdn (S m) (S n)))))) (muln (gcdn (S m) (S n)) (S O))) *)
by rewrite ?gcdn_gt0 ?muln1.
Qed.
Definition fracq (x : int * int) := nosimpl (@Rat (_, _) (fracq_subproof x)).
Fact ratz_frac n : ratz n = fracq (n, 1).
Proof.
(* Goal: @eq rat (ratz n) (fracq (@pair int (GRing.Ring.sort int_Ring) n (GRing.one int_Ring))) *)
by apply: val_inj; rewrite /= gcdn1 !divn1 abszE mulr_sign_norm.
Qed.
Fact valqK x : fracq (valq x) = x.
Proof.
(* Goal: @eq rat (fracq (valq x)) x *)
move: x => [[n d] /= Pnd]; apply: val_inj=> /=.
(* Goal: @eq (prod int int) (@pair int int (if @eq_op int_eqType d (GRing.zero int_ZmodType) then GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) else @GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (divn (absz n) (gcdn (absz n) (absz d))))) (if @eq_op int_eqType d (GRing.zero int_ZmodType) then GRing.one int_Ring else Posz (divn (absz d) (gcdn (absz n) (absz d))))) (@pair int int n d) *)
move: Pnd; rewrite /coprime /fracq /= => /andP[] hd -/eqP hnd.
(* Goal: @eq (prod int int) (@pair int int (if @eq_op int_eqType d (GRing.zero int_ZmodType) then GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) else @GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (divn (absz n) (gcdn (absz n) (absz d))))) (if @eq_op int_eqType d (GRing.zero int_ZmodType) then GRing.one int_Ring else Posz (divn (absz d) (gcdn (absz n) (absz d))))) (@pair int int n d) *)
by rewrite ltr_gtF ?gtr_eqF //= hnd !divn1 mulz_sign_abs abszE gtr0_norm.
Qed.
Definition scalq_def x := sgr x.2 * (gcdn `|x.1| `|x.2|)%:Z.
Definition scalq := locked_with scalq_key scalq_def.
Canonical scalq_unlockable := [unlockable fun scalq].
Fact scalq_eq0 x : (scalq x == 0) = (x.2 == 0).
Proof.
(* Goal: @eq bool (@eq_op (GRing.Ring.eqType (Num.NumDomain.ringType int_numDomainType)) (scalq x) (GRing.zero (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)))) (@eq_op (Num.NumDomain.eqType int_numDomainType) (@snd int (Num.NumDomain.sort int_numDomainType) x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) *)
case: x => n d; rewrite unlock /= mulf_eq0 sgr_eq0 /= eqz_nat.
(* Goal: @eq bool (orb (@eq_op (Num.NumDomain.eqType int_numDomainType) d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@eq_op nat_eqType (gcdn (absz n) (absz d)) O)) (@eq_op (Num.NumDomain.eqType int_numDomainType) d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) *)
rewrite -[gcdn _ _ == 0%N]negbK -lt0n gcdn_gt0 ?absz_gt0 [X in ~~ X]orbC.
(* Goal: @eq bool (orb (@eq_op (Num.NumDomain.eqType int_numDomainType) d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (negb (orb (negb (@eq_op int_eqType d (GRing.zero int_ZmodType))) (negb (@eq_op int_eqType n (GRing.zero int_ZmodType)))))) (@eq_op (Num.NumDomain.eqType int_numDomainType) d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) *)
by case: sgrP.
Qed.
Lemma sgr_scalq x : sgr (scalq x) = sgr x.2.
Proof.
(* Goal: @eq (Num.NumDomain.sort int_numDomainType) (@Num.Def.sgr int_numDomainType (scalq x)) (@Num.Def.sgr int_numDomainType (@snd int (Num.NumDomain.sort int_numDomainType) x)) *)
rewrite unlock sgrM sgr_id -[(gcdn _ _)%:Z]intz sgr_nat.
(* Goal: @eq (Num.NumDomain.sort int_numDomainType) (@GRing.mul (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)) (@Num.Def.sgr (Num.RealDomain.numDomainType int_realDomainType) (@snd int (Num.NumDomain.sort int_numDomainType) x)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (nat_of_bool (negb (@eq_op nat_eqType (gcdn (absz (@fst int (Num.NumDomain.sort int_numDomainType) x)) (absz (@snd int (Num.NumDomain.sort int_numDomainType) x))) O))))) (@Num.Def.sgr int_numDomainType (@snd int (Num.NumDomain.sort int_numDomainType) x)) *)
by rewrite -lt0n gcdn_gt0 ?absz_gt0 orbC; case: sgrP; rewrite // mul0r.
Qed.
Lemma signr_scalq x : (scalq x < 0) = (x.2 < 0).
Proof.
(* Goal: @eq bool (@Num.Def.ltr int_numDomainType (scalq x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType (@snd int (Num.NumDomain.sort int_numDomainType) x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) *)
by rewrite -!sgr_cp0 sgr_scalq.
Qed.
Lemma scalqE x :
x.2 != 0 -> scalq x = (-1) ^+ (x.2 < 0)%R * (gcdn `|x.1| `|x.2|)%:Z.
Proof.
(* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType)) (@snd int (Equality.sort (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType))) x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))), @eq (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (scalq x) (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType (@snd int (Equality.sort (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType))) x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz (gcdn (absz (@fst int (Equality.sort (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType))) x)) (absz (@snd int (Equality.sort (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType))) x))))) *)
by rewrite unlock; case: sgrP.
Qed.
Fact valq_frac x :
x.2 != 0 -> x = (scalq x * numq (fracq x), scalq x * denq (fracq x)).
Proof.
(* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType)) (@snd int (Equality.sort (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType))) x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))), @eq (prod int (Equality.sort (GRing.Zmodule.eqType (Num.NumDomain.zmodType int_numDomainType)))) x (@pair (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (GRing.Ring.sort (Num.NumDomain.ringType int_numDomainType)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (scalq x) (numq (fracq x))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (scalq x) (denq (fracq x)))) *)
case: x => [n d] /= d_neq0; rewrite /denq /numq scalqE //= (negPf d_neq0).
(* Goal: @eq (prod int int) (@pair int int n d) (@pair int int (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz (gcdn (absz n) (absz d)))) (@GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (divn (absz n) (gcdn (absz n) (absz d)))))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz (gcdn (absz n) (absz d)))) (Posz (divn (absz d) (gcdn (absz n) (absz d)))))) *)
rewrite mulr_signM -mulrA -!PoszM addKb.
(* Goal: @eq (prod int int) (@pair int int n d) (@pair int int (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@GRing.exp (Num.NumDomain.ringType int_numDomainType) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (GRing.one (Num.NumDomain.ringType int_numDomainType))) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz (muln (gcdn (absz n) (absz d)) (divn (absz n) (gcdn (absz n) (absz d)))))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz (muln (gcdn (absz n) (absz d)) (divn (absz d) (gcdn (absz n) (absz d))))))) *)
do 2!rewrite muln_divCA ?(dvdn_gcdl, dvdn_gcdr) // divnn.
(* Goal: @eq (prod int int) (@pair int int n d) (@pair int int (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@GRing.exp (Num.NumDomain.ringType int_numDomainType) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (GRing.one (Num.NumDomain.ringType int_numDomainType))) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz (muln (absz n) (nat_of_bool (leq (S O) (gcdn (absz n) (absz d))))))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (Posz (muln (absz d) (nat_of_bool (leq (S O) (gcdn (absz n) (absz d)))))))) *)
by rewrite gcdn_gt0 !absz_gt0 d_neq0 orbT !muln1 !mulz_sign_abs.
Qed.
Definition zeroq := fracq (0, 1).
Definition oneq := fracq (1, 1).
Fact frac0q x : fracq (0, x) = zeroq.
Proof.
(* Goal: @eq rat (fracq (@pair (GRing.Zmodule.sort int_ZmodType) int (GRing.zero int_ZmodType) x)) zeroq *)
apply: val_inj; rewrite //= div0n !gcd0n !mulr0 !divnn.
(* Goal: @eq (prod int int) (@pair int int (if @eq_op int_eqType x (GRing.zero int_ZmodType) then GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) else GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType))) (if @eq_op int_eqType x (GRing.zero int_ZmodType) then GRing.one int_Ring else Posz (nat_of_bool (leq (S O) (absz x))))) (@pair int int (GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (leq (S O) (S O))))) *)
by have [//|x_neq0] := altP eqP; rewrite absz_gt0 x_neq0.
Qed.
Variant fracq_spec (x : int * int) : int * int -> rat -> Type :=
| FracqSpecN of x.2 = 0 : fracq_spec x (x.1, 0) zeroq
| FracqSpecP k fx of k != 0 : fracq_spec x (k * numq fx, k * denq fx) fx.
Fact fracqP x : fracq_spec x x (fracq x).
Proof.
(* Goal: fracq_spec x x (fracq x) *)
case: x => n d /=; have [d_eq0 | d_neq0] := eqVneq d 0.
(* Goal: fracq_spec (@pair int int n d) (@pair int int n d) (fracq (@pair int int n d)) *)
(* Goal: fracq_spec (@pair int int n d) (@pair int int n d) (fracq (@pair int int n d)) *)
by rewrite d_eq0 fracq0; constructor.
(* Goal: fracq_spec (@pair int int n d) (@pair int int n d) (fracq (@pair int int n d)) *)
by rewrite {2}[(_, _)]valq_frac //; constructor; rewrite scalq_eq0.
Qed.
Lemma rat_eqE x y : (x == y) = (numq x == numq y) && (denq x == denq y).
Proof.
(* Goal: @eq bool (@eq_op rat_eqType x y) (andb (@eq_op int_eqType (numq x) (numq y)) (@eq_op int_eqType (denq x) (denq y))) *)
rewrite -val_eqE [val x]surjective_pairing [val y]surjective_pairing /=.
(* Goal: @eq bool (@eq_op (prod_eqType int_eqType int_eqType) (@pair int int (@fst int int (valq x)) (@snd int int (valq x))) (@pair int int (@fst int int (valq y)) (@snd int int (valq y)))) (andb (@eq_op int_eqType (numq x) (numq y)) (@eq_op int_eqType (denq x) (denq y))) *)
by rewrite xpair_eqE.
Qed.
Lemma sgr_denq x : sgr (denq x) = 1. Proof. by apply/eqP; rewrite sgr_cp0. Qed.
Proof.
(* Goal: @eq (Num.NumDomain.sort int_numDomainType) (@Num.Def.sgr int_numDomainType (denq x)) (GRing.one (Num.NumDomain.ringType int_numDomainType)) *)
by apply/eqP; rewrite sgr_cp0.
Qed.
Lemma absz_denq x : `|denq x|%N = denq x :> int.
Proof.
(* Goal: @eq int (Posz (absz (denq x))) (denq x) *)
by rewrite abszE normr_denq.
Qed.
Lemma rat_eq x y : (x == y) = (numq x * denq y == numq y * denq x).
Proof.
(* Goal: @eq bool (@eq_op rat_eqType x y) (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul int_Ring (numq x) (denq y)) (@GRing.mul int_Ring (numq y) (denq x))) *)
symmetry; rewrite rat_eqE andbC.
(* Goal: @eq bool (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul int_Ring (numq x) (denq y)) (@GRing.mul int_Ring (numq y) (denq x))) (andb (@eq_op int_eqType (denq x) (denq y)) (@eq_op int_eqType (numq x) (numq y))) *)
have [->|] /= := altP (denq _ =P _); first by rewrite (inj_eq (mulIf _)).
(* Goal: forall _ : is_true (negb (@eq_op int_eqType (denq x) (denq y))), @eq bool (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul int_Ring (numq x) (denq y)) (@GRing.mul int_Ring (numq y) (denq x))) false *)
apply: contraNF => /eqP hxy; rewrite -absz_denq -[X in _ == X]absz_denq.
(* Goal: is_true (@eq_op int_eqType (Posz (absz (denq x))) (Posz (absz (denq y)))) *)
rewrite eqz_nat /= eqn_dvd.
(* Goal: is_true (andb (dvdn (absz (denq x)) (absz (denq y))) (dvdn (absz (denq y)) (absz (denq x)))) *)
rewrite -(@Gauss_dvdr _ `|numq x|) 1?coprime_sym ?coprime_num_den // andbC.
(* Goal: is_true (andb (dvdn (absz (denq y)) (absz (denq x))) (dvdn (absz (denq x)) (muln (absz (numq x)) (absz (denq y))))) *)
rewrite -(@Gauss_dvdr _ `|numq y|) 1?coprime_sym ?coprime_num_den //.
(* Goal: is_true (andb (dvdn (absz (denq y)) (muln (absz (numq y)) (absz (denq x)))) (dvdn (absz (denq x)) (muln (absz (numq x)) (absz (denq y))))) *)
by rewrite -!abszM hxy -{1}hxy !abszM !dvdn_mull ?dvdnn.
Qed.
Fact fracq_eq x y : x.2 != 0 -> y.2 != 0 ->
Proof.
(* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) (@snd int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) x) (GRing.zero int_ZmodType)))) (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) (@snd int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) y) (GRing.zero int_ZmodType)))), @eq bool (@eq_op rat_eqType (fracq x) (fracq y)) (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul int_Ring (@fst int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) x) (@snd int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) y)) (@GRing.mul int_Ring (@fst int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) y) (@snd int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) x))) *)
case: fracqP=> //= u fx u_neq0 _; case: fracqP=> //= v fy v_neq0 _; symmetry.
(* Goal: @eq bool (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring u (numq fx)) (@GRing.mul int_Ring v (denq fy))) (@GRing.mul int_Ring (@GRing.mul int_Ring v (numq fy)) (@GRing.mul int_Ring u (denq fx)))) (@eq_op rat_eqType fx fy) *)
rewrite [X in (_ == X)]mulrC mulrACA [X in (_ == X)]mulrACA.
(* Goal: @eq bool (@eq_op (GRing.Ring.eqType int_Ring) (@GRing.mul (GRing.ComRing.ringType int_comRing) (@GRing.mul (GRing.ComRing.ringType int_comRing) u v) (@GRing.mul (GRing.ComRing.ringType int_comRing) (numq fx) (denq fy))) (@GRing.mul (GRing.ComRing.ringType int_comRing) (@GRing.mul (GRing.ComRing.ringType int_comRing) u v) (@GRing.mul (GRing.ComRing.ringType int_comRing) (denq fx) (numq fy)))) (@eq_op rat_eqType fx fy) *)
by rewrite [denq _ * _]mulrC (inj_eq (mulfI _)) ?mulf_neq0 // rat_eq.
Qed.
Fact fracq_eq0 x : (fracq x == zeroq) = (x.1 == 0) || (x.2 == 0).
Proof.
(* Goal: @eq bool (@eq_op rat_eqType (fracq x) zeroq) (orb (@eq_op int_eqType (@fst int int x) (GRing.zero int_ZmodType)) (@eq_op int_eqType (@snd int int x) (GRing.zero int_ZmodType))) *)
move: x=> [n d] /=; have [->|d0] := altP (d =P 0).
(* Goal: @eq bool (@eq_op rat_eqType (fracq (@pair int int n d)) zeroq) (orb (@eq_op int_eqType n (GRing.zero int_ZmodType)) false) *)
(* Goal: @eq bool (@eq_op rat_eqType (fracq (@pair int int n (GRing.zero int_ZmodType))) zeroq) (orb (@eq_op int_eqType n (GRing.zero int_ZmodType)) true) *)
by rewrite fracq0 eqxx orbT.
(* Goal: @eq bool (@eq_op rat_eqType (fracq (@pair int int n d)) zeroq) (orb (@eq_op int_eqType n (GRing.zero int_ZmodType)) false) *)
by rewrite orbF fracq_eq ?d0 //= mulr1 mul0r.
Qed.
Fact fracqMM x n d : x != 0 -> fracq (x * n, x * d) = fracq (n, d).
Definition addq_subdef (x y : int * int) := (x.1 * y.2 + y.1 * x.2, x.2 * y.2).
Definition addq (x y : rat) := nosimpl fracq (addq_subdef (valq x) (valq y)).
Definition oppq_subdef (x : int * int) := (- x.1, x.2).
Definition oppq (x : rat) := nosimpl fracq (oppq_subdef (valq x)).
Fact addq_subdefC : commutative addq_subdef.
Proof.
(* Goal: @commutative (prod int int) (prod (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring)) addq_subdef *)
by move=> x y; rewrite /addq_subdef addrC [_.2 * _]mulrC.
Qed.
Fact addq_subdefA : associative addq_subdef.
Proof.
(* Goal: @associative (prod int int) addq_subdef *)
move=> x y z; rewrite /addq_subdef.
(* Goal: @eq (prod int int) (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int x) (@snd int int (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int y) (@snd int int z)) (@GRing.mul int_Ring (@fst int int z) (@snd int int y))) (@GRing.mul int_Ring (@snd int int y) (@snd int int z))))) (@GRing.mul int_Ring (@fst int int (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int y) (@snd int int z)) (@GRing.mul int_Ring (@fst int int z) (@snd int int y))) (@GRing.mul int_Ring (@snd int int y) (@snd int int z)))) (@snd int int x))) (@GRing.mul int_Ring (@snd int int x) (@snd int int (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int y) (@snd int int z)) (@GRing.mul int_Ring (@fst int int z) (@snd int int y))) (@GRing.mul int_Ring (@snd int int y) (@snd int int z)))))) (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int x) (@snd int int y)) (@GRing.mul int_Ring (@fst int int y) (@snd int int x))) (@GRing.mul int_Ring (@snd int int x) (@snd int int y)))) (@snd int int z)) (@GRing.mul int_Ring (@fst int int z) (@snd int int (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int x) (@snd int int y)) (@GRing.mul int_Ring (@fst int int y) (@snd int int x))) (@GRing.mul int_Ring (@snd int int x) (@snd int int y)))))) (@GRing.mul int_Ring (@snd int int (@pair (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.Ring.sort int_Ring) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (@fst int int x) (@snd int int y)) (@GRing.mul int_Ring (@fst int int y) (@snd int int x))) (@GRing.mul int_Ring (@snd int int x) (@snd int int y)))) (@snd int int z))) *)
by rewrite !mulrA !mulrDl addrA ![_ * x.2]mulrC !mulrA.
Qed.
Fact addq_frac x y : x.2 != 0 -> y.2 != 0 ->
Proof.
(* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) (@snd int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) x) (GRing.zero int_ZmodType)))) (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) (@snd int (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) y) (GRing.zero int_ZmodType)))), @eq rat (addq (fracq x) (fracq y)) (fracq (addq_subdef x y)) *)
case: fracqP => // u fx u_neq0 _; case: fracqP => // v fy v_neq0 _.
(* Goal: @eq rat (addq fx fy) (fracq (addq_subdef (@pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring u (numq fx)) (@GRing.mul int_Ring u (denq fx))) (@pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring v (numq fy)) (@GRing.mul int_Ring v (denq fy))))) *)
rewrite /addq_subdef /= ![(_ * numq _) * _]mulrACA [(_ * denq _) * _]mulrACA.
(* Goal: @eq rat (addq fx fy) (fracq (@pair int int (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul (GRing.ComRing.ringType int_comRing) (@GRing.mul (GRing.ComRing.ringType int_comRing) u v) (@GRing.mul (GRing.ComRing.ringType int_comRing) (numq fx) (denq fy))) (@GRing.mul (GRing.ComRing.ringType int_comRing) (@GRing.mul (GRing.ComRing.ringType int_comRing) v u) (@GRing.mul (GRing.ComRing.ringType int_comRing) (numq fy) (denq fx)))) (@GRing.mul (GRing.ComRing.ringType int_comRing) (@GRing.mul (GRing.ComRing.ringType int_comRing) u v) (@GRing.mul (GRing.ComRing.ringType int_comRing) (denq fx) (denq fy))))) *)
by rewrite [v * _]mulrC -mulrDr fracqMM ?mulf_neq0.
Qed.
Fact ratzD : {morph ratz : x y / x + y >-> addq x y}.
Proof.
(* Goal: @morphism_2 int rat ratz (fun x y : int => @GRing.add int_ZmodType x y) (fun x y : rat => addq x y) *)
by move=> x y /=; rewrite !ratz_frac addq_frac // /addq_subdef /= !mulr1.
Qed.
Fact oppq_frac x : oppq (fracq x) = fracq (oppq_subdef x).
Proof.
(* Goal: @eq rat (oppq (fracq x)) (fracq (oppq_subdef x)) *)
rewrite /oppq_subdef; case: fracqP => /= [|u fx u_neq0].
(* Goal: @eq rat (oppq fx) (fracq (@pair int int (@GRing.opp int_ZmodType (@GRing.mul int_Ring u (numq fx))) (@GRing.mul int_Ring u (denq fx)))) *)
(* Goal: forall _ : @eq int (@snd int int x) (GRing.zero int_ZmodType), @eq rat (oppq zeroq) (fracq (@pair int int (@GRing.opp int_ZmodType (@fst int int x)) (GRing.zero int_ZmodType))) *)
by rewrite fracq0.
(* Goal: @eq rat (oppq fx) (fracq (@pair int int (@GRing.opp int_ZmodType (@GRing.mul int_Ring u (numq fx))) (@GRing.mul int_Ring u (denq fx)))) *)
by rewrite -mulrN fracqMM.
Qed.
Fact ratzN : {morph ratz : x / - x >-> oppq x}.
Proof.
(* Goal: @morphism_1 int rat ratz (fun x : int => @GRing.opp int_ZmodType x) (fun x : rat => oppq x) *)
by move=> x /=; rewrite !ratz_frac oppq_frac // /add /= !mulr1.
Qed.
Fact addqC : commutative addq.
Proof.
(* Goal: @commutative rat rat addq *)
by move=> x y; rewrite /addq /=; rewrite addq_subdefC.
Qed.
Fact addqA : associative addq.
Proof.
(* Goal: @associative rat addq *)
move=> x y z; rewrite -[x]valqK -[y]valqK -[z]valqK.
(* Goal: @eq rat (addq (fracq (valq x)) (addq (fracq (valq y)) (fracq (valq z)))) (addq (addq (fracq (valq x)) (fracq (valq y))) (fracq (valq z))) *)
by rewrite !addq_frac ?mulf_neq0 ?denq_neq0 // addq_subdefA.
Qed.
Fact add0q : left_id zeroq addq.
Proof.
(* Goal: @left_id rat rat zeroq addq *)
move=> x; rewrite -[x]valqK addq_frac ?denq_neq0 // /addq_subdef /=.
(* Goal: @eq rat (fracq (@pair int int (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (GRing.zero int_ZmodType) (@snd int int (valq x))) (@GRing.mul int_Ring (@fst int int (valq x)) (GRing.one int_Ring))) (@GRing.mul int_Ring (GRing.one int_Ring) (@snd int int (valq x))))) (fracq (valq x)) *)
by rewrite mul0r add0r mulr1 mul1r -surjective_pairing.
Qed.
Fact addNq : left_inverse (fracq (0, 1)) oppq addq.
Definition rat_ZmodMixin := ZmodMixin addqA addqC add0q addNq.
Canonical rat_ZmodType := ZmodType rat rat_ZmodMixin.
Definition mulq_subdef (x y : int * int) := nosimpl (x.1 * y.1, x.2 * y.2).
Definition mulq (x y : rat) := nosimpl fracq (mulq_subdef (valq x) (valq y)).
Fact mulq_subdefC : commutative mulq_subdef.
Proof.
(* Goal: @commutative (prod int int) (prod (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring)) mulq_subdef *)
by move=> x y; rewrite /mulq_subdef mulrC [_ * x.2]mulrC.
Qed.
Fact mul_subdefA : associative mulq_subdef.
Proof.
(* Goal: @associative (prod int int) mulq_subdef *)
by move=> x y z; rewrite /mulq_subdef !mulrA.
Qed.
Definition invq_subdef (x : int * int) := nosimpl (x.2, x.1).
Definition invq (x : rat) := nosimpl fracq (invq_subdef (valq x)).
Fact mulq_frac x y : (mulq (fracq x) (fracq y)) = fracq (mulq_subdef x y).
Proof.
(* Goal: @eq rat (mulq (fracq x) (fracq y)) (fracq (mulq_subdef x y)) *)
rewrite /mulq_subdef; case: fracqP => /= [|u fx u_neq0].
(* Goal: @eq rat (mulq fx (fracq y)) (fracq (@pair int int (@GRing.mul int_Ring (@GRing.mul int_Ring u (numq fx)) (@fst int int y)) (@GRing.mul int_Ring (@GRing.mul int_Ring u (denq fx)) (@snd int int y)))) *)
(* Goal: forall _ : @eq int (@snd int int x) (GRing.zero int_ZmodType), @eq rat (mulq zeroq (fracq y)) (fracq (@pair int int (@GRing.mul int_Ring (@fst int int x) (@fst int int y)) (@GRing.mul int_Ring (GRing.zero int_ZmodType) (@snd int int y)))) *)
by rewrite mul0r fracq0 /mulq /mulq_subdef /= mul0r frac0q.
(* Goal: @eq rat (mulq fx (fracq y)) (fracq (@pair int int (@GRing.mul int_Ring (@GRing.mul int_Ring u (numq fx)) (@fst int int y)) (@GRing.mul int_Ring (@GRing.mul int_Ring u (denq fx)) (@snd int int y)))) *)
case: fracqP=> /= [|v fy v_neq0].
(* Goal: @eq rat (mulq fx fy) (fracq (@pair int int (@GRing.mul int_Ring (@GRing.mul int_Ring u (numq fx)) (@GRing.mul int_Ring v (numq fy))) (@GRing.mul int_Ring (@GRing.mul int_Ring u (denq fx)) (@GRing.mul int_Ring v (denq fy))))) *)
(* Goal: forall _ : @eq int (@snd int int y) (GRing.zero int_ZmodType), @eq rat (mulq fx zeroq) (fracq (@pair int int (@GRing.mul int_Ring (@GRing.mul int_Ring u (numq fx)) (@fst int int y)) (@GRing.mul int_Ring (@GRing.mul int_Ring u (denq fx)) (GRing.zero int_ZmodType)))) *)
by rewrite mulr0 fracq0 /mulq /mulq_subdef /= mulr0 frac0q.
(* Goal: @eq rat (mulq fx fy) (fracq (@pair int int (@GRing.mul int_Ring (@GRing.mul int_Ring u (numq fx)) (@GRing.mul int_Ring v (numq fy))) (@GRing.mul int_Ring (@GRing.mul int_Ring u (denq fx)) (@GRing.mul int_Ring v (denq fy))))) *)
by rewrite ![_ * (v * _)]mulrACA fracqMM ?mulf_neq0.
Qed.
Fact ratzM : {morph ratz : x y / x * y >-> mulq x y}.
Proof.
(* Goal: @morphism_2 int rat ratz (fun x y : int => @GRing.mul int_Ring x y) (fun x y : rat => mulq x y) *)
by move=> x y /=; rewrite !ratz_frac mulq_frac // /= !mulr1.
Qed.
Fact invq_frac x :
x.1 != 0 -> x.2 != 0 -> invq (fracq x) = fracq (invq_subdef x).
Proof.
(* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) (@fst (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) x) (GRing.zero int_ZmodType)))) (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) (@snd (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) x) (GRing.zero int_ZmodType)))), @eq rat (invq (fracq x)) (fracq (invq_subdef x)) *)
by rewrite /invq_subdef; case: fracqP => // k {x} x k0; rewrite fracqMM.
Qed.
Fact mulqC : commutative mulq.
Proof.
(* Goal: @commutative rat rat mulq *)
by move=> x y; rewrite /mulq mulq_subdefC.
Qed.
Fact mulqA : associative mulq.
Proof.
(* Goal: @associative rat mulq *)
by move=> x y z; rewrite -[x]valqK -[y]valqK -[z]valqK !mulq_frac mul_subdefA.
Qed.
Fact mul1q : left_id oneq mulq.
Proof.
(* Goal: @left_id rat rat oneq mulq *)
move=> x; rewrite -[x]valqK; rewrite mulq_frac /mulq_subdef.
(* Goal: @eq rat (fracq (@pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring (@fst int int (@pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (GRing.one int_Ring) (GRing.one int_Ring))) (@fst int int (valq x))) (@GRing.mul int_Ring (@snd int int (@pair (GRing.Ring.sort int_Ring) (GRing.Ring.sort int_Ring) (GRing.one int_Ring) (GRing.one int_Ring))) (@snd int int (valq x))))) (fracq (valq x)) *)
by rewrite !mul1r -surjective_pairing.
Qed.
Fact mulq_addl : left_distributive mulq addq.
Definition rat_comRingMixin :=
ComRingMixin mulqA mulqC mul1q mulq_addl nonzero1q.
Canonical rat_Ring := Eval hnf in RingType rat rat_comRingMixin.
Canonical rat_comRing := Eval hnf in ComRingType rat mulqC.
Fact mulVq x : x != 0 -> mulq (invq x) x = 1.
Proof.
(* Goal: forall _ : is_true (negb (@eq_op (GRing.Zmodule.eqType rat_ZmodType) x (GRing.zero rat_ZmodType))), @eq rat (mulq (invq x) x) (GRing.one rat_Ring) *)
rewrite -[x]valqK fracq_eq ?denq_neq0 //= mulr1 mul0r=> nx0.
(* Goal: @eq rat (mulq (invq (fracq (valq x))) (fracq (valq x))) (GRing.one rat_Ring) *)
rewrite !(mulq_frac, invq_frac) ?denq_neq0 //.
(* Goal: @eq rat (fracq (mulq_subdef (invq_subdef (valq x)) (valq x))) (GRing.one rat_Ring) *)
by apply/eqP; rewrite fracq_eq ?mulf_neq0 ?denq_neq0 //= mulr1 mul1r mulrC.
Qed.
Definition RatFieldUnitMixin := FieldUnitMixin mulVq invq0.
Definition RatFieldIdomainMixin := (FieldIdomainMixin rat_field_axiom).
Canonical rat_iDomain :=
Eval hnf in IdomainType rat (FieldIdomainMixin rat_field_axiom).
Canonical rat_fieldType := FieldType rat rat_field_axiom.
Canonical rat_countZmodType := [countZmodType of rat].
Canonical rat_countRingType := [countRingType of rat].
Canonical rat_countComRingType := [countComRingType of rat].
Canonical rat_countUnitRingType := [countUnitRingType of rat].
Canonical rat_countComUnitRingType := [countComUnitRingType of rat].
Canonical rat_countIdomainType := [countIdomainType of rat].
Canonical rat_countFieldType := [countFieldType of rat].
Lemma numq_eq0 x : (numq x == 0) = (x == 0).
Proof.
(* Goal: @eq bool (@eq_op int_eqType (numq x) (GRing.zero int_ZmodType)) (@eq_op rat_eqType x (GRing.zero rat_ZmodType)) *)
rewrite -[x]valqK fracq_eq0; case: fracqP=> /= [|k {x} x k0].
(* Goal: @eq bool (@eq_op int_eqType (numq x) (GRing.zero int_ZmodType)) (orb (@eq_op int_eqType (@GRing.mul int_Ring k (numq x)) (GRing.zero int_ZmodType)) (@eq_op int_eqType (@GRing.mul int_Ring k (denq x)) (GRing.zero int_ZmodType))) *)
(* Goal: forall _ : @eq int (@snd int int (valq x)) (GRing.zero int_ZmodType), @eq bool (@eq_op int_eqType (numq zeroq) (GRing.zero int_ZmodType)) (orb (@eq_op int_eqType (@fst int int (valq x)) (GRing.zero int_ZmodType)) (@eq_op int_eqType (GRing.zero int_ZmodType) (GRing.zero int_ZmodType))) *)
by rewrite eqxx orbT.
(* Goal: @eq bool (@eq_op int_eqType (numq x) (GRing.zero int_ZmodType)) (orb (@eq_op int_eqType (@GRing.mul int_Ring k (numq x)) (GRing.zero int_ZmodType)) (@eq_op int_eqType (@GRing.mul int_Ring k (denq x)) (GRing.zero int_ZmodType))) *)
by rewrite !mulf_eq0 (negPf k0) /= denq_eq0 orbF.
Qed.
Notation "n %:Q" := ((n : int)%:~R : rat)
(at level 2, left associativity, format "n %:Q") : ring_scope.
Hint Resolve denq_neq0 denq_gt0 denq_ge0 : core.
Definition subq (x y : rat) : rat := (addq x (oppq y)).
Definition divq (x y : rat) : rat := (mulq x (invq y)).
Notation "0" := zeroq : rat_scope.
Notation "1" := oneq : rat_scope.
Infix "+" := addq : rat_scope.
Notation "- x" := (oppq x) : rat_scope.
Infix "*" := mulq : rat_scope.
Notation "x ^-1" := (invq x) : rat_scope.
Infix "-" := subq : rat_scope.
Infix "/" := divq : rat_scope.
Lemma ratzE n : ratz n = n%:Q.
Proof.
(* Goal: @eq rat (ratz n) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (n : int) : rat) *)
elim: n=> [|n ihn|n ihn]; first by rewrite mulr0z ratz_frac.
(* Goal: @eq rat (ratz (@GRing.opp int_ZmodType (Posz (S n)))) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.opp int_ZmodType (Posz (S n)))) *)
(* Goal: @eq rat (ratz (Posz (S n))) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S n))) *)
by rewrite intS mulrzDl ratzD ihn.
(* Goal: @eq rat (ratz (@GRing.opp int_ZmodType (Posz (S n)))) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.opp int_ZmodType (Posz (S n)))) *)
by rewrite intS opprD mulrzDl ratzD ihn.
Qed.
Lemma numq_int n : numq n%:Q = n. Proof. by rewrite -ratzE. Qed.
Proof.
(* Goal: @eq int (numq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (n : int) : rat)) n *)
by rewrite -ratzE.
Qed.
Lemma rat0 : 0%:Q = 0. Proof. by []. Qed.
Proof.
(* Goal: @eq rat (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (GRing.zero int_ZmodType : int) : rat) (GRing.zero rat_ZmodType) *)
by [].
Qed.
Lemma numqN x : numq (- x) = - numq x.
Proof.
(* Goal: @eq int (numq (@GRing.opp rat_ZmodType x)) (@GRing.opp int_ZmodType (numq x)) *)
rewrite /numq; case: x=> [[a b] /= /andP [hb]]; rewrite /coprime=> /eqP hab.
(* Goal: @eq int (if @eq_op int_eqType b (GRing.zero int_ZmodType) then GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) else @GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType b (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType (@GRing.opp int_ZmodType a) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (divn (absz (@GRing.opp int_ZmodType a)) (gcdn (absz (@GRing.opp int_ZmodType a)) (absz b))))) (@GRing.opp int_ZmodType a) *)
by rewrite ltr_gtF ?gtr_eqF // {2}abszN hab divn1 mulz_sign_abs.
Qed.
Lemma denqN x : denq (- x) = denq x.
Proof.
(* Goal: @eq int (denq (@GRing.opp rat_ZmodType x)) (denq x) *)
rewrite /denq; case: x=> [[a b] /= /andP [hb]]; rewrite /coprime=> /eqP hab.
(* Goal: @eq int (if @eq_op int_eqType b (GRing.zero int_ZmodType) then GRing.one int_Ring else Posz (divn (absz b) (gcdn (absz (@GRing.opp int_ZmodType a)) (absz b)))) b *)
by rewrite gtr_eqF // abszN hab divn1 gtz0_abs.
Qed.
Fact intq_eq0 n : (n%:~R == 0 :> rat) = (n == 0)%N.
Proof.
(* Goal: @eq bool (@eq_op rat_eqType (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n : rat) (GRing.zero rat_ZmodType : rat)) (@eq_op int_eqType n (Posz O)) *)
by rewrite -ratzE /ratz rat_eqE /numq /denq /= mulr0 eqxx andbT.
Qed.
Lemma fracqE x : fracq x = x.1%:Q / x.2%:Q.
Proof.
(* Goal: @eq rat (fracq x) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@fst int int x : int) : rat) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@snd int int x : int) : rat))) *)
move: x => [m n] /=.
(* Goal: @eq rat (fracq (@pair int int m n)) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) m) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n))) *)
case n0: (n == 0); first by rewrite (eqP n0) fracq0 rat0 invr0 mulr0.
(* Goal: @eq rat (fracq (@pair int int m n)) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) m) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n))) *)
rewrite -[m%:Q]valqK -[n%:Q]valqK.
(* Goal: @eq rat (fracq (@pair int int m n)) (@GRing.mul rat_Ring (fracq (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) m))) (@GRing.inv rat_unitRing (fracq (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n))))) *)
rewrite [_^-1]invq_frac ?(denq_neq0, numq_eq0, n0, intq_eq0) //.
(* Goal: @eq rat (fracq (@pair int int m n)) (@GRing.mul rat_Ring (fracq (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) m))) (fracq (invq_subdef (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n))))) *)
rewrite [_ / _]mulq_frac /= /invq_subdef /mulq_subdef /=.
(* Goal: @eq rat (fracq (@pair int int m n)) (fracq (@pair int int (@GRing.mul int_Ring (@fst int int (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) m))) (@snd int int (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n)))) (@GRing.mul int_Ring (@snd int int (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) m))) (@fst int int (valq (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n)))))) *)
by rewrite -!/(numq _) -!/(denq _) !numq_int !denq_int mul1r mulr1.
Qed.
Lemma divq_num_den x : (numq x)%:Q / (denq x)%:Q = x.
Proof.
(* Goal: @eq (GRing.Ring.sort rat_Ring) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x : int) : rat) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (denq x : int) : rat))) x *)
by rewrite -{3}[x]valqK [valq _]surjective_pairing /= fracqE.
Qed.
Variant divq_spec (n d : int) : int -> int -> rat -> Type :=
| DivqSpecN of d = 0 : divq_spec n d n 0 0
| DivqSpecP k x of k != 0 : divq_spec n d (k * numq x) (k * denq x) x.
Lemma divqP n d : divq_spec n d n d (n%:Q / d%:Q).
Proof.
(* Goal: divq_spec n d n d (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (n : int) : rat) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (d : int) : rat))) *)
set x := (n, d); rewrite -[n]/x.1 -[d]/x.2 -fracqE.
(* Goal: divq_spec (@fst int int x) (@snd int int x) (@fst int int x) (@snd int int x) (fracq x) *)
by case: fracqP => [_|k fx k_neq0] /=; constructor.
Qed.
Lemma divq_eq (nx dx ny dy : rat) :
dx != 0 -> dy != 0 -> (nx / dx == ny / dy) = (nx * dy == ny * dx).
Proof.
(* Goal: forall (_ : is_true (negb (@eq_op rat_eqType dx (GRing.zero rat_ZmodType)))) (_ : is_true (negb (@eq_op rat_eqType dy (GRing.zero rat_ZmodType)))), @eq bool (@eq_op (GRing.Ring.eqType rat_Ring) (@GRing.mul rat_Ring nx (@GRing.inv rat_unitRing dx)) (@GRing.mul rat_Ring ny (@GRing.inv rat_unitRing dy))) (@eq_op (GRing.Ring.eqType rat_Ring) (@GRing.mul rat_Ring nx dy) (@GRing.mul rat_Ring ny dx)) *)
move=> dx_neq0 dy_neq0; rewrite -(inj_eq (@mulIf _ (dx * dy) _)) ?mulf_neq0 //.
(* Goal: @eq bool (@eq_op (GRing.Ring.eqType (GRing.IntegralDomain.ringType rat_iDomain)) (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) (@GRing.mul rat_Ring nx (@GRing.inv rat_unitRing dx)) (@GRing.mul rat_Ring dx dy)) (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) (@GRing.mul rat_Ring ny (@GRing.inv rat_unitRing dy)) (@GRing.mul rat_Ring dx dy))) (@eq_op (GRing.Ring.eqType rat_Ring) (@GRing.mul rat_Ring nx dy) (@GRing.mul rat_Ring ny dx)) *)
by rewrite mulrA divfK // mulrCA divfK // [dx * _ ]mulrC.
Qed.
Variant rat_spec : rat -> int -> int -> Type :=
Rat_spec (n : int) (d : nat) & coprime `|n| d.+1
: rat_spec (n%:Q / d.+1%:Q) n d.+1.
Lemma ratP x : rat_spec x (numq x) (denq x).
Proof.
(* Goal: rat_spec x (numq x) (denq x) *)
rewrite -{1}[x](divq_num_den); case hd: denq => [p|n].
(* Goal: rat_spec (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Negz n)))) (numq x) (Negz n) *)
(* Goal: rat_spec (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz p)))) (numq x) (Posz p) *)
have: 0 < p%:Z by rewrite -hd denq_gt0.
(* Goal: rat_spec (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Negz n)))) (numq x) (Negz n) *)
(* Goal: forall _ : is_true (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (Posz p)), rat_spec (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz p)))) (numq x) (Posz p) *)
case: p hd=> //= n hd; constructor; rewrite -?hd ?divq_num_den //.
(* Goal: rat_spec (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Negz n)))) (numq x) (Negz n) *)
(* Goal: is_true (coprime (absz (numq x)) (S n)) *)
by rewrite -[n.+1]/`|n.+1|%N -hd coprime_num_den.
(* Goal: rat_spec (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Negz n)))) (numq x) (Negz n) *)
by move: (denq_gt0 x); rewrite hd.
Qed.
Lemma coprimeq_num n d : coprime `|n| `|d| -> numq (n%:~R / d%:~R) = sgr d * n.
Proof.
(* Goal: forall _ : is_true (coprime (absz n) (absz d)), @eq int (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@Num.Def.sgr int_numDomainType d) n) *)
move=> cnd /=; have <- := fracqE (n, d).
(* Goal: @eq int (numq (fracq (@pair int int n d))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@Num.Def.sgr int_numDomainType d) n) *)
rewrite /numq /= (eqP (cnd : _ == 1%N)) divn1.
(* Goal: @eq int (if @eq_op int_eqType d (GRing.zero int_ZmodType) then GRing.zero (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) else @GRing.mul (GRing.UnitRing.ringType int_unitRingType) (@exprz int_unitRingType (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType int_unitRingType)) (GRing.one (GRing.UnitRing.ringType int_unitRingType))) (Posz (nat_of_bool (addb (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))))) (Posz (absz n))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@Num.Def.sgr int_numDomainType d) n) *)
have [|d_gt0|d_lt0] := sgrP d; by rewrite (mul0r, mul1r, mulN1r) //= ?[_ ^ _]signrN ?mulNr mulz_sign_abs.
Qed.
Lemma coprimeq_den n d :
coprime `|n| `|d| -> denq (n%:~R / d%:~R) = (if d == 0 then 1 else `|d|).
Proof.
(* Goal: forall _ : is_true (coprime (absz n) (absz d)), @eq int (denq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)))) (if @eq_op int_eqType d (GRing.zero int_ZmodType) then GRing.one (Num.NumDomain.ringType int_numDomainType) else @Num.Def.normr int_numDomainType d) *)
move=> cnd; have <- := fracqE (n, d).
(* Goal: @eq int (denq (fracq (@pair int int n d))) (if @eq_op int_eqType d (GRing.zero int_ZmodType) then GRing.one (Num.NumDomain.ringType int_numDomainType) else @Num.Def.normr int_numDomainType d) *)
by rewrite /denq /= (eqP (cnd : _ == 1%N)) divn1; case: d {cnd}.
Qed.
Lemma denqVz (i : int) : i != 0 -> denq (i%:~R^-1) = `|i|.
Proof.
(* Goal: forall _ : is_true (negb (@eq_op int_eqType i (GRing.zero int_ZmodType))), @eq int (denq (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) i))) (@Num.Def.normr int_numDomainType i) *)
move=> h; rewrite -div1r -[1]/(1%:~R).
(* Goal: @eq int (denq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (GRing.one int_Ring)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (GRing.one int_Ring)) i)))) (@Num.Def.normr int_numDomainType i) *)
by rewrite coprimeq_den /= ?coprime1n // (negPf h).
Qed.
Lemma numqE x : (numq x)%:~R = x * (denq x)%:~R.
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (numq x)) (@GRing.mul rat_Ring x (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (denq x))) *)
by rewrite -{2}[x]divq_num_den divfK // intq_eq0 denq_eq0.
Qed.
Lemma denqP x : {d | denq x = d.+1}.
Proof.
(* Goal: @sig nat (fun d : nat => @eq int (denq x) (Posz (S d))) *)
by rewrite /denq; case: x => [[_ [[|d]|]] //= _]; exists d.
Qed.
Definition normq (x : rat) : rat := `|numq x|%:~R / (denq x)%:~R.
Definition le_rat (x y : rat) := numq x * denq y <= numq y * denq x.
Definition lt_rat (x y : rat) := numq x * denq y < numq y * denq x.
Lemma gt_rat0 x : lt_rat 0 x = (0 < numq x).
Proof.
(* Goal: @eq bool (lt_rat (GRing.zero rat_ZmodType) x) (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq x)) *)
by rewrite /lt_rat mul0r mulr1.
Qed.
Lemma lt_rat0 x : lt_rat x 0 = (numq x < 0).
Proof.
(* Goal: @eq bool (lt_rat x (GRing.zero rat_ZmodType)) (@Num.Def.ltr int_numDomainType (numq x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) *)
by rewrite /lt_rat mul0r mulr1.
Qed.
Lemma ge_rat0 x : le_rat 0 x = (0 <= numq x).
Proof.
(* Goal: @eq bool (le_rat (GRing.zero rat_ZmodType) x) (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq x)) *)
by rewrite /le_rat mul0r mulr1.
Qed.
Lemma le_rat0 x : le_rat x 0 = (numq x <= 0).
Proof.
(* Goal: @eq bool (le_rat x (GRing.zero rat_ZmodType)) (@Num.Def.ler int_numDomainType (numq x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) *)
by rewrite /le_rat mul0r mulr1.
Qed.
Fact le_rat0D x y : le_rat 0 x -> le_rat 0 y -> le_rat 0 (x + y).
Proof.
(* Goal: forall (_ : is_true (le_rat (GRing.zero rat_ZmodType) x)) (_ : is_true (le_rat (GRing.zero rat_ZmodType) y)), is_true (le_rat (GRing.zero rat_ZmodType) (@GRing.add rat_ZmodType x y)) *)
rewrite !ge_rat0 => hnx hny.
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.add rat_ZmodType x y))) *)
have hxy: (0 <= numq x * denq y + numq y * denq x).
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.add rat_ZmodType x y))) *)
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (numq x) (denq y)) (@GRing.mul int_Ring (numq y) (denq x)))) *)
by rewrite addr_ge0 ?mulr_ge0.
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.add rat_ZmodType x y))) *)
by rewrite /numq /= -!/(denq _) ?mulf_eq0 ?denq_eq0 !ler_gtF ?mulr_ge0.
Qed.
Fact le_rat0M x y : le_rat 0 x -> le_rat 0 y -> le_rat 0 (x * y).
Proof.
(* Goal: forall (_ : is_true (le_rat (GRing.zero rat_ZmodType) x)) (_ : is_true (le_rat (GRing.zero rat_ZmodType) y)), is_true (le_rat (GRing.zero rat_ZmodType) (@GRing.mul rat_Ring x y)) *)
rewrite !ge_rat0 => hnx hny.
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.mul rat_Ring x y))) *)
have hxy: (0 <= numq x * denq y + numq y * denq x).
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.mul rat_Ring x y))) *)
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring (numq x) (denq y)) (@GRing.mul int_Ring (numq y) (denq x)))) *)
by rewrite addr_ge0 ?mulr_ge0.
(* Goal: is_true (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.mul rat_Ring x y))) *)
by rewrite /numq /= -!/(denq _) ?mulf_eq0 ?denq_eq0 !ler_gtF ?mulr_ge0.
Qed.
Fact le_rat0_anti x : le_rat 0 x -> le_rat x 0 -> x = 0.
Proof.
(* Goal: forall (_ : is_true (le_rat (GRing.zero rat_ZmodType) x)) (_ : is_true (le_rat x (GRing.zero rat_ZmodType))), @eq rat x (GRing.zero rat_ZmodType) *)
by move=> hx hy; apply/eqP; rewrite -numq_eq0 eqr_le -ge_rat0 -le_rat0 hx hy.
Qed.
Lemma sgr_numq_div (n d : int) : sgr (numq (n%:Q / d%:Q)) = sgr n * sgr d.
Proof.
(* Goal: @eq (Num.NumDomain.sort int_numDomainType) (@Num.Def.sgr int_numDomainType (numq (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (n : int) : rat) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (d : int) : rat))))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@Num.Def.sgr int_numDomainType n) (@Num.Def.sgr int_numDomainType d)) *)
set x := (n, d); rewrite -[n]/x.1 -[d]/x.2 -fracqE.
(* Goal: @eq (Num.NumDomain.sort int_numDomainType) (@Num.Def.sgr int_numDomainType (numq (fracq x))) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@Num.Def.sgr int_numDomainType (@fst int int x)) (@Num.Def.sgr int_numDomainType (@snd int int x))) *)
case: fracqP => [|k fx k_neq0] /=; first by rewrite mulr0.
(* Goal: @eq int (@Num.Def.sgr int_numDomainType (numq fx)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@Num.Def.sgr int_numDomainType (@GRing.mul int_Ring k (numq fx))) (@Num.Def.sgr int_numDomainType (@GRing.mul int_Ring k (denq fx)))) *)
by rewrite !sgrM mulrACA -expr2 sqr_sg k_neq0 sgr_denq mulr1 mul1r.
Qed.
Fact subq_ge0 x y : le_rat 0 (y - x) = le_rat x y.
Proof.
(* Goal: @eq bool (le_rat (GRing.zero rat_ZmodType) (@GRing.add rat_ZmodType y (@GRing.opp rat_ZmodType x))) (le_rat x y) *)
symmetry; rewrite ge_rat0 /le_rat -subr_ge0.
(* Goal: @eq bool (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (@GRing.add (Num.NumDomain.zmodType int_numDomainType) (@GRing.mul int_Ring (numq y) (denq x)) (@GRing.opp (Num.NumDomain.zmodType int_numDomainType) (@GRing.mul int_Ring (numq x) (denq y))))) (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.add rat_ZmodType y (@GRing.opp rat_ZmodType x)))) *)
case: ratP => nx dx cndx; case: ratP => ny dy cndy.
(* Goal: @eq bool (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (@GRing.add (Num.NumDomain.zmodType int_numDomainType) (@GRing.mul int_Ring ny (Posz (S dx))) (@GRing.opp (Num.NumDomain.zmodType int_numDomainType) (@GRing.mul int_Ring nx (Posz (S dy)))))) (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.add rat_ZmodType (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) ny) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dy))))) (@GRing.opp rat_ZmodType (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) nx) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dx))))))))) *)
rewrite -!mulNr addf_div ?intq_eq0 // !mulNr -!rmorphM -rmorphB /=.
(* Goal: @eq bool (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (@GRing.add (Num.NumDomain.zmodType int_numDomainType) (@GRing.mul int_Ring ny (Posz (S dx))) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) nx (Posz (S dy)))))) (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq (@GRing.mul (GRing.Field.ringType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.Field.ringType rat_fieldType)) (GRing.one (GRing.Field.ringType rat_fieldType)) (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring ny (Posz (S dx))) (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring nx (Posz (S dy)))))) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.Field.ringType rat_fieldType)) (GRing.one (GRing.Field.ringType rat_fieldType)) (@GRing.mul int_Ring (Posz (S dy)) (Posz (S dx)))))))) *)
symmetry; rewrite !lerNgt -sgr_cp0 sgr_numq_div mulrC gtr0_sg //.
(* Goal: @eq bool (negb (@eq_op (Num.NumDomain.eqType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.mul (GRing.ComRing.ringType (Num.NumDomain.comRingType int_numDomainType)) (GRing.one (Num.NumDomain.ringType int_numDomainType)) (@Num.Def.sgr int_numDomainType (@GRing.add (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring ny (Posz (S dx))) (@GRing.opp (GRing.Ring.zmodType int_Ring) (@GRing.mul int_Ring nx (Posz (S dy))))))) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)))))) (negb (@Num.Def.ltr (Num.RealDomain.numDomainType int_realDomainType) (@GRing.add (Num.NumDomain.zmodType int_numDomainType) (@GRing.mul int_Ring ny (Posz (S dx))) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) nx (Posz (S dy))))) (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))) *)
by rewrite mul1r sgr_cp0.
Qed.
Fact le_rat_total : total le_rat.
Proof.
(* Goal: @total rat le_rat *)
by move=> x y; apply: ler_total.
Qed.
Fact numq_sign_mul (b : bool) x : numq ((-1) ^+ b * x) = (-1) ^+ b * numq x.
Proof.
(* Goal: @eq int (numq (@GRing.mul rat_Ring (@GRing.exp rat_Ring (@GRing.opp (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (nat_of_bool b)) x)) (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool b)) (numq x)) *)
by case: b; rewrite ?(mul1r, mulN1r) // numqN.
Qed.
Fact numq_div_lt0 n d : n != 0 -> d != 0 ->
(numq (n%:~R / d%:~R) < 0)%R = (n < 0)%R (+) (d < 0)%R.
Proof.
(* Goal: forall (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) n (GRing.zero int_ZmodType)))) (_ : is_true (negb (@eq_op (GRing.Zmodule.eqType int_ZmodType) d (GRing.zero int_ZmodType)))), @eq bool (@Num.Def.ltr int_numDomainType (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)))) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (addb (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))) *)
move=> n0 d0; rewrite -sgr_cp0 sgr_numq_div !sgr_def n0 d0.
(* Goal: @eq bool (@eq_op (Num.NumDomain.eqType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.mul (Num.NumDomain.ringType int_numDomainType) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (@GRing.exp (Num.NumDomain.ringType int_numDomainType) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (GRing.one (Num.NumDomain.ringType int_numDomainType))) (nat_of_bool (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (nat_of_bool true)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (@GRing.exp (Num.NumDomain.ringType int_numDomainType) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType int_numDomainType)) (GRing.one (Num.NumDomain.ringType int_numDomainType))) (nat_of_bool (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (nat_of_bool true))) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))))) (addb (@Num.Def.ltr int_numDomainType n (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr int_numDomainType d (GRing.zero (Num.NumDomain.zmodType int_numDomainType)))) *)
by rewrite !mulr1n -signr_addb; case: (_ (+) _).
Qed.
Lemma normr_num_div n d : `|numq (n%:~R / d%:~R)| = numq (`|n|%:~R / `|d|%:~R).
Proof.
(* Goal: @eq (Num.NumDomain.sort int_numDomainType) (@Num.Def.normr int_numDomainType (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@Num.Def.normr int_numDomainType n)) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@Num.Def.normr int_numDomainType d))))) *)
rewrite (normrEsg n) (normrEsg d) !rmorphM /= invfM mulrACA !sgr_def.
(* Goal: @eq int (@Num.Def.normr int_numDomainType (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) (numq (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (@GRing.exp (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)))) (nat_of_bool (@Num.Def.ltr (Num.RealDomain.numDomainType int_realDomainType) n (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))) (nat_of_bool (negb (@eq_op (Num.NumDomain.eqType (Num.RealDomain.numDomainType int_realDomainType)) n (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))))) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (@GRing.exp (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)))) (nat_of_bool (@Num.Def.ltr (Num.RealDomain.numDomainType int_realDomainType) d (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))) (nat_of_bool (negb (@eq_op (Num.NumDomain.eqType (Num.RealDomain.numDomainType int_realDomainType)) d (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))))))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) *)
have [->|n_neq0] := altP eqP; first by rewrite mul0r mulr0.
(* Goal: @eq int (@Num.Def.normr int_numDomainType (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) (numq (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (@GRing.exp (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)))) (nat_of_bool (@Num.Def.ltr (Num.RealDomain.numDomainType int_realDomainType) n (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))) (nat_of_bool (negb false)))) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (@GRing.exp (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)))) (nat_of_bool (@Num.Def.ltr (Num.RealDomain.numDomainType int_realDomainType) d (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))) (nat_of_bool (negb (@eq_op (Num.NumDomain.eqType (Num.RealDomain.numDomainType int_realDomainType)) d (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))))))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) *)
have [->|d_neq0] := altP eqP; first by rewrite invr0 !mulr0.
(* Goal: @eq int (@Num.Def.normr int_numDomainType (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) (numq (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (@GRing.exp (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)))) (nat_of_bool (@Num.Def.ltr (Num.RealDomain.numDomainType int_realDomainType) n (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))) (nat_of_bool (negb false)))) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (@GRing.exp (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)) (@GRing.opp (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType))) (GRing.one (Num.NumDomain.ringType (Num.RealDomain.numDomainType int_realDomainType)))) (nat_of_bool (@Num.Def.ltr (Num.RealDomain.numDomainType int_realDomainType) d (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType int_realDomainType)))))) (nat_of_bool (negb false)))))) (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) *)
rewrite !intr_sign invr_sign -signr_addb numq_sign_mul -numq_div_lt0 //.
(* Goal: @eq int (@Num.Def.normr int_numDomainType (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) (@GRing.mul int_Ring (@GRing.exp int_Ring (@GRing.opp (GRing.Ring.zmodType int_Ring) (GRing.one int_Ring)) (nat_of_bool (@Num.Def.ltr int_numDomainType (numq (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d)))) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))))) (numq (@GRing.mul (GRing.ComRing.ringType (GRing.ComUnitRing.comRingType rat_comUnitRing)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n) (@GRing.inv (GRing.Field.unitRingType rat_fieldType) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) d))))) *)
by apply: (canRL (signrMK _)); rewrite mulz_sign_abs.
Qed.
Fact norm_ratN x : normq (- x) = normq x.
Proof.
(* Goal: @eq rat (normq (@GRing.opp rat_ZmodType x)) (normq x) *)
by rewrite /normq numqN denqN normrN.
Qed.
Fact ge_rat0_norm x : le_rat 0 x -> normq x = x.
Proof.
(* Goal: forall _ : is_true (le_rat (GRing.zero rat_ZmodType) x), @eq rat (normq x) x *)
rewrite ge_rat0; case: ratP=> [] // n d cnd n_ge0.
(* Goal: @eq rat (normq (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S d)))))) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S d))))) *)
by rewrite /normq /= normr_num_div ?ger0_norm // divq_num_den.
Qed.
Fact lt_rat_def x y : (lt_rat x y) = (y != x) && (le_rat x y).
Proof.
(* Goal: @eq bool (lt_rat x y) (andb (negb (@eq_op rat_eqType y x)) (le_rat x y)) *)
by rewrite /lt_rat ltr_def rat_eq.
Qed.
Definition ratLeMixin := RealLeMixin le_rat0D le_rat0M le_rat0_anti
subq_ge0 (@le_rat_total 0) norm_ratN ge_rat0_norm lt_rat_def.
Canonical rat_numDomainType := NumDomainType rat ratLeMixin.
Canonical rat_numFieldType := [numFieldType of rat].
Canonical rat_realDomainType := RealDomainType rat (@le_rat_total 0).
Canonical rat_realFieldType := [realFieldType of rat].
Lemma numq_ge0 x : (0 <= numq x) = (0 <= x).
Proof.
(* Goal: @eq bool (@Num.Def.ler int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq x)) (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) x) *)
by case: ratP => n d cnd; rewrite ?pmulr_lge0 ?invr_gt0 (ler0z, ltr0z).
Qed.
Lemma numq_le0 x : (numq x <= 0) = (x <= 0).
Proof.
(* Goal: @eq bool (@Num.Def.ler int_numDomainType (numq x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ler rat_numDomainType x (GRing.zero (Num.NumDomain.zmodType rat_numDomainType))) *)
by rewrite -oppr_ge0 -numqN numq_ge0 oppr_ge0.
Qed.
Lemma numq_gt0 x : (0 < numq x) = (0 < x).
Proof.
(* Goal: @eq bool (@Num.Def.ltr int_numDomainType (GRing.zero (Num.NumDomain.zmodType int_numDomainType)) (numq x)) (@Num.Def.ltr rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) x) *)
by rewrite !ltrNge numq_le0.
Qed.
Lemma numq_lt0 x : (numq x < 0) = (x < 0).
Proof.
(* Goal: @eq bool (@Num.Def.ltr int_numDomainType (numq x) (GRing.zero (Num.NumDomain.zmodType int_numDomainType))) (@Num.Def.ltr rat_numDomainType x (GRing.zero (Num.NumDomain.zmodType rat_numDomainType))) *)
by rewrite !ltrNge numq_ge0.
Qed.
Lemma sgr_numq x : sgz (numq x) = sgz x.
Proof.
(* Goal: @eq int (@sgz int_numDomainType (numq x)) (@sgz rat_numDomainType x) *)
apply/eqP; case: (sgzP x); rewrite sgz_cp0 ?(numq_gt0, numq_lt0) //.
(* Goal: forall _ : @eq (Num.RealDomain.sort rat_realDomainType) x (GRing.zero (Num.RealDomain.zmodType rat_realDomainType)), is_true (@eq_op (Num.RealDomain.eqType int_realDomainType) (numq x) (GRing.zero (Num.RealDomain.zmodType int_realDomainType))) *)
by move->.
Qed.
Lemma denq_mulr_sign (b : bool) x : denq ((-1) ^+ b * x) = denq x.
Proof.
(* Goal: @eq int (denq (@GRing.mul rat_Ring (@GRing.exp rat_Ring (@GRing.opp (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) (nat_of_bool b)) x)) (denq x) *)
by case: b; rewrite ?(mul1r, mulN1r) // denqN.
Qed.
Lemma denq_norm x : denq `|x| = denq x.
Proof.
(* Goal: @eq int (denq (@Num.Def.normr rat_numDomainType x)) (denq x) *)
by rewrite normrEsign denq_mulr_sign.
Qed.
Fact rat_archimedean : Num.archimedean_axiom [numDomainType of rat].
Proof.
(* Goal: Num.archimedean_axiom (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)) *)
move=> x; exists `|numq x|.+1; rewrite mulrS ltr_spaddl //.
(* Goal: is_true (@Num.Def.ler (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)) (@Num.Def.normr (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)) x) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)))) (GRing.one (Num.NumDomain.ringType (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)))) (absz (numq x)))) *)
rewrite pmulrn abszE intr_norm numqE normrM ler_pemulr ?norm_ge0 //.
(* Goal: is_true (@Num.Def.ler (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)) (GRing.one (Num.NumDomain.ringType (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)))) (@Num.Def.normr (@Num.NumDomain.clone rat rat_numDomainType (Num.NumDomain.class rat_numDomainType) (fun x : phantom (Num.NumDomain.class_of (Num.NumDomain.sort rat_numDomainType)) (Num.NumDomain.class rat_numDomainType) => x)) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (denq x)))) *)
by rewrite -intr_norm ler1n absz_gt0 denq_eq0.
Qed.
Canonical archiType := ArchiFieldType rat rat_archimedean.
Section QintPred.
Definition Qint := [qualify a x : rat | denq x == 1].
Fact Qint_key : pred_key Qint. Proof. by []. Qed.
Proof.
(* Goal: @pred_key rat (@has_quality (S O) rat Qint) *)
by [].
Qed.
Lemma numqK : {in Qint, cancel (fun x => numq x) intr}.
Proof.
(* Goal: @prop_in1 rat (@mem rat (predPredType rat) (@has_quality (S O) rat Qint)) (fun x : rat => @eq rat (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) ((fun x0 : rat => numq x0) x)) x) (inPhantom (@cancel int rat (fun x : rat => numq x) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)))) *)
by move=> x /(_ =P 1 :> int) Zx; rewrite numqE Zx rmorph1 mulr1.
Qed.
Lemma QintP x : reflect (exists z, x = z%:~R) (x \in Qint).
Proof.
(* Goal: Bool.reflect (@ex int (fun z : int => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) x (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) z))) (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) x (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) *)
apply: (iffP idP) => [/numqK <- | [z ->]]; first by exists (numq x).
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) z) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) *)
by rewrite Qint_def denq_int.
Qed.
Fact Qint_subring_closed : subring_closed Qint.
Canonical Qint_opprPred := OpprPred Qint_subring_closed.
Canonical Qint_addrPred := AddrPred Qint_subring_closed.
Canonical Qint_mulrPred := MulrPred Qint_subring_closed.
Canonical Qint_zmodPred := ZmodPred Qint_subring_closed.
Canonical Qint_semiringPred := SemiringPred Qint_subring_closed.
Canonical Qint_smulrPred := SmulrPred Qint_subring_closed.
Canonical Qint_subringPred := SubringPred Qint_subring_closed.
End QintPred.
Section QnatPred.
Definition Qnat := [qualify a x : rat | (x \is a Qint) && (0 <= x)].
Canonical Qnat_keyed := KeyedQualifier Qnat_key.
Lemma Qnat_def x : (x \is a Qnat) = (x \is a Qint) && (0 <= x).
Proof.
(* Goal: @eq bool (@in_mem rat x (@mem rat (predPredType rat) (@has_quality (S O) rat Qnat))) (andb (@in_mem rat x (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) x)) *)
by [].
Qed.
Lemma QnatP x : reflect (exists n : nat, x = n%:R) (x \in Qnat).
Proof.
(* Goal: Bool.reflect (@ex nat (fun n : nat => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) x (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n))) (@in_mem (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) x (@mem rat (predPredType rat) (@has_quality (S O) rat Qnat))) *)
rewrite Qnat_def; apply: (iffP idP) => [/andP []|[n ->]]; last first.
(* Goal: forall (_ : is_true (@in_mem rat x (@mem rat (predPredType rat) (@has_quality (S O) rat Qint)))) (_ : is_true (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) x)), @ex nat (fun n : nat => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) x (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n)) *)
(* Goal: is_true (andb (@in_mem rat (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n))) *)
by rewrite Qint_def pmulrn denq_int eqxx ler0z.
(* Goal: forall (_ : is_true (@in_mem rat x (@mem rat (predPredType rat) (@has_quality (S O) rat Qint)))) (_ : is_true (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) x)), @ex nat (fun n : nat => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) x (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n)) *)
by move=> /QintP [] [] n ->; rewrite ?ler0z // => _; exists n.
Qed.
Fact Qnat_semiring_closed : semiring_closed Qnat.
Proof.
(* Goal: @GRing.semiring_closed rat_Ring (@has_quality (S O) rat Qnat) *)
do 2?split; move=> // x y; rewrite !Qnat_def => /andP[xQ hx] /andP[yQ hy].
(* Goal: is_true (andb (@in_mem rat (@GRing.mul rat_Ring x y) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) (@GRing.mul rat_Ring x y))) *)
(* Goal: is_true (andb (@in_mem rat (@GRing.add (GRing.Ring.zmodType rat_Ring) x y) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) (@GRing.add (GRing.Ring.zmodType rat_Ring) x y))) *)
by rewrite rpredD // addr_ge0.
(* Goal: is_true (andb (@in_mem rat (@GRing.mul rat_Ring x y) (@mem rat (predPredType rat) (@has_quality (S O) rat Qint))) (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) (@GRing.mul rat_Ring x y))) *)
by rewrite rpredM // mulr_ge0.
Qed.
Canonical Qnat_addrPred := AddrPred Qnat_semiring_closed.
Canonical Qnat_mulrPred := MulrPred Qnat_semiring_closed.
Canonical Qnat_semiringPred := SemiringPred Qnat_semiring_closed.
End QnatPred.
Lemma natq_div m n : n %| m -> (m %/ n)%:R = m%:R / n%:R :> rat.
Proof.
(* Goal: forall _ : is_true (dvdn n m), @eq rat (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (divn m n)) (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) m) (@GRing.inv rat_unitRing (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) n))) *)
by apply: char0_natf_div; apply: char_num.
Qed.
Section InRing.
Variable R : unitRingType.
Definition ratr x : R := (numq x)%:~R / (denq x)%:~R.
Lemma ratr_int z : ratr z%:~R = z%:~R.
Proof.
(* Goal: @eq (GRing.UnitRing.sort R) (ratr (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) z)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType R)) (GRing.one (GRing.UnitRing.ringType R)) z) *)
by rewrite /ratr numq_int denq_int divr1.
Qed.
Lemma ratr_nat n : ratr n%:R = n%:R.
Proof.
(* Goal: @eq (GRing.UnitRing.sort R) (ratr (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) n)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType R)) (GRing.one (GRing.UnitRing.ringType R)) n) *)
exact: (ratr_int n).
Qed.
Lemma rpred_rat S (ringS : @divringPred R S) (kS : keyed_pred ringS) a :
ratr a \in kS.
Proof.
(* Goal: is_true (@in_mem (GRing.UnitRing.sort R) (ratr a) (@mem (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType R))) (predPredType (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType R)))) (@unkey_pred (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType R))) S (@GRing.Pred.opp_key (GRing.Ring.zmodType (GRing.UnitRing.ringType R)) S (@GRing.Pred.zmod_opp (GRing.Ring.zmodType (GRing.UnitRing.ringType R)) S (@GRing.Pred.subring_zmod (GRing.UnitRing.ringType R) S (@GRing.Pred.divring_ring R S ringS)))) kS))) *)
by rewrite rpred_div ?rpred_int.
Qed.
End InRing.
Section Fmorph.
Implicit Type rR : unitRingType.
Lemma fmorph_rat (aR : fieldType) rR (f : {rmorphism aR -> rR}) a :
f (ratr _ a) = ratr _ a.
Proof.
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType rR))) (@GRing.RMorphism.apply (GRing.Field.ringType aR) (GRing.UnitRing.ringType rR) (Phant (forall _ : GRing.Field.sort aR, GRing.UnitRing.sort rR)) f (ratr (GRing.Field.unitRingType aR) a)) (ratr rR a) *)
by rewrite fmorph_div !rmorph_int.
Qed.
Lemma fmorph_eq_rat rR (f : {rmorphism rat -> rR}) : f =1 ratr _.
Proof.
(* Goal: @eqfun (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.UnitRing.ringType rR))) (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (@GRing.RMorphism.apply rat_Ring (GRing.UnitRing.ringType rR) (Phant (forall _ : rat, GRing.UnitRing.sort rR)) f) (ratr rR) *)
by move=> a; rewrite -{1}[a]divq_num_den fmorph_div !rmorph_int.
Qed.
End Fmorph.
Section Linear.
Implicit Types (U V : lmodType rat) (A B : lalgType rat).
Lemma rat_linear U V (f : U -> V) : additive f -> linear f.
Lemma rat_lrmorphism A B (f : A -> B) : rmorphism f -> lrmorphism f.
Proof.
(* Goal: forall _ : @GRing.RMorphism.class_of (@GRing.Lalgebra.ringType rat_Ring (Phant rat) A) (@GRing.Lalgebra.ringType rat_Ring (Phant rat) B) f, @GRing.LRMorphism.class_of rat_Ring A (@GRing.Lalgebra.ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) B) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) B)) f *)
by case=> /rat_linear fZ fM; do ?split=> //; apply: fZ.
Qed.
End Linear.
Section InPrealField.
Variable F : numFieldType.
Fact ratr_is_rmorphism : rmorphism (@ratr F).
Canonical ratr_additive := Additive ratr_is_rmorphism.
Canonical ratr_rmorphism := RMorphism ratr_is_rmorphism.
Lemma ler_rat : {mono (@ratr F) : x y / x <= y}.
Proof.
(* Goal: @monomorphism_2 rat (GRing.UnitRing.sort (Num.NumField.unitRingType F)) bool (ratr (Num.NumField.unitRingType F)) (fun x y : rat => @Num.Def.ler rat_numDomainType x y) (fun x y : GRing.UnitRing.sort (Num.NumField.unitRingType F) => @Num.Def.ler (Num.NumField.numDomainType F) x y) *)
move=> x y /=; case: (ratP x) => nx dx cndx; case: (ratP y) => ny dy cndy.
(* Goal: @eq bool (@Num.Def.ler (Num.NumField.numDomainType F) (ratr (Num.NumField.unitRingType F) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) nx) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dx)))))) (ratr (Num.NumField.unitRingType F) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) ny) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dy))))))) (@Num.Def.ler rat_numDomainType (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) nx) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dx))))) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) ny) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dy)))))) *)
rewrite !fmorph_div /= !ratr_int !ler_pdivl_mulr ?ltr0z //.
(* Goal: @eq bool (@Num.Def.ler (Num.NumField.numDomainType F) (@GRing.mul (Num.NumField.ringType F) (@GRing.mul (GRing.UnitRing.ringType (Num.NumField.unitRingType F)) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) nx) (@GRing.inv (Num.NumField.unitRingType F) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) (Posz (S dx))))) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) (Posz (S dy)))) (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) (GRing.one (GRing.UnitRing.ringType (Num.NumField.unitRingType F))) ny)) (@Num.Def.ler (Num.NumField.numDomainType rat_numFieldType) (@GRing.mul (Num.NumField.ringType rat_numFieldType) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) nx) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dx))))) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (Posz (S dy)))) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) ny)) *)
by rewrite ![_ / _ * _]mulrAC !ler_pdivr_mulr ?ltr0z // -!rmorphM /= !ler_int.
Qed.
Lemma ltr_rat : {mono (@ratr F) : x y / x < y}.
Proof.
(* Goal: @monomorphism_2 rat (GRing.UnitRing.sort (Num.NumField.unitRingType F)) bool (ratr (Num.NumField.unitRingType F)) (fun x y : rat => @Num.Def.ltr rat_numDomainType x y) (fun x y : GRing.UnitRing.sort (Num.NumField.unitRingType F) => @Num.Def.ltr (Num.NumField.numDomainType F) x y) *)
exact: lerW_mono ler_rat.
Qed.
Lemma ler0q x : (0 <= ratr F x) = (0 <= x).
Proof.
(* Goal: @eq bool (@Num.Def.ler (Num.NumField.numDomainType F) (GRing.zero (Num.NumDomain.zmodType (Num.NumField.numDomainType F))) (ratr (Num.NumField.unitRingType F) x)) (@Num.Def.ler rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) x) *)
by rewrite (_ : 0 = ratr F 0) ?ler_rat ?rmorph0.
Qed.
Lemma lerq0 x : (ratr F x <= 0) = (x <= 0).
Proof.
(* Goal: @eq bool (@Num.Def.ler (Num.NumField.numDomainType F) (ratr (Num.NumField.unitRingType F) x) (GRing.zero (Num.NumDomain.zmodType (Num.NumField.numDomainType F)))) (@Num.Def.ler rat_numDomainType x (GRing.zero (Num.NumDomain.zmodType rat_numDomainType))) *)
by rewrite (_ : 0 = ratr F 0) ?ler_rat ?rmorph0.
Qed.
Lemma ltr0q x : (0 < ratr F x) = (0 < x).
Proof.
(* Goal: @eq bool (@Num.Def.ltr (Num.NumField.numDomainType F) (GRing.zero (Num.NumDomain.zmodType (Num.NumField.numDomainType F))) (ratr (Num.NumField.unitRingType F) x)) (@Num.Def.ltr rat_numDomainType (GRing.zero (Num.NumDomain.zmodType rat_numDomainType)) x) *)
by rewrite (_ : 0 = ratr F 0) ?ltr_rat ?rmorph0.
Qed.
Lemma ltrq0 x : (ratr F x < 0) = (x < 0).
Lemma ratr_sg x : ratr F (sgr x) = sgr (ratr F x).
Proof.
(* Goal: @eq (GRing.UnitRing.sort (Num.NumField.unitRingType F)) (ratr (Num.NumField.unitRingType F) (@Num.Def.sgr rat_numDomainType x)) (@Num.Def.sgr (Num.NumField.numDomainType F) (ratr (Num.NumField.unitRingType F) x)) *)
by rewrite !sgr_def fmorph_eq0 ltrq0 rmorphMn rmorph_sign.
Qed.
Lemma ratr_norm x : ratr F `|x| = `|ratr F x|.
Proof.
(* Goal: @eq (GRing.UnitRing.sort (Num.NumField.unitRingType F)) (ratr (Num.NumField.unitRingType F) (@Num.Def.normr rat_numDomainType x)) (@Num.Def.normr (Num.NumField.numDomainType F) (ratr (Num.NumField.unitRingType F) x)) *)
rewrite {2}[x]numEsign rmorphMsign normrMsign [`|ratr F _|]ger0_norm //.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType F) (GRing.zero (Num.NumDomain.zmodType (Num.NumField.numDomainType F))) (ratr (Num.NumField.unitRingType F) (@Num.Def.normr (Num.RealDomain.numDomainType rat_realDomainType) x))) *)
by rewrite ler0q ?normr_ge0.
Qed.
End InPrealField.
Arguments ratr {R}.
Ltac rat_to_ring :=
rewrite -?[0%Q]/(0 : rat)%R -?[1%Q]/(1 : rat)%R
-?[(_ - _)%Q]/(_ - _ : rat)%R -?[(_ / _)%Q]/(_ / _ : rat)%R
-?[(_ + _)%Q]/(_ + _ : rat)%R -?[(_ * _)%Q]/(_ * _ : rat)%R
-?[(- _)%Q]/(- _ : rat)%R -?[(_ ^-1)%Q]/(_ ^-1 : rat)%R /=.
Ltac ring_to_rat :=
rewrite -?[0%R]/0%Q -?[1%R]/1%Q
-?[(_ - _)%R]/(_ - _)%Q -?[(_ / _)%R]/(_ / _)%Q
-?[(_ + _)%R]/(_ + _)%Q -?[(_ * _)%R]/(_ * _)%Q
-?[(- _)%R]/(- _)%Q -?[(_ ^-1)%R]/(_ ^-1)%Q /=.
Lemma rat_ring_theory : (ring_theory 0%Q 1%Q addq mulq subq oppq eq).
Proof.
(* Goal: @ring_theory rat zeroq oneq addq mulq subq oppq (@eq rat) *)
split => * //; rat_to_ring; by rewrite ?(add0r, addrA, mul1r, mulrA, mulrDl, subrr) // (addrC, mulrC).
Qed.
Require setoid_ring.Field_theory setoid_ring.Field_tac.
Lemma rat_field_theory :
Field_theory.field_theory 0%Q 1%Q addq mulq subq oppq divq invq eq.
Proof.
(* Goal: @Field_theory.field_theory rat zeroq oneq addq mulq subq oppq divq invq (@eq rat) *)
split => //; first exact rat_ring_theory.
(* Goal: forall (p : rat) (_ : not (@eq rat p zeroq)), @eq rat (mulq (invq p) p) oneq *)
by move=> p /eqP p_neq0; rat_to_ring; rewrite mulVf.
Qed.
Add Field rat_field : rat_field_theory.
|
Require Import Arith Omega.
Require OrderedTypeEx.
Require FSetList.
Module NatSet := FSetList.Make(OrderedTypeEx.Nat_as_OT).
Import NatSet.
Infix "++" := add (at level 60, right associativity).
Notation "s [=] t" := (Equal s t) (at level 70, no associativity).
Require FSetFacts FSetProperties.
Require Extraction.
Module GeneralProperties := FSetProperties.Properties NatSet.
Import GeneralProperties.
Section problem_knows_not_refl.
Variable town: t.
Variable n:nat.
Variable cardinality: cardinal town = 2*n+1.
Variable knows: elt -> elt -> Prop.
Variable knows_sym: forall m n, knows m n -> knows n m.
Variable knows_extensional:forall m n p, E.eq n p -> knows m n-> knows m p.
Variable property: forall B, Subset B town -> cardinal B = n ->
{d:elt | In d (diff town B)/\(forall b, In b B -> knows d b)}.
Lemma extendible_by_one:forall B', cardinal B' <= (cardinal town)-1 -> {d:elt| In d town /\ ~(In d B')}.
Lemma extendible_to_n:forall B', Subset B' town -> cardinal B' <= n ->
{B:t| cardinal B = n /\ Subset B' B /\ Subset B town}.
Lemma inductive_invariant:forall m, m<= n ->
{B':t| Subset B' town /\ cardinal B' = m /\ forall b'0 b'1, In b'0 B' -> In b'1 B' -> ~(E.eq b'0 b'1) -> knows b'0 b'1}.
Theorem AMM11262: {e:elt | In e town /\ forall u, In u town /\ ~(E.eq u e)-> knows e u}.
Proof.
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
destruct (inductive_invariant n (le_refl n)) as [B [HB1 [HB2 HB3]]].
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
destruct (property B HB1 HB2) as [d [Hd1 Hd2]].
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
set (C:=(diff town (d ++ B))).
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
assert (H_susbset_C:Subset C town); [ subst C; apply subset_diff; apply subset_refl | ].
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
assert (H_inter_town: inter town (d ++ B)[=]d ++ B).
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
(* Goal: Equal (inter town (add d B)) (add d B) *)
rewrite inter_sym; apply inter_subset_equal; apply subset_add_3; trivial; apply diff_1 with B; assumption.
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
assert (H_d_nin_B:~In d B); [apply diff_2 with town; assumption|].
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
assert (H_cardinal_C:cardinal C=n).
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
(* Goal: @Logic.eq nat (cardinal C) n *)
assert (H_aux:cardinal (inter town (d ++ B))=S n).
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
(* Goal: @Logic.eq nat (cardinal C) n *)
(* Goal: @Logic.eq nat (cardinal (inter town (add d B))) (S n) *)
rewrite (@Equal_cardinal (inter town (d ++ B)) (d++B) H_inter_town); rewrite (add_cardinal_2 H_d_nin_B); rewrite HB2; reflexivity.
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
(* Goal: @Logic.eq nat (cardinal C) n *)
generalize (diff_inter_cardinal town (d++B)); fold C; rewrite H_aux; rewrite cardinality; omega.
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
destruct (property C H_susbset_C H_cardinal_C) as [e [He1 He2]].
(* Goal: @sig elt (fun e : elt => and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u)) *)
exists e.
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
assert (H_dB_town:Subset (d++B) town).
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: Subset (add d B) town *)
intros a Ha0; destruct ((proj1 (FM.add_iff B d a)) Ha0) as [Had|HaB].
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: In a town *)
(* Goal: In a town *)
rewrite <- Had; apply diff_1 with B; assumption.
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: In a town *)
apply HB1; assumption.
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
assert (H_diff:diff town C [=] d++B ).
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: Equal (diff town C) (add d B) *)
unfold C; split; intro H_mem.
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: In a (diff town (diff town (add d B))) *)
(* Goal: In a (add d B) *)
assert (H_a0:=diff_1 H_mem); assert (H_a1:=diff_2 H_mem); destruct (In_dec a (d++B)) as [H_a2|H_a2]; trivial; apply False_ind; apply H_a1; exact (diff_3 H_a0 H_a2).
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: In a (diff town (diff town (add d B))) *)
destruct (In_dec a (diff town (d++B))) as [H_a2|H_a2].
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: In a (diff town (diff town (add d B))) *)
(* Goal: In a (diff town (diff town (add d B))) *)
apply False_ind; exact (diff_2 H_a2 H_mem).
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
(* Goal: In a (diff town (diff town (add d B))) *)
apply diff_3; trivial; apply H_dB_town; assumption.
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
assert (H_e_dB:In e (d++B)); [rewrite <- H_diff; assumption|].
(* Goal: and (In e town) (forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u) *)
split.
(* Goal: forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u *)
(* Goal: In e town *)
apply diff_1 with C; assumption...
intros u [Hu Hu'].
assert (H_town_part:town [=] (union C (d++B))).
(* Goal: forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u *)
(* Goal: In e town *)
(* Goal: Equal town (union C (add d B)) *)
rewrite <- (diff_inter_all town (d++B)); rewrite H_inter_town; apply equal_refl.
(* Goal: forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u *)
(* Goal: In e town *)
rewrite H_town_part in Hu.
destruct (union_1 Hu) as [HuC|HudB].
apply He2; assumption.
destruct ((proj1 (FM.add_iff B d u)) HudB) as [Hud|HuB].
apply knows_extensional with d; trivial.
apply knows_sym.
destruct ((proj1 (FM.add_iff B d e)) H_e_dB) as [Hed|HeB].
(* Goal: forall (u : elt) (_ : and (In u town) (not (E.eq u e))), knows e u *)
(* Goal: In e town *)
(* Goal: In e town *)
apply False_ind; apply Hu'; rewrite <- Hud; assumption.
apply Hd2; assumption.
destruct ((proj1 (FM.add_iff B d e)) H_e_dB) as [Hed|HeB].
apply knows_sym; apply knows_extensional with d; trivial; apply knows_sym; apply Hd2; assumption.
apply HB3; assumption || contradict Hu'; auto with *.
Qed.
Qed.
End problem_knows_not_refl.
Extraction "amm11262" AMM11262.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_betweennotequal.
Require Export GeoCoq.Elements.OriginalProofs.lemma_localextension.
Require Export GeoCoq.Elements.OriginalProofs.lemma_extensionunique.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_3_7a :
forall A B C D,
BetS A B C -> BetS B C D ->
BetS A C D.
Proof.
(* Goal: forall (A B C D : @Point Ax0) (_ : @BetS Ax0 A B C) (_ : @BetS Ax0 B C D), @BetS Ax0 A C D *)
intros.
(* Goal: @BetS Ax0 A C D *)
assert (neq A C) by (forward_using lemma_betweennotequal).
(* Goal: @BetS Ax0 A C D *)
assert (neq C D) by (forward_using lemma_betweennotequal).
(* Goal: @BetS Ax0 A C D *)
let Tf:=fresh in assert (Tf:exists E, (BetS A C E /\ Cong C E C D)) by (conclude lemma_localextension);destruct Tf as [E];spliter.
(* Goal: @BetS Ax0 A C D *)
assert (Cong C D C E) by (conclude lemma_congruencesymmetric).
(* Goal: @BetS Ax0 A C D *)
assert (BetS B C E) by (conclude lemma_3_6a).
(* Goal: @BetS Ax0 A C D *)
assert (eq D E) by (conclude lemma_extensionunique).
(* Goal: @BetS Ax0 A C D *)
assert (BetS A C D) by (conclude cn_equalitysub).
(* Goal: @BetS Ax0 A C D *)
close.
Qed.
End Euclid.
|
Set Automatic Coercions Import.
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Zring.
Require Export Fraction_field.
Lemma Z_one_diff_zero : ~ Equal (ring_unit ZZ) (monoid_unit ZZ).
Proof.
(* Goal: not (@Equal (sgroup_set (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ))))))) (ring_unit (cring_ring (idomain_ring ZZ))) (@monoid_unit (monoid_sgroup (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))) (monoid_on_def (group_monoid (abelian_group_group (ring_group (cring_ring (idomain_ring ZZ)))))))) *)
simpl in |- *.
(* Goal: not (@eq Z (ring_unit Zr_aux) Z0) *)
unfold not in |- *; intros.
(* Goal: False *)
inversion H.
Qed.
Definition Q := fraction_cfield Z_one_diff_zero Zzero_dec.
|
Require Export Arith.
Fixpoint factorial (n : nat) : nat :=
match n with
| O => 1
| S p => S p * factorial p
end.
Lemma fact_pred :
forall n : nat, 0 < n -> factorial n = n * factorial (pred n).
Proof.
(* Goal: forall (n : nat) (_ : lt O n), @eq nat (factorial n) (Init.Nat.mul n (factorial (Init.Nat.pred n))) *)
simple induction n; auto with arith.
Qed.
Hint Resolve fact_pred.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrbool ssrfun ssrnat eqtype seq choice div fintype.
From mathcomp
Require Import path tuple bigop finset prime ssralg poly polydiv mxpoly.
From mathcomp
Require Import countalg closed_field ssrnum ssrint rat intdiv.
From mathcomp
Require Import fingroup finalg zmodp cyclic pgroup sylow.
From mathcomp
Require Import vector falgebra fieldext separable galois.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GroupScope GRing.Theory Num.Theory.
Local Open Scope ring_scope.
Local Notation "p ^ f" := (map_poly f p) : ring_scope.
Local Notation "p ^@" := (p ^ in_alg _) (at level 2, format "p ^@"): ring_scope.
Local Notation "<< E ; u >>" := <<E; u>>%VS.
Local Notation Qmorphism C := {rmorphism rat -> C}.
Lemma rat_algebraic_archimedean (C : numFieldType) (QtoC : Qmorphism C) :
integralRange QtoC -> Num.archimedean_axiom C.
Proof.
(* Goal: forall _ : @integralRange rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC), Num.archimedean_axiom (Num.NumField.numDomainType C) *)
move=> algC x.
(* Goal: @ex nat (fun ub : nat => is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) x) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) ub))) *)
without loss x_ge0: x / 0 <= x by rewrite -normr_id; apply; apply: normr_ge0.
(* Goal: @ex nat (fun ub : nat => is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) x) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) ub))) *)
have [-> | nz_x] := eqVneq x 0; first by exists 1%N; rewrite normr0.
(* Goal: @ex nat (fun ub : nat => is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) x) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) ub))) *)
have [p mon_p px0] := algC x; exists (\sum_(j < size p) `|numq p`_j|)%N.
(* Goal: is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) x) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (@BigOp.bigop nat (Finite.sort (ordinal_finType (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)))) O (index_enum (ordinal_finType (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)))) (fun j : ordinal (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)) => @BigBody nat (ordinal (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p))) j addn true (absz (numq (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)) j)))))))) *)
rewrite ger0_norm // real_ltrNge ?rpred_nat ?ger0_real //.
(* Goal: is_true (negb (@Num.Def.ler (Num.NumField.numDomainType C) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (@BigOp.bigop nat (Finite.sort (ordinal_finType (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)))) O (index_enum (ordinal_finType (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)))) (fun j : ordinal (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)) => @BigBody nat (ordinal (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p))) j addn true (absz (numq (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring p)) j))))))) x)) *)
apply: contraL px0 => lb_x; rewrite rootE gtr_eqF // horner_coef size_map_poly.
(* Goal: is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumField.ringType C))) (Finite.sort (ordinal_finType (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)))) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (index_enum (ordinal_finType (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)))) (fun i : ordinal (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumField.ringType C))) (ordinal (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p))) i (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C))) true (@GRing.mul (Num.NumField.ringType C) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumField.ringType C))) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)) i)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)) i)))))) *)
have x_gt0 k: 0 < x ^+ k by rewrite exprn_gt0 // ltr_def nz_x.
(* Goal: is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumField.ringType C))) (Finite.sort (ordinal_finType (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)))) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (index_enum (ordinal_finType (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)))) (fun i : ordinal (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)) => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumField.ringType C))) (ordinal (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p))) i (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C))) true (@GRing.mul (Num.NumField.ringType C) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumField.ringType C))) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)) i)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (@size (GRing.Ring.sort (GRing.Field.ringType rat_fieldType)) (@polyseq (GRing.Field.ringType rat_fieldType) p)) i)))))) *)
move: lb_x; rewrite polySpred ?monic_neq0 // !big_ord_recr coef_map /=.
(* Goal: forall _ : is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (addn (@BigOp.bigop nat (ordinal (Nat.pred (@size rat (@polyseq rat_Ring p)))) O (index_enum (ordinal_finType (Nat.pred (@size rat (@polyseq rat_Ring p))))) (fun i : ordinal (Nat.pred (@size rat (@polyseq rat_Ring p))) => @BigBody nat (ordinal (Nat.pred (@size rat (@polyseq rat_Ring p)))) i addn true (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (Nat.pred (@size rat (@polyseq rat_Ring p))) i)))))) (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (Nat.pred (@size rat (@polyseq rat_Ring p)))))))) x), is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C)) (@BigOp.bigop (Num.NumField.sort C) (ordinal (Nat.pred (@size rat (@polyseq rat_Ring p)))) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (index_enum (ordinal_finType (Nat.pred (@size rat (@polyseq rat_Ring p))))) (fun i : ordinal (Nat.pred (@size rat (@polyseq rat_Ring p))) => @BigBody (Num.NumField.sort C) (ordinal (Nat.pred (@size rat (@polyseq rat_Ring p)))) i (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C))) true (@GRing.mul (Num.NumField.ringType C) (@nth (Num.NumField.sort C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (Nat.pred (@size rat (@polyseq rat_Ring p))) i)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (Nat.pred (@size rat (@polyseq rat_Ring p))) i))))) (@GRing.mul (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (Nat.pred (@size rat (@polyseq rat_Ring p))))) (@GRing.exp (Num.NumField.ringType C) x (Nat.pred (@size rat (@polyseq rat_Ring p))))))) *)
rewrite -lead_coefE (monicP mon_p) natrD rmorph1 mul1r => lb_x.
(* Goal: is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C)) (@BigOp.bigop (Num.NumField.sort C) (ordinal (Nat.pred (@size rat (@polyseq rat_Ring p)))) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (index_enum (ordinal_finType (Nat.pred (@size rat (@polyseq rat_Ring p))))) (fun i : ordinal (Nat.pred (@size rat (@polyseq rat_Ring p))) => @BigBody (Num.NumField.sort C) (ordinal (Nat.pred (@size rat (@polyseq rat_Ring p)))) i (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C))) true (@GRing.mul (Num.NumField.ringType C) (@nth (Num.NumField.sort C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (Nat.pred (@size rat (@polyseq rat_Ring p))) i)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (Nat.pred (@size rat (@polyseq rat_Ring p))) i))))) (@GRing.exp (Num.NumField.ringType C) x (Nat.pred (@size rat (@polyseq rat_Ring p)))))) *)
case: _.-1 (lb_x) => [|n]; first by rewrite !big_ord0 !add0r ltr01.
(* Goal: forall _ : is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (@BigOp.bigop nat (ordinal (S n)) O (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody nat (ordinal (S n)) i addn true (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) i))))))) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (absz (numq (GRing.one rat_Ring))))) x), is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C)) (@BigOp.bigop (Num.NumField.sort C) (ordinal (S n)) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Num.NumField.sort C) (ordinal (S n)) i (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C))) true (@GRing.mul (Num.NumField.ringType C) (@nth (Num.NumField.sort C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (S n) i)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) i))))) (@GRing.exp (Num.NumField.ringType C) x (S n)))) *)
rewrite -ltr_subl_addl add0r -(ler_pmul2r (x_gt0 n)) -exprS.
(* Goal: forall _ : is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@GRing.mul (Num.NumDomain.ringType (Num.NumField.numDomainType C)) (@GRing.add (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (@BigOp.bigop nat (ordinal (S n)) O (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody nat (ordinal (S n)) i addn true (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) i))))))) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (absz (numq (GRing.one rat_Ring))))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n)) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x (S n))), is_true (@Num.Def.ltr (Num.NumField.numDomainType C) (@GRing.opp (Num.NumDomain.zmodType (Num.NumField.numDomainType C)) (@BigOp.bigop (Num.NumField.sort C) (ordinal (S n)) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (Num.NumField.sort C) (ordinal (S n)) i (@GRing.add (GRing.Ring.zmodType (Num.NumField.ringType C))) true (@GRing.mul (Num.NumField.ringType C) (@nth (Num.NumField.sort C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (S n) i)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) i)))))) (@GRing.exp (Num.NumField.ringType C) x (S n))) *)
apply: ltr_le_trans; rewrite mulrDl mul1r ltr_spaddr // -sumrN.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@BigOp.bigop (GRing.Zmodule.sort (Num.NumDomain.zmodType (Num.NumField.numDomainType C))) (ordinal (S n)) (GRing.zero (Num.NumDomain.zmodType (Num.NumField.numDomainType C))) (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody (GRing.Zmodule.sort (Num.NumDomain.zmodType (Num.NumField.numDomainType C))) (ordinal (S n)) i (@GRing.add (Num.NumDomain.zmodType (Num.NumField.numDomainType C))) true (@GRing.opp (Num.NumDomain.zmodType (Num.NumField.numDomainType C)) (@GRing.mul (Num.NumField.ringType C) (@nth (Num.NumField.sort C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (S n) i)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) i)))))) (@GRing.mul (Num.NumDomain.ringType (Num.NumField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (@BigOp.bigop nat (ordinal (S n)) O (index_enum (ordinal_finType (S n))) (fun i : ordinal (S n) => @BigBody nat (ordinal (S n)) i addn true (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) i))))))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n))) *)
rewrite natr_sum mulr_suml ler_sum // => j _.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@GRing.opp (Num.NumDomain.zmodType (Num.NumField.numDomainType C)) (@GRing.mul (Num.NumField.ringType C) (@nth (Num.NumField.sort C) (GRing.zero (GRing.Ring.zmodType (Num.NumField.ringType C))) (@polyseq (Num.NumField.ringType C) (@map_poly rat_Ring (Num.NumField.ringType C) (@GRing.RMorphism.apply rat_Ring (Num.NumField.ringType C) (Phant (forall _ : rat, Num.NumField.sort C)) QtoC) p)) (@nat_of_ord (S n) j)) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) j)))) (@GRing.mul (Num.NumDomain.ringType (Num.NumField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j))))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n))) *)
rewrite coef_map /= fmorph_eq_rat (ler_trans (real_ler_norm _)) //.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) (@GRing.opp (Num.NumDomain.zmodType (Num.NumField.numDomainType C)) (@GRing.mul (Num.NumField.ringType C) (@ratr (Num.NumField.unitRingType C) (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j))) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) j))))) (@GRing.mul (Num.NumDomain.ringType (Num.NumField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j))))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n))) *)
(* Goal: is_true (@in_mem (Num.NumDomain.sort (Num.NumField.numDomainType C)) (@GRing.opp (Num.NumDomain.zmodType (Num.NumField.numDomainType C)) (@GRing.mul (Num.NumField.ringType C) (@ratr (Num.NumField.unitRingType C) (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j))) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) j)))) (@mem (Num.NumDomain.sort (Num.NumField.numDomainType C)) (predPredType (Num.NumDomain.sort (Num.NumField.numDomainType C))) (@has_quality O (Num.NumDomain.sort (Num.NumField.numDomainType C)) (@Num.Def.Rreal (Num.NumField.numDomainType C))))) *)
by rewrite rpredN rpredM ?rpred_rat ?rpredX // ger0_real.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) (@GRing.opp (Num.NumDomain.zmodType (Num.NumField.numDomainType C)) (@GRing.mul (Num.NumField.ringType C) (@ratr (Num.NumField.unitRingType C) (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j))) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) j))))) (@GRing.mul (Num.NumDomain.ringType (Num.NumField.numDomainType C)) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j))))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n))) *)
rewrite normrN normrM ler_pmul //=.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) j))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n)) *)
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) (@ratr (Num.NumField.unitRingType C) (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j)))) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (absz (numq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j)))))) *)
rewrite normf_div -!intr_norm -!abszE ler_pimulr ?ler0n //.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) j))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n)) *)
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@GRing.inv (Num.NumDomain.unitRingType (Num.NumField.numDomainType C)) (@intmul (GRing.Ring.zmodType (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) (Posz (absz (denq (@nth rat (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring p) (@nat_of_ord (S n) j))))))) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C)))) *)
by rewrite invf_le1 ?ler1n ?ltr0n ?absz_gt0 ?denq_eq0.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (@Num.Def.normr (Num.NumField.numDomainType C) (@GRing.exp (Num.NumField.ringType C) x (@nat_of_ord (S n) j))) (@GRing.exp (Num.NumDomain.ringType (Num.NumField.numDomainType C)) x n)) *)
rewrite normrX ger0_norm ?(ltrW x_gt0) // ler_weexpn2l ?leq_ord //.
(* Goal: is_true (@Num.Def.ler (Num.NumField.numDomainType C) (GRing.one (Num.NumDomain.ringType (Num.NumField.numDomainType C))) x) *)
by rewrite (ler_trans _ lb_x) // -natrD addn1 ler1n.
Qed.
Definition decidable_embedding sT T (f : sT -> T) :=
forall y, decidable (exists x, y = f x).
Lemma rat_algebraic_decidable (C : fieldType) (QtoC : Qmorphism C) :
integralRange QtoC -> decidable_embedding QtoC.
Proof.
(* Goal: forall _ : @integralRange rat_Ring (GRing.Field.ringType C) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC), @decidable_embedding (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC) *)
have QtoCinj: injective QtoC by apply: fmorph_inj.
(* Goal: forall _ : @integralRange rat_Ring (GRing.Field.ringType C) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC), @decidable_embedding (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC) *)
pose ZtoQ : int -> rat := intr; pose ZtoC : int -> C := intr.
(* Goal: forall _ : @integralRange rat_Ring (GRing.Field.ringType C) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC), @decidable_embedding (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC) *)
have ZtoQinj: injective ZtoQ by apply: intr_inj.
(* Goal: forall _ : @integralRange rat_Ring (GRing.Field.ringType C) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC), @decidable_embedding (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC) *)
have defZtoC: ZtoC =1 QtoC \o ZtoQ by move=> m; rewrite /= rmorph_int.
(* Goal: forall _ : @integralRange rat_Ring (GRing.Field.ringType C) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC), @decidable_embedding (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC) *)
move=> algC x; have /sig2_eqW[q mon_q qx0] := algC x; pose d := (size q).-1.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
have [n ub_n]: {n | forall y, root q y -> `|y| < n}.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
(* Goal: @sig (Num.NumDomain.sort rat_numDomainType) (fun n : Num.NumDomain.sort rat_numDomainType => forall (y : GRing.Ring.sort rat_Ring) (_ : is_true (@root rat_Ring q y)), is_true (@Num.Def.ltr rat_numDomainType (@Num.Def.normr rat_numDomainType y) n)) *)
have [n1 ub_n1] := monic_Cauchy_bound mon_q.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
(* Goal: @sig (Num.NumDomain.sort rat_numDomainType) (fun n : Num.NumDomain.sort rat_numDomainType => forall (y : GRing.Ring.sort rat_Ring) (_ : is_true (@root rat_Ring q y)), is_true (@Num.Def.ltr rat_numDomainType (@Num.Def.normr rat_numDomainType y) n)) *)
have /monic_Cauchy_bound[n2 ub_n2]: (-1) ^+ d *: (q \Po - 'X) \is monic.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
(* Goal: @sig (Num.NumDomain.sort rat_numDomainType) (fun n : Num.NumDomain.sort rat_numDomainType => forall (y : GRing.Ring.sort rat_Ring) (_ : is_true (@root rat_Ring q y)), is_true (@Num.Def.ltr rat_numDomainType (@Num.Def.normr rat_numDomainType y) n)) *)
(* Goal: is_true (@in_mem (GRing.Zmodule.sort (@GRing.Zmodule.Pack (@GRing.Lmodule.sort rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (poly_lalgType rat_Ring))) (@GRing.Lmodule.base rat_Ring (@GRing.Lmodule.sort rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (poly_lalgType rat_Ring))) (@GRing.Lmodule.class rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (poly_lalgType rat_Ring)))))) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (poly_lalgType rat_Ring)) (@GRing.exp rat_Ring (@GRing.opp (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) d) (@comp_poly rat_Ring (@GRing.opp (poly_zmodType rat_Ring) (polyX rat_Ring)) q)) (@mem (@poly_of rat_Ring (Phant (GRing.Ring.sort rat_Ring))) (predPredType (@poly_of rat_Ring (Phant (GRing.Ring.sort rat_Ring)))) (@has_quality O (@poly_of rat_Ring (Phant (GRing.Ring.sort rat_Ring))) (@monic rat_Ring)))) *)
rewrite monicE lead_coefZ lead_coef_comp ?size_opp ?size_polyX // -/d.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
(* Goal: @sig (Num.NumDomain.sort rat_numDomainType) (fun n : Num.NumDomain.sort rat_numDomainType => forall (y : GRing.Ring.sort rat_Ring) (_ : is_true (@root rat_Ring q y)), is_true (@Num.Def.ltr rat_numDomainType (@Num.Def.normr rat_numDomainType y) n)) *)
(* Goal: is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) (@GRing.exp rat_Ring (@GRing.opp (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) d) (@GRing.mul (GRing.IntegralDomain.ringType rat_iDomain) (@lead_coef (GRing.IntegralDomain.ringType rat_iDomain) q) (@GRing.exp (GRing.IntegralDomain.ringType rat_iDomain) (@lead_coef (GRing.IntegralDomain.ringType rat_iDomain) (@GRing.opp (poly_zmodType rat_Ring) (polyX rat_Ring))) d))) (GRing.one rat_Ring)) *)
by rewrite lead_coef_opp lead_coefX (monicP mon_q) (mulrC 1) signrMK.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
(* Goal: @sig (Num.NumDomain.sort rat_numDomainType) (fun n : Num.NumDomain.sort rat_numDomainType => forall (y : GRing.Ring.sort rat_Ring) (_ : is_true (@root rat_Ring q y)), is_true (@Num.Def.ltr rat_numDomainType (@Num.Def.normr rat_numDomainType y) n)) *)
exists (Num.max n1 n2) => y; rewrite ltrNge ler_normr !ler_maxl rootE.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
(* Goal: forall _ : is_true (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) (@horner rat_Ring q y) (GRing.zero (GRing.Ring.zmodType rat_Ring))), is_true (negb (orb (andb (@Num.Def.ler (Num.RealDomain.numDomainType rat_realDomainType) n1 y) (@Num.Def.ler (Num.RealDomain.numDomainType rat_realDomainType) n2 y)) (andb (@Num.Def.ler (Num.RealDomain.numDomainType rat_realDomainType) n1 (@GRing.opp (Num.RealDomain.zmodType rat_realDomainType) y)) (@Num.Def.ler (Num.RealDomain.numDomainType rat_realDomainType) n2 (@GRing.opp (Num.RealDomain.zmodType rat_realDomainType) y))))) *)
apply: contraL => /orP[]/andP[] => [/ub_n1/gtr_eqF->// | _ /ub_n2/gtr_eqF].
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
(* Goal: forall _ : @eq bool (@eq_op (Num.NumDomain.eqType (Num.RealDomain.numDomainType rat_realDomainType)) (@horner (Num.RealDomain.ringType rat_realDomainType) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (poly_lalgType rat_Ring)) (@GRing.exp rat_Ring (@GRing.opp (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) d) (@comp_poly rat_Ring (@GRing.opp (poly_zmodType rat_Ring) (polyX rat_Ring)) q)) (@GRing.opp (Num.RealDomain.zmodType rat_realDomainType) y)) (GRing.zero (Num.NumDomain.zmodType (Num.RealDomain.numDomainType rat_realDomainType)))) false, is_true (negb (@eq_op (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring)) (@horner rat_Ring q y) (GRing.zero (GRing.Ring.zmodType rat_Ring)))) *)
by rewrite hornerZ horner_comp !hornerE opprK mulf_eq0 signr_eq0 => /= ->.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
have [p [a nz_a Dq]] := rat_poly_scale q; pose N := Num.bound `|n * a%:~R|.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
pose xa : seq rat := [seq (m%:R - N%:R) / a%:~R | m <- iota 0 N.*2].
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
have [/sig2_eqW[y _ ->] | xa'x] := @mapP _ _ QtoC xa x; first by left; exists y.
(* Goal: decidable (@ex (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (fun x0 : GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring) => @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.Field.ringType C))) x (@GRing.RMorphism.apply rat_Ring (GRing.Field.ringType C) (Phant (forall _ : rat, GRing.Field.sort C)) QtoC x0))) *)
right=> [[y Dx]]; case: xa'x; exists y => //.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
have{x Dx qx0} qy0: root q y by rewrite Dx fmorph_root in qx0.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
have /dvdzP[b Da]: (denq y %| a)%Z.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType int_ZmodType)) a (@mem int (boolfunPredType int) (dvdz (denq y)))) *)
have /Gauss_dvdzl <-: coprimez (denq y) (numq y ^+ d).
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring a (@GRing.exp int_Ring (numq y) d)) (@mem int (boolfunPredType int) (dvdz (denq y)))) *)
(* Goal: is_true (coprimez (denq y) (@GRing.exp int_Ring (numq y) d)) *)
by rewrite coprimez_sym coprimez_expl //; apply: coprime_num_den.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring a (@GRing.exp int_Ring (numq y) d)) (@mem int (boolfunPredType int) (dvdz (denq y)))) *)
pose p1 : {poly int} := a *: 'X^d - p.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring a (@GRing.exp int_Ring (numq y) d)) (@mem int (boolfunPredType int) (dvdz (denq y)))) *)
have Dp1: p1 ^ intr = a%:~R *: ('X^d - q).
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring a (@GRing.exp int_Ring (numq y) d)) (@mem int (boolfunPredType int) (dvdz (denq y)))) *)
(* Goal: @eq (@poly_of rat_Ring (Phant (GRing.Ring.sort rat_Ring))) (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) (@GRing.scale rat_Ring (@GRing.Lalgebra.lmod_ringType rat_Ring (Phant (GRing.Ring.sort rat_Ring)) (poly_lalgType rat_Ring)) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a) (@GRing.add (GRing.Ring.zmodType (poly_ringType rat_Ring)) (@GRing.exp (poly_ringType rat_Ring) (polyX rat_Ring) d) (@GRing.opp (poly_zmodType rat_Ring) q))) *)
by rewrite rmorphB linearZ /= map_polyXn scalerBr Dq scalerKV ?intr_eq0.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@in_mem (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring a (@GRing.exp int_Ring (numq y) d)) (@mem int (boolfunPredType int) (dvdz (denq y)))) *)
apply/dvdzP; exists (\sum_(i < d) p1`_i * numq y ^+ i * denq y ^+ (d - i.+1)).
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq (GRing.Ring.sort int_Ring) (@GRing.mul int_Ring a (@GRing.exp int_Ring (numq y) d)) (@GRing.mul int_Ring (@BigOp.bigop (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (Finite.sort (ordinal_finType d)) (GRing.zero (GRing.Ring.zmodType int_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (ordinal d) i (@GRing.add (GRing.Ring.zmodType int_Ring)) true (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType int_Ring)) (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))))) (denq y)) *)
apply: ZtoQinj; rewrite /ZtoQ rmorphM mulr_suml rmorph_sum /=.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (numq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
transitivity ((p1 ^ intr).[y] * (denq y ^+ d)%:~R).
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (numq y) d))) (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) *)
rewrite Dp1 !hornerE hornerXn (rootP qy0) subr0.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (numq y) d))) (@GRing.mul rat_Ring (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a) (@GRing.exp rat_Ring y d)) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) *)
by rewrite !rmorphX /= numqE exprMn mulrA.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
have sz_p1: (size (p1 ^ ZtoQ)%R <= d)%N.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
(* Goal: is_true (leq (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring (@map_poly int_Ring rat_Ring ZtoQ p1))) d) *)
rewrite Dp1 size_scale ?intr_eq0 //; apply/leq_sizeP=> i.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
(* Goal: forall _ : is_true (leq d i), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (@polyseq (GRing.IntegralDomain.ringType rat_iDomain) (@GRing.add (GRing.Ring.zmodType (poly_ringType rat_Ring)) (@GRing.exp (poly_ringType rat_Ring) (polyX rat_Ring) d) (@GRing.opp (poly_zmodType rat_Ring) q))) i) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) *)
rewrite leq_eqVlt eq_sym -polySpred ?monic_neq0 // coefB coefXn.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
(* Goal: forall _ : is_true (orb (@eq_op nat_eqType i d) (leq (@size (GRing.Ring.sort rat_Ring) (@polyseq rat_Ring q)) i)), @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (@GRing.add (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (@GRing.natmul (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (GRing.one (GRing.IntegralDomain.ringType rat_iDomain)) (nat_of_bool (@eq_op nat_eqType i d))) (@GRing.opp (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (@polyseq (GRing.IntegralDomain.ringType rat_iDomain) q) i))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) *)
case: eqP => [-> _ | _ /(nth_default 0)->//].
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (@GRing.add (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (@GRing.natmul (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (GRing.one (GRing.IntegralDomain.ringType rat_iDomain)) (nat_of_bool true)) (@GRing.opp (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain)) (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) (@polyseq (GRing.IntegralDomain.ringType rat_iDomain) q) d))) (GRing.zero (GRing.Ring.zmodType (GRing.IntegralDomain.ringType rat_iDomain))) *)
by rewrite -lead_coefE (monicP mon_q).
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@horner rat_Ring (@map_poly int_Ring rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring)) p1) y) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@BigOp.bigop rat (ordinal d) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (index_enum (ordinal_finType d)) (fun i : ordinal d => @BigBody rat (ordinal d) i (@GRing.add (GRing.Ring.zmodType rat_Ring)) true (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))))) *)
rewrite (horner_coef_wide _ sz_p1) mulr_suml; apply: eq_bigr => i _.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@GRing.mul rat_Ring (@nth (GRing.Zmodule.sort (GRing.Ring.zmodType rat_Ring)) (GRing.zero (GRing.Ring.zmodType rat_Ring)) (@polyseq rat_Ring (@map_poly int_Ring rat_Ring ZtoQ p1)) (@nat_of_ord d i)) (@GRing.exp rat_Ring y (@nat_of_ord d i))) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.exp int_Ring (denq y) d))) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@GRing.mul int_Ring (@GRing.mul int_Ring (@GRing.mul int_Ring (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i)) (@GRing.exp int_Ring (numq y) (@nat_of_ord d i))) (@GRing.exp int_Ring (denq y) (subn d (S (@nat_of_ord d i))))) (denq y))) *)
rewrite -!mulrA -exprSr coef_map !rmorphM !rmorphX /= numqE exprMn -mulrA.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq rat (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i))) (@GRing.mul rat_Ring (@GRing.exp rat_Ring y (@nat_of_ord d i)) (@GRing.exp rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (denq y)) d))) (@GRing.mul rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (@nth int (GRing.zero (GRing.Ring.zmodType int_Ring)) (@polyseq int_Ring p1) (@nat_of_ord d i))) (@GRing.mul rat_Ring (@GRing.exp (GRing.ComRing.ringType rat_comRing) y (@nat_of_ord d i)) (@GRing.mul rat_Ring (@GRing.exp (GRing.ComRing.ringType rat_comRing) (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (denq y)) (@nat_of_ord d i)) (@GRing.exp rat_Ring (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) (denq y)) (S (subn d (S (@nat_of_ord d i)))))))) *)
by rewrite -exprD -addSnnS subnKC.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
pose m := `|(numq y * b + N)%R|%N.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
have Dm: m%:R = `|y * a%:~R + N%:R|.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: @eq (GRing.Zmodule.sort (GRing.Ring.zmodType (Num.NumDomain.ringType rat_numDomainType))) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType rat_numDomainType)) (GRing.one (Num.NumDomain.ringType rat_numDomainType)) m) (@Num.Def.normr rat_numDomainType (@GRing.add (GRing.Ring.zmodType rat_Ring) (@GRing.mul rat_Ring y (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a)) (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) N))) *)
by rewrite pmulrn abszE intr_norm Da rmorphD !rmorphM /= numqE mulrAC mulrA.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
have ltr_Qnat n1 n2 : (n1%:R < n2%:R :> rat = _) := ltr_nat _ n1 n2.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
have ub_y: `|y * a%:~R| < N%:R.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@Num.Def.ltr rat_numDomainType (@Num.Def.normr rat_numDomainType (@GRing.mul rat_Ring y (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a))) (@GRing.natmul (GRing.Ring.zmodType (Num.NumDomain.ringType rat_numDomainType)) (GRing.one (Num.NumDomain.ringType rat_numDomainType)) N)) *)
apply: ler_lt_trans (archi_boundP (normr_ge0 _)); rewrite !normrM.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
(* Goal: is_true (@Num.Def.ler (Num.ArchimedeanField.numDomainType archiType) (@GRing.mul (Num.NumDomain.ringType rat_numDomainType) (@Num.Def.normr rat_numDomainType y) (@Num.Def.normr rat_numDomainType (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a))) (@GRing.mul (Num.NumDomain.ringType (Num.ArchimedeanField.numDomainType archiType)) (@Num.Def.normr (Num.ArchimedeanField.numDomainType archiType) n) (@Num.Def.normr (Num.ArchimedeanField.numDomainType archiType) (@intmul (GRing.Ring.zmodType (Num.NumDomain.ringType rat_numDomainType)) (GRing.one (Num.NumDomain.ringType rat_numDomainType)) a)))) *)
by rewrite ler_pmul ?normr_ge0 // (ler_trans _ (ler_norm n)) ?ltrW ?ub_n.
(* Goal: is_true (@in_mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@mem (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) (seq_predType (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) xa)) *)
apply/mapP; exists m.
(* Goal: @eq (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) m) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) N))) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a))) *)
(* Goal: is_true (@in_mem (Equality.sort nat_eqType) m (@mem (Equality.sort nat_eqType) (seq_predType nat_eqType) (iota O (double N)))) *)
rewrite mem_iota /= add0n -addnn -ltr_Qnat Dm natrD.
(* Goal: @eq (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) m) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) N))) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a))) *)
(* Goal: is_true (@Num.Def.ltr rat_numDomainType (@Num.Def.normr rat_numDomainType (@GRing.add (GRing.Ring.zmodType rat_Ring) (@GRing.mul rat_Ring y (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a)) (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) N))) (@GRing.add (GRing.Ring.zmodType rat_Ring) (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) N) (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) N))) *)
by rewrite (ler_lt_trans (ler_norm_add _ _)) // normr_nat ltr_add2r.
(* Goal: @eq (Equality.sort (GRing.Zmodule.eqType (GRing.Ring.zmodType rat_Ring))) y (@GRing.mul (GRing.UnitRing.ringType rat_unitRing) (@GRing.add (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) m) (@GRing.opp (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (@GRing.natmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) N))) (@GRing.inv rat_unitRing (@intmul (GRing.Ring.zmodType (GRing.UnitRing.ringType rat_unitRing)) (GRing.one (GRing.UnitRing.ringType rat_unitRing)) a))) *)
rewrite Dm ger0_norm ?addrK ?mulfK ?intr_eq0 // -ler_subl_addl sub0r.
(* Goal: is_true (@Num.Def.ler rat_numDomainType (@GRing.opp (Num.NumDomain.zmodType rat_numDomainType) (@GRing.mul rat_Ring y (@intmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) a))) (@GRing.natmul (GRing.Ring.zmodType rat_Ring) (GRing.one rat_Ring) N)) *)
by rewrite (ler_trans (ler_norm _)) ?normrN ?ltrW.
Qed.
Lemma minPoly_decidable_closure
(F : fieldType) (L : closedFieldType) (FtoL : {rmorphism F -> L}) x :
decidable_embedding FtoL -> integralOver FtoL x ->
{p | [/\ p \is monic, root (p ^ FtoL) x & irreducible_poly p]}.
Lemma alg_integral (F : fieldType) (L : fieldExtType F) :
integralRange (in_alg L).
Proof.
(* Goal: @integralRange (GRing.Field.ringType F) (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))) (@FieldExt.lalgType (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))) L)) (@GRing.in_alg_head (GRing.Field.ringType F) (@FieldExt.lalgType (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))) L) (Phant (@FieldExt.sort (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L))) *)
move=> x; have [/polyOver1P[p Dp]] := (minPolyOver 1 x, monic_minPoly 1 x).
(* Goal: forall _ : is_true (@in_mem (@poly_of (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L) (Phant (@FieldExt.sort (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L))) (@minPoly F L (@vline F (@Falgebra.vectType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (@FieldExt.FalgType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L)) (GRing.one (@Falgebra.vect_ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) (@FieldExt.FalgType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L)))) x) (@mem (@poly_of (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L) (Phant (GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L)))) (predPredType (@poly_of (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L) (Phant (GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L))))) (@has_quality O (@poly_of (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L) (Phant (GRing.Ring.sort (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L)))) (@monic (@FieldExt.ringType (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L))))), @integralOver (GRing.Field.ringType F) (@GRing.Lalgebra.ringType (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))) (@FieldExt.lalgType (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))) L)) (@GRing.in_alg_head (GRing.Field.ringType F) (@FieldExt.lalgType (GRing.Field.ringType F) (Phant (GRing.Ring.sort (GRing.Field.ringType F))) L) (Phant (@FieldExt.sort (GRing.Field.ringType F) (Phant (GRing.Field.sort F)) L))) x *)
by rewrite Dp map_monic; exists p; rewrite // -Dp root_minPoly.
Qed.
Prenex Implicits alg_integral.
Import DefaultKeying GRing.DefaultPred.
Arguments map_poly_inj {F R} f [p1 p2].
Theorem Fundamental_Theorem_of_Algebraics :
{L : closedFieldType &
{conj : {rmorphism L -> L} | involutive conj & ~ conj =1 id}}.
|
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrfun ssrbool eqtype ssrnat seq choice fintype.
From mathcomp
Require Import ssralg finset fingroup morphism perm action countalg.
Local Open Scope ring_scope.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Module FinRing.
Local Notation mixin_of T b := (Finite.mixin_of (EqType T b)).
Section Generic.
Variables (type base_type : Type) (class_of base_of : Type -> Type).
Variable to_choice : forall T, base_of T -> Choice.class_of T.
Variable base_sort : base_type -> Type.
Variable Pack : forall T, class_of T -> type.
Variable Class : forall T b, mixin_of T (to_choice b) -> class_of T.
Variable base_class : forall bT, base_of (base_sort bT).
Definition gen_pack T :=
fun bT b & phant_id (base_class bT) b =>
fun fT m & phant_id (Finite.class fT) (Finite.Class m) =>
Pack (@Class T b m).
End Generic.
Arguments gen_pack [type base_type class_of base_of to_choice base_sort].
Local Notation fin_ c := (@Finite.Class _ c c).
Local Notation do_pack pack T := (pack T _ _ id _ _ id).
Import GRing.Theory.
Definition groupMixin V := FinGroup.Mixin (@addrA V) (@add0r V) (@addNr V).
Local Notation base_group T vT fT :=
(@FinGroup.PackBase T (groupMixin vT) (Finite.class fT)).
Local Notation fin_group B V := (@FinGroup.Pack B (@addNr V)).
Module Zmodule.
Section ClassDef.
Record class_of M :=
Class { base : GRing.Zmodule.class_of M; mixin : mixin_of M base }.
Local Coercion base : class_of >-> GRing.Zmodule.class_of.
Local Coercion mixin : class_of >-> mixin_of.
Structure type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Definition pack := gen_pack Pack Class GRing.Zmodule.class.
Variable cT : type.
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition join_finType := @Finite.Pack zmodType (fin_ xclass).
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group zmodType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
Lemma zmodVgE x : x^-1%g = - x. Proof. by []. Qed.
Proof.
(* Goal: @eq (FinGroup.sort (Zmodule.baseFinGroupType U)) (@invg (Zmodule.baseFinGroupType U) x) (@GRing.opp (Zmodule.zmodType U) x) *)
by [].
Qed.
Lemma zmodXgE n x : (x ^+ n)%g = x *+ n. Proof. by []. Qed.
Proof.
(* Goal: @eq (FinGroup.sort (Zmodule.baseFinGroupType U)) (@expgn (Zmodule.baseFinGroupType U) x n) (@GRing.natmul (Zmodule.zmodType U) x n) *)
by [].
Qed.
Lemma zmod_abelian (A : {set U}) : abelian A.
Proof.
(* Goal: is_true (@abelian (Zmodule.finGroupType U) A) *)
by apply/centsP=> x _ y _; apply: zmod_mulgC.
Qed.
End AdditiveGroup.
Module Ring.
Section ClassDef.
Record class_of R :=
Class { base : GRing.Ring.class_of R; mixin : mixin_of R base }.
Definition base2 R (c : class_of R) := Zmodule.Class (mixin c).
Local Coercion base : class_of >-> GRing.Ring.class_of.
Local Coercion base2 : class_of >-> Zmodule.class_of.
Structure type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Definition pack := gen_pack Pack Class GRing.Ring.class.
Variable cT : type.
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition join_finType := @Finite.Pack ringType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack ringType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group ringType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> GRing.Ring.class_of.
Coercion base2 : class_of >-> Zmodule.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Canonical join_finType.
Canonical join_finZmodType.
Notation finRingType := type.
Notation "[ 'finRingType' 'of' T ]" := (do_pack pack T)
(at level 0, format "[ 'finRingType' 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Canonical countZmodType (T : type) := [countZmodType of T].
Canonical countRingType (T : type) := [countRingType of T].
End Exports.
Section Unit.
Variable R : finRingType.
Definition is_inv (x y : R) := (x * y == 1) && (y * x == 1).
Definition unit := [qualify a x : R | [exists y, is_inv x y]].
Definition inv x := odflt x (pick (is_inv x)).
Lemma mulVr : {in unit, left_inverse 1 inv *%R}.
Proof.
(* Goal: @prop_in1 (sort R) (@mem (sort R) (predPredType (sort R)) (@has_quality (S O) (sort R) unit)) (fun x : sort R => @eq (GRing.Ring.sort (ringType R)) (@GRing.mul (ringType R) (inv x) x) (GRing.one (ringType R))) (inPhantom (@left_inverse (sort R) (sort R) (GRing.Ring.sort (ringType R)) (GRing.one (ringType R)) inv (@GRing.mul (ringType R)))) *)
rewrite /inv => x Ux; case: pickP => [y | no_y]; last by case/pred0P: Ux.
(* Goal: forall _ : is_true (is_inv x y), @eq (GRing.Ring.sort (ringType R)) (@GRing.mul (ringType R) (@Option.default (sort R) x (@Some (Finite.sort (finType R)) y)) x) (GRing.one (ringType R)) *)
by case/andP=> _; move/eqP.
Qed.
Lemma mulrV : {in unit, right_inverse 1 inv *%R}.
Proof.
(* Goal: @prop_in1 (sort R) (@mem (sort R) (predPredType (sort R)) (@has_quality (S O) (sort R) unit)) (fun x : sort R => @eq (GRing.Ring.sort (ringType R)) (@GRing.mul (ringType R) x (inv x)) (GRing.one (ringType R))) (inPhantom (@right_inverse (sort R) (sort R) (GRing.Ring.sort (ringType R)) (GRing.one (ringType R)) inv (@GRing.mul (ringType R)))) *)
rewrite /inv => x Ux; case: pickP => [y | no_y]; last by case/pred0P: Ux.
(* Goal: forall _ : is_true (is_inv x y), @eq (GRing.Ring.sort (ringType R)) (@GRing.mul (ringType R) x (@Option.default (sort R) x (@Some (Finite.sort (finType R)) y))) (GRing.one (ringType R)) *)
by case/andP; move/eqP.
Qed.
Lemma intro_unit x y : y * x = 1 /\ x * y = 1 -> x \is a unit.
Proof.
(* Goal: forall _ : and (@eq (GRing.Ring.sort (ringType R)) (@GRing.mul (ringType R) y x) (GRing.one (ringType R))) (@eq (GRing.Ring.sort (ringType R)) (@GRing.mul (ringType R) x y) (GRing.one (ringType R))), is_true (@in_mem (GRing.Ring.sort (ringType R)) x (@mem (sort R) (predPredType (sort R)) (@has_quality (S O) (sort R) unit))) *)
by case=> yx1 xy1; apply/existsP; exists y; rewrite /is_inv xy1 yx1 !eqxx.
Qed.
Lemma invr_out : {in [predC unit], inv =1 id}.
Proof.
(* Goal: @prop_in1 (sort R) (@mem (sort R) (simplPredType (sort R)) (@predC (sort R) (@pred_of_simpl (sort R) (@pred_of_mem_pred (sort R) (@mem (sort R) (predPredType (sort R)) (@has_quality (S O) (sort R) unit)))))) (fun x : sort R => @eq (sort R) (inv x) ((fun x0 : sort R => x0) x)) (inPhantom (@eqfun (sort R) (sort R) inv (fun x : sort R => x))) *)
rewrite /inv => x nUx; case: pickP => // y invxy.
(* Goal: @eq (sort R) (@Option.default (sort R) x (@Some (Finite.sort (finType R)) y)) x *)
by case/existsP: nUx; exists y.
Qed.
Definition UnitMixin := GRing.UnitRing.Mixin mulVr mulrV intro_unit invr_out.
End Unit.
End Ring.
Import Ring.Exports.
Module ComRing.
Section ClassDef.
Record class_of R :=
Class { base : GRing.ComRing.class_of R; mixin : mixin_of R base }.
Definition base2 R (c : class_of R) := Ring.Class (mixin c).
Local Coercion base : class_of >-> GRing.ComRing.class_of.
Local Coercion base2 : class_of >-> Ring.class_of.
Structure type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Definition pack := gen_pack Pack Class GRing.ComRing.class.
Variable cT : type.
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition comRingType := @GRing.ComRing.Pack cT xclass.
Definition join_finType := @Finite.Pack comRingType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack comRingType xclass.
Definition join_finRingType := @Ring.Pack comRingType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group comRingType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.ComRing.class_of.
Coercion base2 : class_of >-> Ring.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion comRingType : type >-> GRing.ComRing.type.
Canonical comRingType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finRingType.
Notation finComRingType := FinRing.ComRing.type.
Notation "[ 'finComRingType' 'of' T ]" := (do_pack pack T)
(at level 0, format "[ 'finComRingType' 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Canonical countZmodType (T : type) := [countZmodType of T].
Canonical countRingType (T : type) := [countRingType of T].
Canonical countComRingType (T : type) := [countComRingType of T].
End Exports.
End ComRing.
Import ComRing.Exports.
Module UnitRing.
Section ClassDef.
Record class_of R :=
Class { base : GRing.UnitRing.class_of R; mixin : mixin_of R base }.
Definition base2 R (c : class_of R) := Ring.Class (mixin c).
Local Coercion base : class_of >-> GRing.UnitRing.class_of.
Local Coercion base2 : class_of >-> Ring.class_of.
Structure type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Definition pack := gen_pack Pack Class GRing.UnitRing.class.
Variable cT : type.
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition unitRingType := @GRing.UnitRing.Pack cT xclass.
Definition join_finType := @Finite.Pack unitRingType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack unitRingType xclass.
Definition join_finRingType := @Ring.Pack unitRingType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group unitRingType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.UnitRing.class_of.
Coercion base2 : class_of >-> Ring.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion unitRingType : type >-> GRing.UnitRing.type.
Canonical unitRingType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finRingType.
Notation finUnitRingType := FinRing.UnitRing.type.
Notation "[ 'finUnitRingType' 'of' T ]" := (do_pack pack T)
(at level 0, format "[ 'finUnitRingType' 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Canonical countZmodType (T : type) := [countZmodType of T].
Canonical countRingType (T : type) := [countRingType of T].
Canonical countUnitRingType (T : type) := [countUnitRingType of T].
End Exports.
End UnitRing.
Import UnitRing.Exports.
Section UnitsGroup.
Variable R : finUnitRingType.
Inductive unit_of (phR : phant R) := Unit (x : R) of x \is a GRing.unit.
Bind Scope group_scope with unit_of.
Let phR := Phant R.
Local Notation uT := (unit_of phR).
Implicit Types u v : uT.
Definition uval u := let: Unit x _ := u in x.
Canonical unit_subType := [subType for uval].
Definition unit_eqMixin := Eval hnf in [eqMixin of uT by <:].
Canonical unit_eqType := Eval hnf in EqType uT unit_eqMixin.
Definition unit_choiceMixin := [choiceMixin of uT by <:].
Canonical unit_choiceType := Eval hnf in ChoiceType uT unit_choiceMixin.
Definition unit_countMixin := [countMixin of uT by <:].
Canonical unit_countType := Eval hnf in CountType uT unit_countMixin.
Canonical unit_subCountType := Eval hnf in [subCountType of uT].
Definition unit_finMixin := [finMixin of uT by <:].
Canonical unit_finType := Eval hnf in FinType uT unit_finMixin.
Canonical unit_subFinType := Eval hnf in [subFinType of uT].
Definition unit1 := Unit phR (@GRing.unitr1 _).
Lemma unit_inv_proof u : (val u)^-1 \is a GRing.unit.
Proof.
(* Goal: is_true (@in_mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.inv (UnitRing.unitRingType R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType u)) (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) *)
by rewrite GRing.unitrV ?(valP u).
Qed.
Definition unit_inv u := Unit phR (unit_inv_proof u).
Lemma unit_mul_proof u v : val u * val v \is a GRing.unit.
Proof.
(* Goal: is_true (@in_mem (GRing.Ring.sort (UnitRing.ringType R)) (@GRing.mul (UnitRing.ringType R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType u) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType v)) (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) *)
by rewrite (GRing.unitrMr _ (valP u)) ?(valP v).
Qed.
Definition unit_mul u v := Unit phR (unit_mul_proof u v).
Lemma unit_muluA : associative unit_mul.
Proof.
(* Goal: @associative (unit_of phR) unit_mul *)
by move=> u v w; apply: val_inj; apply: GRing.mulrA.
Qed.
Lemma unit_mul1u : left_id unit1 unit_mul.
Proof.
(* Goal: @left_id (unit_of phR) (unit_of phR) unit1 unit_mul *)
by move=> u; apply: val_inj; apply: GRing.mul1r.
Qed.
Lemma unit_mulVu : left_inverse unit1 unit_inv unit_mul.
Proof.
(* Goal: @left_inverse (unit_of phR) (unit_of phR) (unit_of phR) unit1 unit_inv unit_mul *)
by move=> u; apply: val_inj; apply: GRing.mulVr (valP u).
Qed.
Definition unit_GroupMixin := FinGroup.Mixin unit_muluA unit_mul1u unit_mulVu.
Lemma val_unitM x y : val (x * y : uT)%g = val x * val y. Proof. by []. Qed.
Proof.
(* Goal: @eq (UnitRing.sort R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType (@mulg unit_baseFinGroupType x y : unit_of phR)) (@GRing.mul (UnitRing.ringType R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType x) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType y)) *)
by [].
Qed.
Lemma val_unitX n x : val (x ^+ n : uT)%g = val x ^+ n.
Proof.
(* Goal: @eq (UnitRing.sort R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType (@expgn unit_baseFinGroupType x n : unit_of phR)) (@GRing.exp (UnitRing.ringType R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType x) n) *)
by case: n; last by elim=> //= n ->.
Qed.
Definition unit_act x u := x * val u.
Canonical unit_action :=
@TotalAction _ _ unit_act (@GRing.mulr1 _) (fun _ _ _ => GRing.mulrA _ _ _).
Lemma unit_is_groupAction : @is_groupAction _ R setT setT unit_action.
Proof.
(* Goal: @is_groupAction unit_finGroupType (Zmodule.finGroupType (UnitRing.finZmodType R)) (@setTfor (FinGroup.arg_finType (FinGroup.base unit_finGroupType)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base unit_finGroupType))))) (@setTfor (FinGroup.arg_finType (FinGroup.base (Zmodule.finGroupType (UnitRing.finZmodType R)))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (Zmodule.finGroupType (UnitRing.finZmodType R))))))) unit_action *)
move=> u _ /=; rewrite inE; apply/andP; split.
(* Goal: is_true (@morphic (Zmodule.finGroupType (UnitRing.finZmodType R)) (Zmodule.finGroupType (UnitRing.finZmodType R)) (@setTfor (FinGroup.arg_finType (Zmodule.baseFinGroupType (UnitRing.finZmodType R))) (Phant (UnitRing.sort R))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zmodule.finGroupType (UnitRing.finZmodType R)))) (@actperm unit_finGroupType (@setTfor (FinGroup.arg_finType unit_baseFinGroupType) (Phant (unit_of phR))) (FinGroup.arg_finType (Zmodule.baseFinGroupType (UnitRing.finZmodType R))) unit_action u))) *)
(* Goal: is_true (@perm_on (FinGroup.arg_finType (FinGroup.base (Zmodule.finGroupType (UnitRing.finZmodType R)))) (@setTfor (FinGroup.arg_finType (Zmodule.baseFinGroupType (UnitRing.finZmodType R))) (Phant (UnitRing.sort R))) (@actperm unit_finGroupType (@setTfor (FinGroup.arg_finType unit_baseFinGroupType) (Phant (unit_of phR))) (FinGroup.arg_finType (Zmodule.baseFinGroupType (UnitRing.finZmodType R))) unit_action u)) *)
by apply/subsetP=> x _; rewrite inE.
(* Goal: is_true (@morphic (Zmodule.finGroupType (UnitRing.finZmodType R)) (Zmodule.finGroupType (UnitRing.finZmodType R)) (@setTfor (FinGroup.arg_finType (Zmodule.baseFinGroupType (UnitRing.finZmodType R))) (Phant (UnitRing.sort R))) (@PermDef.fun_of_perm (FinGroup.arg_finType (FinGroup.base (Zmodule.finGroupType (UnitRing.finZmodType R)))) (@actperm unit_finGroupType (@setTfor (FinGroup.arg_finType unit_baseFinGroupType) (Phant (unit_of phR))) (FinGroup.arg_finType (Zmodule.baseFinGroupType (UnitRing.finZmodType R))) unit_action u))) *)
by apply/morphicP=> x y _ _; rewrite !actpermE /= [_ u]GRing.mulrDl.
Qed.
Canonical unit_groupAction := GroupAction unit_is_groupAction.
End UnitsGroup.
Module Import UnitsGroupExports.
Bind Scope group_scope with unit_of.
Canonical unit_subType.
Canonical unit_eqType.
Canonical unit_choiceType.
Canonical unit_countType.
Canonical unit_subCountType.
Canonical unit_finType.
Canonical unit_subFinType.
Canonical unit_baseFinGroupType.
Canonical unit_finGroupType.
Canonical unit_action.
Canonical unit_groupAction.
End UnitsGroupExports.
Notation unit R Ux := (Unit (Phant R) Ux).
Module ComUnitRing.
Section ClassDef.
Record class_of R :=
Class { base : GRing.ComUnitRing.class_of R; mixin : mixin_of R base }.
Definition base2 R (c : class_of R) := ComRing.Class (mixin c).
Definition base3 R (c : class_of R) := @UnitRing.Class R (base c) (mixin c).
Local Coercion base : class_of >-> GRing.ComUnitRing.class_of.
Local Coercion base2 : class_of >-> ComRing.class_of.
Local Coercion base3 : class_of >-> UnitRing.class_of.
Structure type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Definition pack := gen_pack Pack Class GRing.ComUnitRing.class.
Variable cT : type.
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition comRingType := @GRing.ComRing.Pack cT xclass.
Definition finComRingType := @ComRing.Pack cT xclass.
Definition unitRingType := @GRing.UnitRing.Pack cT xclass.
Definition finUnitRingType := @UnitRing.Pack cT xclass.
Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass.
Definition join_finType := @Finite.Pack comUnitRingType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack comUnitRingType xclass.
Definition join_finRingType := @Ring.Pack comUnitRingType xclass.
Definition join_finComRingType := @ComRing.Pack comUnitRingType xclass.
Definition join_finUnitRingType := @UnitRing.Pack comUnitRingType xclass.
Definition ujoin_finComRingType := @ComRing.Pack unitRingType xclass.
Definition cjoin_finUnitRingType := @UnitRing.Pack comRingType xclass.
Definition fcjoin_finUnitRingType := @UnitRing.Pack finComRingType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group comUnitRingType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.ComUnitRing.class_of.
Coercion base2 : class_of >-> ComRing.class_of.
Coercion base3 : class_of >-> UnitRing.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion comRingType : type >-> GRing.ComRing.type.
Canonical comRingType.
Coercion finComRingType : type >-> ComRing.type.
Canonical finComRingType.
Coercion unitRingType : type >-> GRing.UnitRing.type.
Canonical unitRingType.
Coercion finUnitRingType : type >-> UnitRing.type.
Canonical finUnitRingType.
Coercion comUnitRingType : type >-> GRing.ComUnitRing.type.
Canonical comUnitRingType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finRingType.
Canonical join_finComRingType.
Canonical join_finUnitRingType.
Canonical ujoin_finComRingType.
Canonical cjoin_finUnitRingType.
Canonical fcjoin_finUnitRingType.
Notation finComUnitRingType := FinRing.ComUnitRing.type.
Notation "[ 'finComUnitRingType' 'of' T ]" := (do_pack pack T)
(at level 0, format "[ 'finComUnitRingType' 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Canonical countZmodType (T : type) := [countZmodType of T].
Canonical countRingType (T : type) := [countRingType of T].
Canonical countUnitRingType (T : type) := [countUnitRingType of T].
Canonical countComRingType (T : type) := [countComRingType of T].
Canonical countComUnitRingType (T : type) := [countComUnitRingType of T].
End Exports.
End ComUnitRing.
Import ComUnitRing.Exports.
Module IntegralDomain.
Section ClassDef.
Record class_of R :=
Class { base : GRing.IntegralDomain.class_of R; mixin : mixin_of R base }.
Definition base2 R (c : class_of R) := ComUnitRing.Class (mixin c).
Local Coercion base : class_of >-> GRing.IntegralDomain.class_of.
Local Coercion base2 : class_of >-> ComUnitRing.class_of.
Structure type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Definition pack := gen_pack Pack Class GRing.IntegralDomain.class.
Variable cT : type.
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition comRingType := @GRing.ComRing.Pack cT xclass.
Definition finComRingType := @ComRing.Pack cT xclass.
Definition unitRingType := @GRing.UnitRing.Pack cT xclass.
Definition finUnitRingType := @UnitRing.Pack cT xclass.
Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass.
Definition finComUnitRingType := @ComUnitRing.Pack cT xclass.
Definition idomainType := @GRing.IntegralDomain.Pack cT xclass.
Definition join_finType := @Finite.Pack idomainType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack idomainType xclass.
Definition join_finRingType := @Ring.Pack idomainType xclass.
Definition join_finUnitRingType := @UnitRing.Pack idomainType xclass.
Definition join_finComRingType := @ComRing.Pack idomainType xclass.
Definition join_finComUnitRingType := @ComUnitRing.Pack idomainType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group idomainType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.IntegralDomain.class_of.
Coercion base2 : class_of >-> ComUnitRing.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion comRingType : type >-> GRing.ComRing.type.
Canonical comRingType.
Coercion finComRingType : type >-> ComRing.type.
Canonical finComRingType.
Coercion unitRingType : type >-> GRing.UnitRing.type.
Canonical unitRingType.
Coercion finUnitRingType : type >-> UnitRing.type.
Canonical finUnitRingType.
Coercion comUnitRingType : type >-> GRing.ComUnitRing.type.
Canonical comUnitRingType.
Coercion finComUnitRingType : type >-> ComUnitRing.type.
Canonical finComUnitRingType.
Coercion idomainType : type >-> GRing.IntegralDomain.type.
Canonical idomainType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finRingType.
Canonical join_finComRingType.
Canonical join_finUnitRingType.
Canonical join_finComUnitRingType.
Notation finIdomainType := FinRing.IntegralDomain.type.
Notation "[ 'finIdomainType' 'of' T ]" := (do_pack pack T)
(at level 0, format "[ 'finIdomainType' 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Canonical countZmodType (T : type) := [countZmodType of T].
Canonical countRingType (T : type) := [countRingType of T].
Canonical countUnitRingType (T : type) := [countUnitRingType of T].
Canonical countComRingType (T : type) := [countComRingType of T].
Canonical countComUnitRingType (T : type) := [countComUnitRingType of T].
Canonical countIdomainType (T : type) := [countIdomainType of T].
End Exports.
End IntegralDomain.
Import IntegralDomain.Exports.
Module Field.
Section ClassDef.
Record class_of R :=
Class { base : GRing.Field.class_of R; mixin : mixin_of R base }.
Definition base2 R (c : class_of R) := IntegralDomain.Class (mixin c).
Local Coercion base : class_of >-> GRing.Field.class_of.
Local Coercion base2 : class_of >-> IntegralDomain.class_of.
Structure type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Definition pack := gen_pack Pack Class GRing.Field.class.
Variable cT : type.
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition comRingType := @GRing.ComRing.Pack cT xclass.
Definition finComRingType := @ComRing.Pack cT xclass.
Definition unitRingType := @GRing.UnitRing.Pack cT xclass.
Definition finUnitRingType := @UnitRing.Pack cT xclass.
Definition comUnitRingType := @GRing.ComUnitRing.Pack cT xclass.
Definition finComUnitRingType := @ComUnitRing.Pack cT xclass.
Definition idomainType := @GRing.IntegralDomain.Pack cT xclass.
Definition finIdomainType := @IntegralDomain.Pack cT xclass.
Definition fieldType := @GRing.Field.Pack cT xclass.
Definition join_finType := @Finite.Pack fieldType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack fieldType xclass.
Definition join_finRingType := @Ring.Pack fieldType xclass.
Definition join_finUnitRingType := @UnitRing.Pack fieldType xclass.
Definition join_finComRingType := @ComRing.Pack fieldType xclass.
Definition join_finComUnitRingType := @ComUnitRing.Pack fieldType xclass.
Definition join_finIdomainType := @IntegralDomain.Pack fieldType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group fieldType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.Field.class_of.
Coercion base2 : class_of >-> IntegralDomain.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion comRingType : type >-> GRing.ComRing.type.
Canonical comRingType.
Coercion finComRingType : type >-> ComRing.type.
Canonical finComRingType.
Coercion unitRingType : type >-> GRing.UnitRing.type.
Canonical unitRingType.
Coercion finUnitRingType : type >-> UnitRing.type.
Canonical finUnitRingType.
Coercion comUnitRingType : type >-> GRing.ComUnitRing.type.
Canonical comUnitRingType.
Coercion finComUnitRingType : type >-> ComUnitRing.type.
Canonical finComUnitRingType.
Coercion idomainType : type >-> GRing.IntegralDomain.type.
Canonical idomainType.
Coercion finIdomainType : type >-> IntegralDomain.type.
Canonical finIdomainType.
Coercion fieldType : type >-> GRing.Field.type.
Canonical fieldType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finRingType.
Canonical join_finComRingType.
Canonical join_finUnitRingType.
Canonical join_finComUnitRingType.
Canonical join_finIdomainType.
Notation finFieldType := FinRing.Field.type.
Notation "[ 'finFieldType' 'of' T ]" := (do_pack pack T)
(at level 0, format "[ 'finFieldType' 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Canonical countZmodType (T : type) := [countZmodType of T].
Canonical countRingType (T : type) := [countRingType of T].
Canonical countUnitRingType (T : type) := [countUnitRingType of T].
Canonical countComRingType (T : type) := [countComRingType of T].
Canonical countComUnitRingType (T : type) := [countComUnitRingType of T].
Canonical countIdomainType (T : type) := [countIdomainType of T].
Canonical countFieldType (T : type) := [countFieldType of T].
End Exports.
End Field.
Import Field.Exports.
Section DecideField.
Variable F : Field.type.
Fixpoint sat e f :=
match f with
| GRing.Bool b => b
| t1 == t2 => (GRing.eval e t1 == GRing.eval e t2)%bool
| GRing.Unit t => GRing.eval e t \is a GRing.unit
| f1 /\ f2 => sat e f1 && sat e f2
| f1 \/ f2 => sat e f1 || sat e f2
| f1 ==> f2 => (sat e f1 ==> sat e f2)%bool
| ~ f1 => ~~ sat e f1
| ('exists 'X_k, f1) => [exists x : F, sat (set_nth 0%R e k x) f1]
| ('forall 'X_k, f1) => [forall x : F, sat (set_nth 0%R e k x) f1]
end%T.
Lemma decidable : GRing.DecidableField.axiom sat.
Proof.
(* Goal: @GRing.DecidableField.axiom (Field.unitRingType F) sat *)
move=> e f; elim: f e; try by move=> f1 IH1 f2 IH2 e /=; case IH1; case IH2; constructor; tauto.
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
(* Goal: forall (t : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) (sat e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) *)
(* Goal: forall (t t0 : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) (sat e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) *)
(* Goal: forall (b : bool) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Bool (GRing.UnitRing.sort (Field.unitRingType F)) b)) (sat e (@GRing.Bool (GRing.UnitRing.sort (Field.unitRingType F)) b)) *)
-
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
(* Goal: forall (t : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) (sat e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) *)
(* Goal: forall (t t0 : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) (sat e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) *)
(* Goal: forall (b : bool) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Bool (GRing.UnitRing.sort (Field.unitRingType F)) b)) (sat e (@GRing.Bool (GRing.UnitRing.sort (Field.unitRingType F)) b)) *)
by move=> b e; apply: idP.
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
(* Goal: forall (t : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) (sat e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) *)
(* Goal: forall (t t0 : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) (sat e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) *)
-
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
(* Goal: forall (t : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) (sat e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) *)
(* Goal: forall (t t0 : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) (sat e (@GRing.Equal (GRing.UnitRing.sort (Field.unitRingType F)) t t0)) *)
by move=> t1 t2 e; apply: eqP.
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
(* Goal: forall (t : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) (sat e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) *)
-
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
(* Goal: forall (t : GRing.term (GRing.UnitRing.sort (Field.unitRingType F))) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) (sat e (@GRing.Unit (GRing.UnitRing.sort (Field.unitRingType F)) t)) *)
by move=> t e; apply: idP.
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
-
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) (sat e (@GRing.Not (GRing.UnitRing.sort (Field.unitRingType F)) f)) *)
by move=> f IH e /=; case: IH; constructor.
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
-
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Exists (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
by move=> i f IH e; apply: (iffP existsP) => [] [x fx]; exists x; apply/IH.
(* Goal: forall (n : nat) (f : GRing.formula (GRing.UnitRing.sort (Field.unitRingType F))) (_ : forall e : list (GRing.UnitRing.sort (Field.unitRingType F)), Bool.reflect (@GRing.holds (Field.unitRingType F) e f) (sat e f)) (e : list (GRing.UnitRing.sort (Field.unitRingType F))), Bool.reflect (@GRing.holds (Field.unitRingType F) e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) (sat e (@GRing.Forall (GRing.UnitRing.sort (Field.unitRingType F)) n f)) *)
by move=> i f IH e; apply: (iffP forallP) => f_ x; apply/IH.
Qed.
Definition DecidableFieldMixin := DecFieldMixin decidable.
End DecideField.
Module DecField.
Section Joins.
Variable cT : Field.type.
Let xT := let: Field.Pack T _ := cT in T.
Let xclass : Field.class_of xT := Field.class cT.
Definition type := Eval hnf in DecFieldType cT (DecidableFieldMixin cT).
Definition finType := @Finite.Pack type (fin_ xclass).
Definition finZmodType := @Zmodule.Pack type xclass.
Definition finRingType := @Ring.Pack type xclass.
Definition finUnitRingType := @UnitRing.Pack type xclass.
Definition finComRingType := @ComRing.Pack type xclass.
Definition finComUnitRingType := @ComUnitRing.Pack type xclass.
Definition finIdomainType := @IntegralDomain.Pack type xclass.
Definition baseFinGroupType := base_group type finZmodType finZmodType.
Definition finGroupType := fin_group baseFinGroupType cT.
End Joins.
Module Exports.
Coercion type : Field.type >-> GRing.DecidableField.type.
Canonical type.
Canonical finType.
Canonical finZmodType.
Canonical finRingType.
Canonical finUnitRingType.
Canonical finComRingType.
Canonical finComUnitRingType.
Canonical finIdomainType.
Canonical baseFinGroupType.
Canonical finGroupType.
End Exports.
End DecField.
Module Lmodule.
Section ClassDef.
Variable R : ringType.
Record class_of M :=
Class { base : GRing.Lmodule.class_of R M; mixin : mixin_of M base }.
Definition base2 R (c : class_of R) := Zmodule.Class (mixin c).
Local Coercion base : class_of >-> GRing.Lmodule.class_of.
Local Coercion base2 : class_of >-> Zmodule.class_of.
Structure type (phR : phant R) := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Variables (phR : phant R) (cT : type phR).
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Definition pack := gen_pack (Pack phR) Class (@GRing.Lmodule.class R phR).
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition lmodType := @GRing.Lmodule.Pack R phR cT xclass.
Definition join_finType := @Finite.Pack lmodType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack lmodType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group lmodType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> GRing.Lmodule.class_of.
Coercion base2 : class_of >-> Zmodule.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion lmodType : type >-> GRing.Lmodule.type.
Canonical lmodType.
Canonical join_finType.
Canonical join_finZmodType.
Notation finLmodType R := (FinRing.Lmodule.type (Phant R)).
Notation "[ 'finLmodType' R 'of' T ]" := (do_pack (@pack _ (Phant R)) T)
(at level 0, format "[ 'finLmodType' R 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Section counttype.
Variables (R : ringType) (phR : phant R) (T : type phR).
Canonical countZmodType := [countZmodType of T].
End counttype.
End Exports.
End Lmodule.
Import Lmodule.Exports.
Module Lalgebra.
Section ClassDef.
Variable R : ringType.
Record class_of M :=
Class { base : GRing.Lalgebra.class_of R M; mixin : mixin_of M base }.
Definition base2 M (c : class_of M) := Ring.Class (mixin c).
Definition base3 M (c : class_of M) := @Lmodule.Class _ _ (base c) (mixin c).
Local Coercion base : class_of >-> GRing.Lalgebra.class_of.
Local Coercion base2 : class_of >-> Ring.class_of.
Local Coercion base3 : class_of >-> Lmodule.class_of.
Structure type (phR : phant R) := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Variables (phR : phant R) (cT : type phR).
Definition pack := gen_pack (Pack phR) Class (@GRing.Lalgebra.class R phR).
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition lmodType := @GRing.Lmodule.Pack R phR cT xclass.
Definition finLmodType := @Lmodule.Pack R phR cT xclass.
Definition lalgType := @GRing.Lalgebra.Pack R phR cT xclass.
Definition join_finType := @Finite.Pack lalgType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack lalgType xclass.
Definition join_finLmodType := @Lmodule.Pack R phR lalgType xclass.
Definition join_finRingType := @Ring.Pack lalgType xclass.
Definition rjoin_finLmodType := @Lmodule.Pack R phR ringType xclass.
Definition ljoin_finRingType := @Ring.Pack lmodType xclass.
Definition fljoin_finRingType := @Ring.Pack finLmodType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group lalgType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.Lalgebra.class_of.
Coercion base2 : class_of >-> Ring.class_of.
Coercion base3 : class_of >-> Lmodule.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion lmodType : type >-> GRing.Lmodule.type.
Canonical lmodType.
Coercion finLmodType : type >-> Lmodule.type.
Canonical finLmodType.
Coercion lalgType : type >-> GRing.Lalgebra.type.
Canonical lalgType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finLmodType.
Canonical join_finRingType.
Canonical rjoin_finLmodType.
Canonical ljoin_finRingType.
Canonical fljoin_finRingType.
Notation finLalgType R := (FinRing.Lalgebra.type (Phant R)).
Notation "[ 'finLalgType' R 'of' T ]" := (do_pack (@pack _ (Phant R)) T)
(at level 0, format "[ 'finLalgType' R 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Section counttype.
Variables (R : GRing.Ring.type) (phR : phant R) (T : type phR).
Canonical countZmodType := [countZmodType of T].
Canonical countRingType := [countRingType of T].
End counttype.
End Exports.
End Lalgebra.
Import Lalgebra.Exports.
Module Algebra.
Section ClassDef.
Variable R : ringType.
Record class_of M :=
Class { base : GRing.Algebra.class_of R M; mixin : mixin_of M base }.
Definition base2 M (c : class_of M) := Lalgebra.Class (mixin c).
Local Coercion base : class_of >-> GRing.Algebra.class_of.
Local Coercion base2 : class_of >->Lalgebra.class_of.
Structure type (phR : phant R) := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Variables (phR : phant R) (cT : type phR).
Definition pack := gen_pack (Pack phR) Class (@GRing.Algebra.class R phR).
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition lmodType := @GRing.Lmodule.Pack R phR cT xclass.
Definition finLmodType := @Lmodule.Pack R phR cT xclass.
Definition lalgType := @GRing.Lalgebra.Pack R phR cT xclass.
Definition finLalgType := @Lalgebra.Pack R phR cT xclass.
Definition algType := @GRing.Algebra.Pack R phR cT xclass.
Definition join_finType := @Finite.Pack algType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack algType xclass.
Definition join_finRingType := @Ring.Pack algType xclass.
Definition join_finLmodType := @Lmodule.Pack R phR algType xclass.
Definition join_finLalgType := @Lalgebra.Pack R phR algType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group algType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.Algebra.class_of.
Coercion base2 : class_of >-> Lalgebra.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion lmodType : type >-> GRing.Lmodule.type.
Canonical lmodType.
Coercion finLmodType : type >-> Lmodule.type.
Canonical finLmodType.
Coercion lalgType : type >-> GRing.Lalgebra.type.
Canonical lalgType.
Coercion finLalgType : type >-> Lalgebra.type.
Canonical finLalgType.
Coercion algType : type >-> GRing.Algebra.type.
Canonical algType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finLmodType.
Canonical join_finRingType.
Canonical join_finLalgType.
Notation finAlgType R := (type (Phant R)).
Notation "[ 'finAlgType' R 'of' T ]" := (do_pack (@pack _ (Phant R)) T)
(at level 0, format "[ 'finAlgType' R 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Section counttype.
Variables (R : GRing.Ring.type) (phR : phant R) (T : type phR).
Canonical countZmodType := [countZmodType of T].
Canonical countRingType := [countRingType of T].
End counttype.
End Exports.
End Algebra.
Import Algebra.Exports.
Module UnitAlgebra.
Section ClassDef.
Variable R : unitRingType.
Record class_of M :=
Class { base : GRing.UnitAlgebra.class_of R M; mixin : mixin_of M base }.
Definition base2 M (c : class_of M) := Algebra.Class (mixin c).
Definition base3 M (c : class_of M) := @UnitRing.Class _ (base c) (mixin c).
Local Coercion base : class_of >-> GRing.UnitAlgebra.class_of.
Local Coercion base2 : class_of >-> Algebra.class_of.
Local Coercion base3 : class_of >-> UnitRing.class_of.
Structure type (phR : phant R) := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Variables (phR : phant R) (cT : type phR).
Definition pack := gen_pack (Pack phR) Class (@GRing.UnitAlgebra.class R phR).
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition countType := @Countable.Pack cT (fin_ xclass).
Definition finType := @Finite.Pack cT (fin_ xclass).
Definition zmodType := @GRing.Zmodule.Pack cT xclass.
Definition finZmodType := @Zmodule.Pack cT xclass.
Definition ringType := @GRing.Ring.Pack cT xclass.
Definition finRingType := @Ring.Pack cT xclass.
Definition unitRingType := @GRing.UnitRing.Pack cT xclass.
Definition finUnitRingType := @UnitRing.Pack cT xclass.
Definition lmodType := @GRing.Lmodule.Pack R phR cT xclass.
Definition finLmodType := @Lmodule.Pack R phR cT xclass.
Definition lalgType := @GRing.Lalgebra.Pack R phR cT xclass.
Definition finLalgType := @Lalgebra.Pack R phR cT xclass.
Definition algType := @GRing.Algebra.Pack R phR cT xclass.
Definition finAlgType := @Algebra.Pack R phR cT xclass.
Definition unitAlgType := @GRing.UnitAlgebra.Pack R phR cT xclass.
Definition join_finType := @Finite.Pack unitAlgType (fin_ xclass).
Definition join_finZmodType := @Zmodule.Pack unitAlgType xclass.
Definition join_finRingType := @Ring.Pack unitAlgType xclass.
Definition join_finUnitRingType := @UnitRing.Pack unitAlgType xclass.
Definition join_finLmodType := @Lmodule.Pack R phR unitAlgType xclass.
Definition join_finLalgType := @Lalgebra.Pack R phR unitAlgType xclass.
Definition join_finAlgType := @Algebra.Pack R phR unitAlgType xclass.
Definition ljoin_finUnitRingType := @UnitRing.Pack lmodType xclass.
Definition fljoin_finUnitRingType := @UnitRing.Pack finLmodType xclass.
Definition njoin_finUnitRingType := @UnitRing.Pack lalgType xclass.
Definition fnjoin_finUnitRingType := @UnitRing.Pack finLalgType xclass.
Definition ajoin_finUnitRingType := @UnitRing.Pack algType xclass.
Definition fajoin_finUnitRingType := @UnitRing.Pack finAlgType xclass.
Definition ujoin_finLmodType := @Lmodule.Pack R phR unitRingType xclass.
Definition ujoin_finLalgType := @Lalgebra.Pack R phR unitRingType xclass.
Definition ujoin_finAlgType := @Algebra.Pack R phR unitRingType xclass.
Definition baseFinGroupType := base_group cT zmodType finType.
Definition finGroupType := fin_group baseFinGroupType zmodType.
Definition join_baseFinGroupType := base_group unitAlgType zmodType finType.
Definition join_finGroupType := fin_group join_baseFinGroupType zmodType.
End ClassDef.
Module Exports.
Coercion base : class_of >-> GRing.UnitAlgebra.class_of.
Coercion base2 : class_of >-> Algebra.class_of.
Coercion base3 : class_of >-> UnitRing.class_of.
Coercion sort : type >-> Sortclass.
Bind Scope ring_scope with sort.
Coercion eqType : type >-> Equality.type.
Canonical eqType.
Coercion choiceType : type >-> Choice.type.
Canonical choiceType.
Coercion countType : type >-> Countable.type.
Canonical countType.
Coercion finType : type >-> Finite.type.
Canonical finType.
Coercion zmodType : type >-> GRing.Zmodule.type.
Canonical zmodType.
Coercion finZmodType : type >-> Zmodule.type.
Canonical finZmodType.
Coercion ringType : type >-> GRing.Ring.type.
Canonical ringType.
Coercion finRingType : type >-> Ring.type.
Canonical finRingType.
Coercion unitRingType : type >-> GRing.UnitRing.type.
Canonical unitRingType.
Coercion finUnitRingType : type >-> UnitRing.type.
Canonical finUnitRingType.
Coercion lmodType : type >-> GRing.Lmodule.type.
Canonical lmodType.
Coercion finLmodType : type >-> Lmodule.type.
Canonical finLmodType.
Coercion lalgType : type >-> GRing.Lalgebra.type.
Canonical lalgType.
Coercion finLalgType : type >-> Lalgebra.type.
Canonical finLalgType.
Coercion algType : type >-> GRing.Algebra.type.
Canonical algType.
Coercion finAlgType : type >-> Algebra.type.
Canonical finAlgType.
Coercion unitAlgType : type >-> GRing.UnitAlgebra.type.
Canonical unitAlgType.
Canonical join_finType.
Canonical join_finZmodType.
Canonical join_finLmodType.
Canonical join_finRingType.
Canonical join_finLalgType.
Canonical join_finAlgType.
Canonical ljoin_finUnitRingType.
Canonical fljoin_finUnitRingType.
Canonical njoin_finUnitRingType.
Canonical fnjoin_finUnitRingType.
Canonical ajoin_finUnitRingType.
Canonical fajoin_finUnitRingType.
Canonical ujoin_finLmodType.
Canonical ujoin_finLalgType.
Canonical ujoin_finAlgType.
Notation finUnitAlgType R := (type (Phant R)).
Notation "[ 'finUnitAlgType' R 'of' T ]" := (do_pack (@pack _ (Phant R)) T)
(at level 0, format "[ 'finUnitAlgType' R 'of' T ]") : form_scope.
Canonical baseFinGroupType.
Canonical finGroupType.
Canonical join_baseFinGroupType.
Canonical join_finGroupType.
Section counttype.
Variables (R : GRing.UnitRing.type) (phR : phant R) (T : type phR).
Canonical countZmodType := [countZmodType of T].
Canonical countRingType := [countRingType of T].
Canonical countUnitRingType := [countUnitRingType of T].
End counttype.
End Exports.
End UnitAlgebra.
Import UnitAlgebra.Exports.
Module Theory.
Definition zmod1gE := zmod1gE.
Proof.
(* Goal: @eq (Zmodule.sort U) (oneg (Zmodule.baseFinGroupType U)) (GRing.zero (Zmodule.zmodType U)) *)
by [].
Qed.
Definition zmodVgE := zmodVgE.
Definition zmodMgE := zmodMgE.
Proof.
(* Goal: @eq (FinGroup.sort (Zmodule.baseFinGroupType U)) (@mulg (Zmodule.baseFinGroupType U) x y) (@GRing.add (Zmodule.zmodType U) x y) *)
by [].
Qed.
Definition zmodXgE := zmodXgE.
Definition zmod_mulgC := zmod_mulgC.
Proof.
(* Goal: @commute (Zmodule.baseFinGroupType U) x y *)
exact: GRing.addrC.
Qed.
Definition zmod_abelian := zmod_abelian.
Definition val_unit1 := val_unit1.
Proof.
(* Goal: @eq (UnitRing.sort R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType (oneg unit_baseFinGroupType : unit_of phR)) (GRing.one (UnitRing.ringType R)) *)
by [].
Qed.
Definition val_unitM := val_unitM.
Definition val_unitX := val_unitX.
Definition val_unitV := val_unitV.
Proof.
(* Goal: @eq (UnitRing.sort R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType (@invg unit_baseFinGroupType x : unit_of phR)) (@GRing.inv (UnitRing.unitRingType R) (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType x)) *)
by [].
Qed.
Definition unit_actE := unit_actE.
Proof.
(* Goal: @eq (GRing.Ring.sort (UnitRing.ringType R)) (unit_act x u) (@GRing.mul (UnitRing.ringType R) x (@val (UnitRing.sort R) (fun x : UnitRing.sort R => @in_mem (UnitRing.sort R) x (@mem (GRing.UnitRing.sort (UnitRing.unitRingType R)) (predPredType (GRing.UnitRing.sort (UnitRing.unitRingType R))) (@has_quality (S O) (GRing.UnitRing.sort (UnitRing.unitRingType R)) (@GRing.unit (UnitRing.unitRingType R))))) unit_subType u)) *)
by [].
Qed.
End Theory.
End FinRing.
Import FinRing.
Export Zmodule.Exports Ring.Exports ComRing.Exports.
Export UnitRing.Exports UnitsGroupExports ComUnitRing.Exports.
Export IntegralDomain.Exports Field.Exports DecField.Exports.
Export Lmodule.Exports Lalgebra.Exports Algebra.Exports UnitAlgebra.Exports.
Notation "{ 'unit' R }" := (unit_of (Phant R))
(at level 0, format "{ 'unit' R }") : type_scope.
Prenex Implicits FinRing.uval.
Notation "''U'" := (unit_action _) (at level 8) : action_scope.
Notation "''U'" := (unit_groupAction _) (at level 8) : groupAction_scope.
|
Require Export GeoCoq.Elements.OriginalProofs.lemma_TGflip.
Require Export GeoCoq.Elements.OriginalProofs.lemma_TGsymmetric.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma lemma_TTflip :
forall A B C D E F G H,
TT A B C D E F G H ->
TT B A D C 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 B A D C E F G H *)
intros.
(* Goal: @TT Ax0 B A D C 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 B A D C E F G H *)
assert (TG B A C D E J) by (forward_using lemma_TGflip).
(* Goal: @TT Ax0 B A D C E F G H *)
assert (TG C D B A E J) by (conclude lemma_TGsymmetric).
(* Goal: @TT Ax0 B A D C E F G H *)
assert (TG D C B A E J) by (forward_using lemma_TGflip).
(* Goal: @TT Ax0 B A D C E F G H *)
assert (TG B A D C E J) by (conclude lemma_TGsymmetric).
(* Goal: @TT Ax0 B A D C E F G H *)
assert (TT B A D C E F G H) by (conclude_def TT ).
(* Goal: @TT Ax0 B A D C E F G H *)
close.
Qed.
End Euclid. |
Require Import mathcomp.ssreflect.ssreflect.
From mathcomp
Require Import ssrbool ssrfun eqtype ssrnat seq div choice fintype.
From mathcomp
Require Import bigop finset fingroup morphism quotient action.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GroupScope.
Section Defs.
Variables gT : finGroupType.
Implicit Types A B C : {set gT}.
Definition partial_product A B :=
if A == 1 then B else if B == 1 then A else
if [&& group_set A, group_set B & B \subset 'N(A)] then A * B else set0.
Definition semidirect_product A B :=
if A :&: B \subset 1%G then partial_product A B else set0.
Definition central_product A B :=
if B \subset 'C(A) then partial_product A B else set0.
Definition direct_product A B :=
if A :&: B \subset 1%G then central_product A B else set0.
Definition complements_to_in A B :=
[set K : {group gT} | A :&: K == 1 & A * K == B].
Definition splits_over B A := complements_to_in A B != set0.
Definition remgr A B x := repr (A :* x :&: B).
Definition divgr A B x := x * (remgr A B x)^-1.
End Defs.
Arguments partial_product _ _%g _%g : clear implicits.
Arguments semidirect_product _ _%g _%g : clear implicits.
Arguments central_product _ _%g _%g : clear implicits.
Arguments complements_to_in _ _%g _%g.
Arguments splits_over _ _%g _%g.
Arguments remgr _ _%g _%g _%g.
Arguments divgr _ _%g _%g _%g.
Arguments direct_product : clear implicits.
Notation pprod := (partial_product _).
Notation sdprod := (semidirect_product _).
Notation cprod := (central_product _).
Notation dprod := (direct_product _).
Notation "G ><| H" := (sdprod G H)%g (at level 40, left associativity).
Notation "G \* H" := (cprod G H)%g (at level 40, left associativity).
Notation "G \x H" := (dprod G H)%g (at level 40, left associativity).
Notation "[ 'complements' 'to' A 'in' B ]" := (complements_to_in A B)
(at level 0, format "[ 'complements' 'to' A 'in' B ]") : group_scope.
Notation "[ 'splits' B , 'over' A ]" := (splits_over B A)
(at level 0, format "[ 'splits' B , 'over' A ]") : group_scope.
Prenex Implicits remgr divgr.
Section InternalProd.
Variable gT : finGroupType.
Implicit Types A B C : {set gT}.
Implicit Types G H K L M : {group gT}.
Local Notation pprod := (partial_product gT).
Local Notation sdprod := (semidirect_product gT) (only parsing).
Local Notation cprod := (central_product gT) (only parsing).
Local Notation dprod := (direct_product gT) (only parsing).
Lemma pprod1g : left_id 1 pprod.
Proof.
(* Goal: @left_id (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (partial_product gT) *)
by move=> A; rewrite /pprod eqxx.
Qed.
Lemma pprodg1 : right_id 1 pprod.
Proof.
(* Goal: @right_id (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (partial_product gT) *)
by move=> A; rewrite /pprod eqxx; case: eqP.
Qed.
Variant are_groups A B : Prop := AreGroups K H of A = K & B = H.
Lemma group_not0 G : set0 <> G.
Proof.
(* Goal: not (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G)) *)
by move/setP/(_ 1); rewrite inE group1.
Qed.
Lemma mulg0 : right_zero (@set0 gT) mulg.
Proof.
(* Goal: @right_zero (FinGroup.arg_sort (group_set_baseGroupType (FinGroup.base gT))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (group_set_baseGroupType (FinGroup.base gT))) *)
by move=> A; apply/setP=> x; rewrite inE; apply/imset2P=> [[y z]]; rewrite inE.
Qed.
Lemma mul0g : left_zero (@set0 gT) mulg.
Proof.
(* Goal: @left_zero (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (FinGroup.arg_sort (group_set_baseGroupType (FinGroup.base gT))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (group_set_baseGroupType (FinGroup.base gT))) *)
by move=> A; apply/setP=> x; rewrite inE; apply/imset2P=> [[y z]]; rewrite inE.
Qed.
Lemma pprodP A B G :
pprod A B = G -> [/\ are_groups A B, A * B = G & B \subset 'N(A)].
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT A B) (@gval gT G), and3 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) *)
have Gnot0 := @group_not0 G; rewrite /pprod; do 2?case: eqP => [-> ->| _].
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G), and3 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) *)
(* Goal: and3 (are_groups (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@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)) (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)) (@normaliser gT (@gval gT G)))))) *)
(* Goal: and3 (are_groups (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) (@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 (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))))) *)
-
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G), and3 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) *)
(* Goal: and3 (are_groups (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@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)) (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)) (@normaliser gT (@gval gT G)))))) *)
(* Goal: and3 (are_groups (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT G)) (@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 (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))))) *)
by rewrite mul1g norms1; split; first exists 1%G G.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G), and3 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) *)
(* Goal: and3 (are_groups (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@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)) (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)) (@normaliser gT (@gval gT G)))))) *)
-
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G), and3 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) *)
(* Goal: and3 (are_groups (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@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)) (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)) (@normaliser gT (@gval gT G)))))) *)
by rewrite mulg1 sub1G; split; first exists G 1%G.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G), and3 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) *)
by case: and3P => // [[gA gB ->]]; split; first exists (Group gA) (Group gB).
Qed.
Lemma pprodE K H : H \subset 'N(K) -> pprod K H = 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 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))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT (@gval gT K) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) *)
move=> nKH; rewrite /pprod nKH !groupP /=.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then @gval gT H else if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then @gval gT K else @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) *)
by do 2?case: eqP => [-> | _]; rewrite ?mulg1 ?mul1g.
Qed.
Lemma pprodEY K H : H \subset 'N(K) -> pprod K H = 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 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))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT (@gval gT K) (@gval gT H)) (@joing gT (@gval gT K) (@gval gT H)) *)
by move=> nKH; rewrite pprodE ?norm_joinEr.
Qed.
Lemma pprodWC A B G : pprod A B = G -> B * A = G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT A B) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B A) (@gval gT G) *)
by case/pprodP=> _ <- /normC.
Qed.
Lemma pprodWY A B G : pprod A B = G -> A <*> B = G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT A B) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A B) (@gval gT G) *)
by case/pprodP=> [[K H -> ->] <- /norm_joinEr].
Qed.
Lemma pprodJ A B x : pprod A B :^ x = pprod (A :^ x) (B :^ x).
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (partial_product gT A B) x) (partial_product gT (@conjugate gT A x) (@conjugate gT B x)) *)
rewrite /pprod !conjsg_eq1 !group_setJ normJ conjSg -conjsMg.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then B else if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then A else if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) x) (if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then @conjugate gT B x else if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then @conjugate gT A x else if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @conjugate gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) x else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by do 3?case: ifP => // _; apply: conj0g.
Qed.
Lemma remgrMl K B x y : y \in K -> remgr K B (y * x) = remgr K B 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 K)))), @eq (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) B (@mulg (FinGroup.base gT) y x)) (@remgr gT (@gval gT K) B x) *)
by move=> Ky; rewrite {1}/remgr rcosetM rcoset_id.
Qed.
Lemma remgrP K B x : (remgr K B x \in K :* x :&: B) = (x \in K * B).
Lemma remgr1 K H x : x \in K -> remgr K H 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)) (@gval gT K)))), @eq (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H) x) (oneg (FinGroup.base gT)) *)
by move=> Kx; rewrite /remgr rcoset_id ?repr_group.
Qed.
Lemma divgr_eq A B x : x = divgr A B x * remgr A B x.
Proof.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base gT)) x (@mulg (FinGroup.base gT) (@divgr gT A B x) (@remgr gT A B x)) *)
by rewrite mulgKV.
Qed.
Lemma divgrMl K B x y : x \in K -> divgr K B (x * y) = x * divgr K B 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 K)))), @eq (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) B (@mulg (FinGroup.base gT) x y)) (@mulg (FinGroup.base gT) x (@divgr gT (@gval gT K) B y)) *)
by move=> Hx; rewrite /divgr remgrMl ?mulgA.
Qed.
Lemma divgr_id K H x : x \in K -> divgr K H x = 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 K)))), @eq (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H) x) x *)
by move=> Kx; rewrite /divgr remgr1 // invg1 mulg1.
Qed.
Lemma mem_remgr K B x : x \in K * B -> remgr K B x \in B.
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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) B)))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) 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)) B))) *)
by rewrite -remgrP => /setIP[].
Qed.
Lemma mem_divgr K B x : x \in K * B -> divgr K B x \in K.
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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) B)))), is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) B x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K)))) *)
by rewrite -remgrP inE rcoset_sym mem_rcoset => /andP[].
Qed.
Section DisjointRem.
Variables K H : {group gT}.
Hypothesis tiKH : K :&: H = 1.
Lemma remgr_id x : x \in H -> remgr K H x = 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 H)))), @eq (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H) x) x *)
move=> Hx; apply/eqP; rewrite eq_mulgV1 (sameP eqP set1gP) -tiKH inE.
(* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) 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)) (@gval gT K)))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) 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)) (@gval gT H))))) *)
rewrite -mem_rcoset groupMr ?groupV // -in_setI remgrP.
(* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H))))) *)
by apply: subsetP Hx; apply: mulG_subr.
Qed.
Lemma remgrMid x y : x \in K -> y \in H -> remgr K H (x * y) = 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 K))))) (_ : 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 (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) x y)) y *)
by move=> Kx Hy; rewrite remgrMl ?remgr_id.
Qed.
Lemma divgrMid x y : x \in K -> y \in H -> divgr K H (x * y) = 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 K))))) (_ : 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 (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) x y)) x *)
by move=> Kx Hy; rewrite /divgr remgrMid ?mulgK.
Qed.
End DisjointRem.
Lemma subcent_TImulg K H A :
K :&: H = 1 -> A \subset 'N(K) :&: 'N(H) -> 'C_K(A) * 'C_H(A) = 'C_(K * H)(A).
Lemma complP H A B :
reflect (A :&: H = 1 /\ A * H = B) (H \in [complements to A in B]).
Proof.
(* Goal: Bool.reflect (and (@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)) A (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT H)) B)) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@complements_to_in gT A B)))) *)
by apply: (iffP setIdP); case; split; apply/eqP.
Qed.
Lemma splitsP B A :
reflect (exists H, H \in [complements to A in B]) [splits B, over A].
Proof.
(* Goal: Bool.reflect (@ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun H : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@complements_to_in gT A B)))))) (@splits_over gT B A) *)
exact: set0Pn.
Qed.
Lemma complgC H K G :
(H \in [complements to K in G]) = (K \in [complements to H in G]).
Section NormalComplement.
Variables K H G : {group gT}.
Hypothesis complH_K : H \in [complements to K in G].
Lemma remgrM : K <| G -> {in G &, {morph remgr K H : x y / x * y}}.
Proof.
(* Goal: forall _ : is_true (@normal gT (@gval gT K) (@gval gT G)), @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 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @eq (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H) ((fun x0 y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) (@remgr gT (@gval gT K) (@gval gT H) x) (@remgr gT (@gval gT K) (@gval gT H) y))) (inPhantom (@morphism_2 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H)) (fun x y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y))) *)
case/normalP=> _; case/complP: complH_K => tiKH <- nK_KH x y KHx KHy.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) x y)) (@mulg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) x) (@remgr gT (@gval gT K) (@gval gT H) y)) *)
rewrite {1}(divgr_eq K H y) mulgA (conjgCV x) {2}(divgr_eq K H x) -2!mulgA.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) (@conjg gT (@divgr gT (@gval gT K) (@gval gT H) y) (@invg (FinGroup.base gT) x)) (@mulg (FinGroup.base gT) (@divgr gT (@gval gT K) (@gval gT H) x) (@mulg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) x) (@remgr gT (@gval gT K) (@gval gT H) y))))) (@mulg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) x) (@remgr gT (@gval gT K) (@gval gT H) y)) *)
rewrite mulgA remgrMid //; last by rewrite groupMl mem_remgr.
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) (@conjg gT (@divgr gT (@gval gT K) (@gval gT H) y) (@invg (FinGroup.base gT) x)) (@divgr gT (@gval gT K) (@gval gT H) x)) (@mem (Finite.sort (FinGroup.arg_finType (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 groupMl !(=^~ mem_conjg, nK_KH, mem_divgr).
Qed.
Lemma divgrM : H \subset 'C(K) -> {in G &, {morph divgr K H : x y / x * y}}.
Proof.
(* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT K))))), @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 (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H) ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) (@divgr gT (@gval gT K) (@gval gT H) x) (@divgr gT (@gval gT K) (@gval gT H) y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H)) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y))) *)
move=> cKH; have /complP[_ defG] := complH_K.
(* 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 (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) x y)) (@mulg (FinGroup.base gT) (@divgr gT (@gval gT K) (@gval gT H) x) (@divgr gT (@gval gT K) (@gval gT H) y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H)) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y))) *)
have nsKG: K <| G by rewrite -defG -cent_joinEr // normalYl cents_norm.
(* 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 (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) x y)) (@mulg (FinGroup.base gT) (@divgr gT (@gval gT K) (@gval gT H) x) (@divgr gT (@gval gT K) (@gval gT H) y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H)) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y))) *)
move=> x y Gx Gy; rewrite {1}/divgr remgrM // invMg -!mulgA (mulgA y).
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) y (@invg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) y))) (@invg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) x)))) (@mulg (FinGroup.base gT) x (@mulg (FinGroup.base gT) (@invg (FinGroup.base gT) (@remgr gT (@gval gT K) (@gval gT H) x)) (@divgr gT (@gval gT K) (@gval gT H) y))) *)
by congr (_ * _); rewrite -(centsP cKH) ?groupV ?(mem_remgr, mem_divgr, defG).
Qed.
End NormalComplement.
Lemma sdprod1g : left_id 1 sdprod.
Proof.
(* Goal: @left_id (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (semidirect_product gT) *)
by move=> A; rewrite /sdprod subsetIl pprod1g.
Qed.
Lemma sdprodg1 : right_id 1 sdprod.
Proof.
(* Goal: @right_id (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (semidirect_product gT) *)
by move=> A; rewrite /sdprod subsetIr pprodg1.
Qed.
Lemma sdprodP A B G :
A ><| B = G -> [/\ are_groups A B, A * B = G, B \subset 'N(A) & A :&: B = 1].
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G), and4 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) (@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)) A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *)
rewrite /sdprod; case: ifP => [trAB | _ /group_not0[] //].
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT A B) (@gval gT G), and4 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) (@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)) A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *)
case/pprodP=> gAB defG nBA; split=> {defG nBA}//.
(* 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)) A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *)
by case: gAB trAB => H K -> -> /trivgP.
Qed.
Lemma sdprodE K H : H \subset 'N(K) -> K :&: H = 1 -> K ><| H = 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 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)))))) (_ : @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)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) *)
by move=> nKH tiKH; rewrite /sdprod tiKH subxx pprodE.
Qed.
Lemma sdprodEY K H : H \subset 'N(K) -> K :&: H = 1 -> K ><| H = 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 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)))))) (_ : @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)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@joing gT (@gval gT K) (@gval gT H)) *)
by move=> nKH tiKH; rewrite sdprodE ?norm_joinEr.
Qed.
Lemma sdprodWpp A B G : A ><| B = G -> pprod A B = G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT A B) (@gval gT G) *)
by case/sdprodP=> [[K H -> ->] <- /pprodE].
Qed.
Lemma sdprodW A B G : A ><| B = G -> A * B = G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G) *)
by move/sdprodWpp/pprodW.
Qed.
Lemma sdprodWC A B G : A ><| B = G -> B * A = G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B A) (@gval gT G) *)
by move/sdprodWpp/pprodWC.
Qed.
Lemma sdprodWY A B G : A ><| B = G -> A <*> B = G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A B) (@gval gT G) *)
by move/sdprodWpp/pprodWY.
Qed.
Lemma sdprodJ 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 (semidirect_product gT A B) x) (semidirect_product gT (@conjugate gT A x) (@conjugate gT B x)) *)
rewrite /sdprod -conjIg sub_conjg conjs1g -pprodJ.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then partial_product gT A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) x) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A 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)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) then @conjugate gT (partial_product gT A B) x else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by case: ifP => _ //; apply: imset0.
Qed.
Lemma sdprod_context G K H : K ><| H = G ->
[/\ K <| G, H \subset G, K * H = G, H \subset 'N(K) & K :&: H = 1].
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G), and5 (is_true (@normal gT (@gval gT K) (@gval gT G))) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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 K) (@gval gT H)) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT (@gval gT K)))))) (@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)))) *)
case/sdprodP=> _ <- nKH tiKH.
(* Goal: and5 (is_true (@normal gT (@gval gT K) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)))))) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@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)) (@normaliser gT (@gval gT K)))))) (@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)))) *)
by rewrite /normal mulG_subl mulG_subr mulG_subG normG.
Qed.
Lemma sdprod_compl G K H : K ><| H = G -> H \in [complements to K in G].
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G), is_true (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@complements_to_in gT (@gval gT K) (@gval gT G))))) *)
by case/sdprodP=> _ mulKH _ tiKH; apply/complP.
Qed.
Lemma sdprod_normal_complP G K H :
K <| G -> reflect (K ><| H = G) (K \in [complements to H in G]).
Proof.
(* Goal: forall _ : is_true (@normal gT (@gval gT K) (@gval gT G)), Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) K (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@complements_to_in gT (@gval gT H) (@gval gT G))))) *)
case/andP=> _ nKG; rewrite complgC.
(* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (@in_mem (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) H (@mem (Finite.sort (group_of_finType gT)) (predPredType (Finite.sort (group_of_finType gT))) (@SetDef.pred_of_set (group_of_finType gT) (@complements_to_in gT (@gval gT K) (@gval gT G))))) *)
apply: (iffP idP); [case/complP=> tiKH mulKH | exact: sdprod_compl].
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G) *)
by rewrite sdprodE ?(subset_trans _ nKG) // -mulKH mulG_subr.
Qed.
Lemma sdprod_card G A B : A ><| B = G -> (#|A| * #|B|)%N = #|G|.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@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)) 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)) B)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
by case/sdprodP=> [[H K -> ->] <- _ /TI_cardMg].
Qed.
Lemma sdprod_isom G A B :
A ><| B = G ->
{nAB : B \subset 'N(A) | isom B (G / A) (restrm nAB (coset A))}.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G), @sig (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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))))) (fun nAB : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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)))) => is_true (@isom gT (@coset_groupType gT A) B (@quotient gT (@gval gT G) A) (@restrm gT (@coset_groupType gT A) B (@normaliser gT A) nAB (@coset gT A)))) *)
case/sdprodP=> [[K H -> ->] <- nKH tiKH].
(* Goal: @sig (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))))) (fun nAB : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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))))) => is_true (@isom gT (@coset_groupType gT (@gval gT K)) (@gval gT H) (@quotient gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) (@gval gT K)) (@restrm gT (@coset_groupType gT (@gval gT K)) (@gval gT H) (@normaliser gT (@gval gT K)) nAB (@coset gT (@gval gT K))))) *)
by exists nKH; rewrite quotientMidl quotient_isom.
Qed.
Lemma sdprod_isog G A B : A ><| B = G -> B \isog G / A.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G), is_true (@isog gT (@coset_groupType gT A) B (@quotient gT (@gval gT G) A)) *)
by case/sdprod_isom=> nAB; apply: isom_isog.
Qed.
Lemma sdprod_subr G A B M : A ><| B = G -> M \subset B -> A ><| M = A <*> M.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A (@gval gT M)) (@joing gT A (@gval gT M)) *)
case/sdprodP=> [[K H -> ->] _ nKH tiKH] sMH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT M)) (@joing gT (@gval gT K) (@gval gT M)) *)
by rewrite sdprodEY ?(subset_trans sMH) //; apply/trivgP; rewrite -tiKH setIS.
Qed.
Lemma index_sdprod G A B : A ><| B = G -> #|B| = #|G : A|.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@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)) B))) (@indexg gT (@gval gT G) A) *)
case/sdprodP=> [[K H -> ->] <- _ tiHK].
(* 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)) (@gval gT H)))) (@indexg gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) (@gval gT K)) *)
by rewrite indexMg -indexgI setIC tiHK indexg1.
Qed.
Lemma index_sdprodr G A B M :
A ><| B = G -> M \subset B -> #|B : M| = #|G : A <*> M|.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT M))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))), @eq nat (@indexg gT B (@gval gT M)) (@indexg gT (@gval gT G) (@joing gT A (@gval gT M))) *)
move=> defG; case/sdprodP: defG (defG) => [[K H -> ->] mulKH nKH _] defG sMH.
(* Goal: @eq nat (@indexg gT (@gval gT H) (@gval gT M)) (@indexg gT (@gval gT G) (@joing gT (@gval gT K) (@gval gT M))) *)
rewrite -!divgS //=; last by rewrite -genM_join gen_subG -mulKH mulgS.
(* Goal: @eq nat (divn (@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)))) (@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 M))))) (divn (@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)) (@joing gT (@gval gT K) (@gval gT M)))))) *)
by rewrite -(sdprod_card defG) -(sdprod_card (sdprod_subr defG sMH)) divnMl.
Qed.
Lemma quotient_sdprodr_isom G A B M :
A ><| B = G -> M <| B ->
{f : {morphism B / M >-> coset_of (A <*> M)} |
isom (B / M) (G / (A <*> M)) f
& forall L, L \subset B -> f @* (L / M) = A <*> L / (A <*> M)}.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G)) (_ : is_true (@normal gT (@gval gT M) B)), @sig2 (@morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M))))) (fun f : @morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M)))) => is_true (@isom (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (@quotient gT (@gval gT G) (@joing gT A (@gval gT M))) (@mfun (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f))) (fun f : @morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M)))) => forall (L : @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 L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))), @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@joing gT A (@gval gT M))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@joing gT A (@gval gT M)))))))) (@morphim (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f (@MorPhantom (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@mfun (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f)) (@quotient gT (@gval gT L) (@gval gT M))) (@quotient gT (@joing gT A (@gval gT L)) (@joing gT A (@gval gT M)))) *)
move=> defG nsMH; have [defA defB]: A = <<A>>%G /\ B = <<B>>%G.
(* Goal: @sig2 (@morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M))))) (fun f : @morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M)))) => is_true (@isom (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (@quotient gT (@gval gT G) (@joing gT A (@gval gT M))) (@mfun (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f))) (fun f : @morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M)))) => forall (L : @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 L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))), @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@joing gT A (@gval gT M))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@joing gT A (@gval gT M)))))))) (@morphim (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f (@MorPhantom (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@mfun (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f)) (@quotient gT (@gval gT L) (@gval gT M))) (@quotient gT (@joing gT A (@gval gT L)) (@joing gT A (@gval gT M)))) *)
(* Goal: and (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) A (@gval gT (@generated_group gT A))) (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) B (@gval gT (@generated_group gT B))) *)
by have [[K1 H1 -> ->] _ _ _] := sdprodP defG; rewrite /= !genGid.
(* Goal: @sig2 (@morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M))))) (fun f : @morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M)))) => is_true (@isom (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (@quotient gT (@gval gT G) (@joing gT A (@gval gT M))) (@mfun (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f))) (fun f : @morphism_for (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (Phant (@coset_of gT (@joing gT A (@gval gT M)))) => forall (L : @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 L))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)))), @eq (@set_of (FinGroup.finType (FinGroup.base (@coset_groupType gT (@joing gT A (@gval gT M))))) (Phant (Finite.sort (FinGroup.finType (FinGroup.base (@coset_groupType gT (@joing gT A (@gval gT M)))))))) (@morphim (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f (@MorPhantom (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@mfun (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) f)) (@quotient gT (@gval gT L) (@gval gT M))) (@quotient gT (@joing gT A (@gval gT L)) (@joing gT A (@gval gT M)))) *)
do [rewrite {}defA {}defB; move: {A}<<A>>%G {B}<<B>>%G => K H] in defG nsMH *.
have [[nKH /isomP[injKH imKH]] sMH] := (sdprod_isom defG, normal_sub nsMH).
have [[nsKG sHG mulKH _ _] nKM] := (sdprod_context defG, subset_trans sMH nKH).
have nsKMG: K <*> M <| G.
by rewrite -quotientYK // -mulKH -quotientK ?cosetpre_normal ?quotient_normal.
have [/= f inj_f im_f] := third_isom (joing_subl K M) nsKG nsKMG.
rewrite quotientYidl //= -imKH -(restrm_quotientE nKH sMH) in f inj_f im_f.
have /domP[h [_ ker_h _ im_h]]: 'dom (f \o quotm _ nsMH) = H / M.
by rewrite ['dom _]morphpre_quotm injmK.
have{im_h} im_h L: L \subset H -> h @* (L / M) = K <*> L / (K <*> M).
move=> sLH; have [sLG sKKM] := (subset_trans sLH sHG, joing_subl K M).
rewrite im_h morphim_comp morphim_quotm [_ @* L]restrm_quotientE ?im_f //.
rewrite quotientY ?(normsG sKKM) ?(subset_trans sLG) ?normal_norm //.
by rewrite (quotientS1 sKKM) joing1G.
exists h => //; apply/isomP; split; last by rewrite im_h //= (sdprodWY defG).
by rewrite ker_h injm_comp ?injm_quotm.
Qed.
Qed.
Lemma quotient_sdprodr_isog G A B M :
A ><| B = G -> M <| B -> B / M \isog G / (A <*> M).
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G)) (_ : is_true (@normal gT (@gval gT M) B)), is_true (@isog (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT A (@gval gT M))) (@quotient gT B (@gval gT M)) (@quotient gT (@gval gT G) (@joing gT A (@gval gT M)))) *)
move=> defG; case/sdprodP: defG (defG) => [[K H -> ->] _ _ _] => defG nsMH.
(* Goal: is_true (@isog (@coset_groupType gT (@gval gT M)) (@coset_groupType gT (@joing gT (@gval gT K) (@gval gT M))) (@quotient gT (@gval gT H) (@gval gT M)) (@quotient gT (@gval gT G) (@joing gT (@gval gT K) (@gval gT M)))) *)
by have [h /isom_isog->] := quotient_sdprodr_isom defG nsMH.
Qed.
Lemma sdprod_modl A B G H :
A ><| B = G -> A \subset H -> A ><| (B :&: H) = G :&: H.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) 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.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *)
case/sdprodP=> {A B} [[A B -> ->]] <- nAB tiAB sAH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT A) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT B) (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT A) (@gval gT B)) (@gval gT H)) *)
rewrite -group_modl ?sdprodE ?subIset ?nAB //.
(* 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 A) (@gval gT (@setI_group gT B H))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *)
by rewrite setIA tiAB (setIidPl _) ?sub1G.
Qed.
Lemma sdprod_modr A B G H :
A ><| B = G -> B \subset H -> (H :&: A) ><| B = H :&: G.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) A) B) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) *)
case/sdprodP=> {A B}[[A B -> ->]] <- nAB tiAB sAH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT A)) (@gval gT B)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT A) (@gval gT B))) *)
rewrite -group_modr ?sdprodE ?normsI // ?normsG //.
(* 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 (@setI_group gT H A)) (@gval gT B)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *)
by rewrite -setIA tiAB (setIidPr _) ?sub1G.
Qed.
Lemma subcent_sdprod B C G A :
B ><| C = G -> A \subset 'N(B) :&: 'N(C) -> 'C_B(A) ><| 'C_C(A) = 'C_G(A).
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT B C) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT B) (@normaliser gT C)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@centraliser gT A)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) C (@centraliser gT A))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT A)) *)
case/sdprodP=> [[H K -> ->] <- nHK tiHK] nHKA {B C G}.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@centraliser gT A)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@centraliser gT A))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@centraliser gT A)) *)
rewrite sdprodE ?subcent_TImulg ?normsIG //.
(* 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 (@setI_group gT H (@centraliser_group gT A))) (@gval gT (@setI_group gT K (@centraliser_group gT A)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *)
by rewrite -setIIl tiHK (setIidPl (sub1G _)).
Qed.
Lemma sdprod_recl n G K H K1 :
#|G| <= n -> K ><| H = G -> K1 \proper K -> H \subset 'N(K1) ->
exists G1 : {group gT}, [/\ #|G1| < n, G1 \subset G & K1 ><| H = G1].
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)))) n)) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : 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 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)) (@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)) (@normaliser gT (@gval gT K1)))))), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G1 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G1))))) 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)) (@gval gT G1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))) (semidirect_product gT (@gval gT K1) (@gval gT H)) (@gval gT G1))) *)
move=> leGn; case/sdprodP=> _ defG nKH tiKH ltK1K nK1H.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G1 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G1))))) 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)) (@gval gT G1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))) (semidirect_product gT (@gval gT K1) (@gval gT H)) (@gval gT G1))) *)
have tiK1H: K1 :&: H = 1 by apply/trivgP; rewrite -tiKH setSI ?proper_sub.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G1 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G1))))) 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)) (@gval gT G1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))) (semidirect_product gT (@gval gT K1) (@gval gT H)) (@gval gT G1))) *)
exists (K1 <*> H)%G; rewrite /= -defG sdprodE // norm_joinEr //.
(* Goal: and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K1) (@gval gT H)))))) n)) (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)) (@gval gT K1) (@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 K) (@gval gT H)))))) (@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 K1) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K1) (@gval gT H))) *)
rewrite ?mulSg ?proper_sub ?(leq_trans _ leGn) //=.
(* Goal: is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K1) (@gval gT H)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *)
by rewrite -defG ?TI_cardMg // ltn_pmul2r ?proper_card.
Qed.
Lemma sdprod_recr n G K H H1 :
#|G| <= n -> K ><| H = G -> H1 \proper H ->
exists G1 : {group gT}, [/\ #|G1| < n, G1 \subset G & K ><| H1 = G1].
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)))) n)) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : 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 H1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))))), @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G1 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G1))))) 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)) (@gval gT G1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))) (semidirect_product gT (@gval gT K) (@gval gT H1)) (@gval gT G1))) *)
move=> leGn; case/sdprodP=> _ defG nKH tiKH ltH1H.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G1 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G1))))) 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)) (@gval gT G1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))) (semidirect_product gT (@gval gT K) (@gval gT H1)) (@gval gT G1))) *)
have [sH1H _] := andP ltH1H; have nKH1 := subset_trans sH1H nKH.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G1 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G1))))) 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)) (@gval gT G1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))) (semidirect_product gT (@gval gT K) (@gval gT H1)) (@gval gT G1))) *)
have tiKH1: K :&: H1 = 1 by apply/trivgP; rewrite -tiKH setIS.
(* Goal: @ex (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (fun G1 : @group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT))) => and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G1))))) 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)) (@gval gT G1))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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)))) (semidirect_product gT (@gval gT K) (@gval gT H1)) (@gval gT G1))) *)
exists (K <*> H1)%G; rewrite /= -defG sdprodE // norm_joinEr //.
(* Goal: and3 (is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H1)))))) n)) (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)) (@gval gT K) (@gval gT H1)))) (@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 K) (@gval gT H)))))) (@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 K) (@gval gT H1)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H1))) *)
rewrite ?mulgS // ?(leq_trans _ leGn) //=.
(* Goal: is_true (leq (S (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H1)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))) *)
by rewrite -defG ?TI_cardMg // ltn_pmul2l ?proper_card.
Qed.
Lemma mem_sdprod G A B x : A ><| B = G -> x \in G ->
exists y, exists z,
[/\ y \in A, z \in B, x = y * z &
{in A & B, forall u t, x = u * t -> u = y /\ t = z}].
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT A B) (@gval gT G)) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => and4 (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)) A)))) (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)) B)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) y z)) (@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)) B)) (fun u t : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) u t), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z)) (inPhantom (forall (u t : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) u t)), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z)))))) *)
case/sdprodP=> [[K H -> ->{A B}] <- _ tiKH] /mulsgP[y z Ky Hz ->{x}].
(* Goal: @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun z0 : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => and4 (is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y0 (@mem (Finite.sort (FinGroup.arg_finType (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 (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) z0 (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) y z) (@mulg (FinGroup.base gT) y0 z0)) (@prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun u t : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) y z) (@mulg (FinGroup.base gT) u t), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y0) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z0)) (inPhantom (forall (u t : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) y z) (@mulg (FinGroup.base gT) u t)), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y0) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z0)))))) *)
exists y; exists z; split=> // u t Ku Ht eqyzut.
(* Goal: and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z) *)
move: (congr1 (divgr K H) eqyzut) (congr1 (remgr K H) eqyzut).
(* Goal: forall (_ : @eq (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) y z)) (@divgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) u t))) (_ : @eq (FinGroup.sort (FinGroup.base gT)) (@remgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) y z)) (@remgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) u t))), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z) *)
by rewrite !remgrMid // !divgrMid.
Qed.
Lemma cprod1g : left_id 1 cprod.
Proof.
(* Goal: @left_id (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT) *)
by move=> A; rewrite /cprod cents1 pprod1g.
Qed.
Lemma cprodg1 : right_id 1 cprod.
Proof.
(* Goal: @right_id (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT) *)
by move=> A; rewrite /cprod sub1G pprodg1.
Qed.
Lemma cprodP A B G :
A \* B = G -> [/\ are_groups A B, A * B = G & B \subset 'C(A)].
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), and3 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT A))))) *)
by rewrite /cprod; case: ifP => [cAB /pprodP[] | _ /group_not0[]].
Qed.
Lemma cprodE G H : H \subset 'C(G) -> G \* H = G * H.
Lemma cprodEY 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 (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT G) (@gval gT H)) (@joing gT (@gval gT G) (@gval gT H)) *)
by move=> cGH; rewrite cprodE ?cent_joinEr.
Qed.
Lemma cprodWpp A B G : A \* B = G -> pprod A B = 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)))) (partial_product gT A B) (@gval gT G) *)
by case/cprodP=> [[K H -> ->] <- /cents_norm/pprodE].
Qed.
Lemma cprodW A B G : A \* B = G -> A * B = 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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G) *)
by move/cprodWpp/pprodW.
Qed.
Lemma cprodWC A B G : A \* B = G -> B * A = 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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B A) (@gval gT G) *)
by move/cprodWpp/pprodWC.
Qed.
Lemma cprodWY A B G : A \* B = G -> A <*> B = 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 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A B) (@gval gT G) *)
by move/cprodWpp/pprodWY.
Qed.
Lemma cprodJ 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 (central_product gT A B) x) (central_product gT (@conjugate gT A x) (@conjugate gT B x)) *)
by rewrite /cprod centJ conjSg -pprodJ; case: ifP => _ //; apply: imset0.
Qed.
Lemma cprod_normal2 A B G : A \* B = G -> A <| G /\ B <| 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), and (is_true (@normal gT A (@gval gT G))) (is_true (@normal gT B (@gval gT G))) *)
case/cprodP=> [[K H -> ->] <- cKH]; rewrite -cent_joinEr //.
(* Goal: and (is_true (@normal gT (@gval gT K) (@joing gT (@gval gT K) (@gval gT H)))) (is_true (@normal gT (@gval gT H) (@joing gT (@gval gT K) (@gval gT H)))) *)
by rewrite normalYl normalYr !cents_norm // centsC.
Qed.
Lemma bigcprodW I (r : seq I) P F G :
\big[cprod/1]_(i <- r | P i) F i = G -> \prod_(i <- r | P i) F i = 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 (FinGroup.arg_sort (group_set_of_baseGroupType (FinGroup.base gT))) I i (@mulg (group_set_of_baseGroupType (FinGroup.base gT))) (P i) (F i))) (@gval gT G) *)
elim/big_rec2: _ G => // i A B _ IH G /cprodP[[_ H _ defB] <- _].
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (F i) A) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (F i) B) *)
by rewrite (IH H) defB.
Qed.
Lemma bigcprodWY I (r : seq I) P F G :
\big[cprod/1]_(i <- r | P i) F i = G -> << \bigcup_(i <- r | P i) F i >> = 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 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) 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)))) (@gval gT G) *)
elim/big_rec2: _ G => [|i A B _ IH G]; first by rewrite gen0.
(* Goal: forall _ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT (F i) A) (@gval gT G), @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)) (F i) B)) (@gval gT G) *)
case/cprodP => [[K H -> defB] <- cKH].
(* Goal: @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)) (@gval gT K) B)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) A) *)
by rewrite -[<<_>>]joing_idr (IH H) ?cent_joinEr -?defB.
Qed.
Lemma triv_cprod A B : (A \* B == 1) = (A == 1) && (B == 1).
Proof.
(* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (central_product gT A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *)
case A1: (A == 1); first by rewrite (eqP A1) cprod1g.
(* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (central_product gT A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (andb false (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) *)
apply/eqP=> /cprodP[[G H defA ->]] /eqP.
(* Goal: forall (_ : is_true (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@gval gT H)) (@gval gT (one_group 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)) (@centraliser gT A))))), False *)
by rewrite defA trivMg -defA A1.
Qed.
Lemma cprod_ntriv A B : A != 1 -> B != 1 ->
A \* B =
if [&& group_set A, group_set B & B \subset 'C(A)] then A * B else set0.
Proof.
(* Goal: forall (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))) (_ : is_true (negb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A B) (if andb (@group_set gT A) (andb (@group_set 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
move=> A1 B1; rewrite /cprod; case: ifP => cAB; rewrite ?cAB ?andbF //=.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT A B) (if andb (@group_set gT A) (andb (@group_set gT B) true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite /pprod -if_neg A1 -if_neg B1 cents_norm.
Qed.
Lemma trivg0 : (@set0 gT == 1) = false.
Proof.
(* Goal: @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) false *)
by rewrite eqEcard cards0 cards1 andbF.
Qed.
Lemma group0 : group_set (@set0 gT) = false.
Proof.
(* Goal: @eq bool (@group_set gT (@set0 (FinGroup.arg_finType (FinGroup.base gT)))) false *)
by rewrite /group_set inE.
Qed.
Lemma cprod0g A : set0 \* A = set0.
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@set0 (FinGroup.arg_finType (FinGroup.base gT))) A) (@set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite /cprod centsC sub0set /pprod group0 trivg0 !if_same.
Qed.
Lemma cprodC : commutative cprod.
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 (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT) *)
rewrite /cprod => A B; case: ifP => cAB; rewrite centsC cAB // /pprod.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then B else if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then A else if andb (@group_set gT A) (andb (@group_set gT B) (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT A))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then A else if @eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) A (oneg (group_set_of_baseGroupType (FinGroup.base gT))) then B else if andb (@group_set gT B) (andb (@group_set 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)) (@normaliser gT B))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B A else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite andbCA normC !cents_norm // 1?centsC //; do 2!case: eqP => // ->.
Qed.
Lemma cprodA : associative cprod.
Proof.
(* Goal: @associative (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT) *)
move=> A B C; case A1: (A == 1); first by rewrite (eqP A1) !cprod1g.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A (central_product gT B C)) (central_product gT (central_product gT A B) C) *)
case B1: (B == 1); first by rewrite (eqP B1) cprod1g cprodg1.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A (central_product gT B C)) (central_product gT (central_product gT A B) C) *)
case C1: (C == 1); first by rewrite (eqP C1) !cprodg1.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A (central_product gT B C)) (central_product gT (central_product gT A B) C) *)
rewrite !(triv_cprod, cprod_ntriv) ?{}A1 ?{}B1 ?{}C1 //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb (@group_set gT A) (andb (@group_set gT (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (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)) (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb (@group_set gT A) (andb (@group_set 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (andb (@group_set gT 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)) 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 (if andb (@group_set gT A) (andb (@group_set 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb (@group_set gT A) (andb (@group_set 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case: isgroupP => [[G ->{A}] | _]; last by rewrite group0.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (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)) (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb (@group_set 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 (@gval gT G)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) B else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (andb (@group_set gT 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)) 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 (if andb true (andb (@group_set 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 (@gval gT G)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) B else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb (@group_set 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 (@gval gT G)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case: (isgroupP B) => [[H ->{B}] | _]; last by rewrite group0.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb (@group_set gT 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)) 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 (@gval gT H)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) C else @set0 (FinGroup.arg_finType (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)) (if andb true (andb (@group_set gT 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)) 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 (@gval gT H)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) C else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb (@group_set gT 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)) 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 (@gval gT H)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb 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)) (@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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (andb (@group_set gT 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)) 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 (if andb 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)) (@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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb 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)) (@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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case: (isgroupP C) => [[K ->{C}] | _]; last by rewrite group0 !andbF.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb 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)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT H)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb 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)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT H)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb 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)) (@gval gT K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT H)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb 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)) (@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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb 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)) (@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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb 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)) (@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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case cGH: (H \subset 'C(G)); case cHK: (K \subset 'C(H)); last first.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
-
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite group0.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
-
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite group0 /= mulG_subG cGH andbF.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
-
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true false) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite group0 /= centM subsetI cHK !andbF.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb true (andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (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)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))))) (@mem (Finite.sort (FinGroup.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)))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))) (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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (if andb true (andb true true) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
rewrite /= mulgA mulG_subG centM subsetI cGH cHK andbT -(cent_joinEr cHK).
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if andb (@group_set gT (@joing gT (@gval gT H) (@gval gT K))) (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 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 (@centraliser_group gT (@gval gT G))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if andb (@group_set gT (@mulg (group_set_of_baseGroupType (FinGroup.base 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 K))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT G))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite -(cent_joinEr cGH) !groupP.
Qed.
Canonical cprod_law := Monoid.Law cprodA cprod1g cprodg1.
Canonical cprod_abelaw := Monoid.ComLaw cprodC.
Lemma cprod_modl A B G H :
A \* B = G -> A \subset H -> A \* (B :&: H) = G :&: H.
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)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_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.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *)
case/cprodP=> [[U V -> -> {A B}]] defG cUV sUH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT U) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT V) (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *)
by rewrite cprodE; [rewrite group_modl ?defG | rewrite subIset ?cUV].
Qed.
Lemma cprod_modr A B G H :
A \* B = G -> B \subset H -> (H :&: A) \* B = H :&: 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)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) A) B) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) *)
by rewrite -!(cprodC B) !(setIC H); apply: cprod_modl.
Qed.
Lemma bigcprodYP (I : finType) (P : pred I) (H : I -> {group gT}) :
reflect (forall i j, P i -> P j -> i != j -> H i \subset 'C(H j))
(\big[cprod/1]_(i | P i) H i == (\prod_(i | P i) H i)%G).
Proof.
(* Goal: Bool.reflect (forall (i j : Finite.sort I) (_ : is_true (P i)) (_ : is_true (P j)) (_ : is_true (negb (@eq_op (Finite.eqType I) i j))), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (H 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)) (@centraliser gT (@gval gT (H j))))))) (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (P i) (@gval gT (H i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (H i))))) *)
apply: (iffP eqP) => [defG i j Pi Pj neq_ij | cHH].
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (P i) (@gval gT (H i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (H i)))) *)
(* 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 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)) (@centraliser gT (@gval gT (H j)))))) *)
rewrite (bigD1 j) // (bigD1 i) /= ?cprodA in defG; last exact/andP.
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (P i) (@gval gT (H i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (H i)))) *)
(* 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 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)) (@centraliser gT (@gval gT (H j)))))) *)
by case/cprodP: defG => [[K _ /cprodP[//]]].
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (P i) (@gval gT (H i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (H i)))) *)
set Q := P; have: subpred Q P by [].
(* Goal: forall _ : @subpred (Finite.sort I) Q P, @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (Q i) (@gval gT (H i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (Q i) (H i)))) *)
elim: {Q}_.+1 {-2}Q (ltnSn #|Q|) => // n IHn Q leQn sQP.
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (Q i) (@gval gT (H i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (Q i) (H i)))) *)
have [i Qi | Q0] := pickP Q; last by rewrite !big_pred0.
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (Q i) (@gval gT (H i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (Q i) (H i)))) *)
rewrite (cardD1x Qi) add1n ltnS !(bigD1 i Qi) /= in leQn *.
rewrite {}IHn {n leQn}// => [|j /andP[/sQP //]].
rewrite bigprodGE cprodEY // gen_subG; apply/bigcupsP=> j /andP[neq_ji Qj].
by rewrite cHH ?sQP.
Qed.
Qed.
Lemma bigcprodEY I r (P : pred I) (H : I -> {group gT}) G :
abelian G -> (forall i, P i -> H i \subset G) ->
\big[cprod/1]_(i <- r | P i) H i = (\prod_(i <- r | P i) H i)%G.
Proof.
(* Goal: forall (_ : is_true (@abelian gT (@gval gT G))) (_ : forall (i : I) (_ : is_true (P i)), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (H 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))))), @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) (@gval gT (H i)))) (@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) (H i)))) *)
move=> cGG sHG; apply/eqP; rewrite !(big_tnth _ _ r).
(* Goal: is_true (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort (ordinal_finType (@size I r))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum (ordinal_finType (@size I r))) (fun i : ordinal (@size I r) => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (ordinal (@size I r)) i (central_product gT) (P (@tuple.tnth (@size I r) I (@tuple.in_tuple I r) i)) (@gval gT (H (@tuple.tnth (@size I r) I (@tuple.in_tuple I r) i))))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort (ordinal_finType (@size I r))) (one_group gT) (index_enum (ordinal_finType (@size I r))) (fun i : ordinal (@size I r) => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (ordinal (@size I r)) i (@joinG gT) (P (@tuple.tnth (@size I r) I (@tuple.in_tuple I r) i)) (H (@tuple.tnth (@size I r) I (@tuple.in_tuple I r) i)))))) *)
by apply/bigcprodYP=> i j Pi Pj _; rewrite (sub_abelian_cent2 cGG) ?sHG.
Qed.
Lemma perm_bigcprod (I : eqType) r1 r2 (A : I -> {set gT}) G x :
\big[cprod/1]_(i <- r1) A i = G -> {in r1, forall i, x i \in A i} ->
perm_eq r1 r2 ->
\prod_(i <- r1) x i = \prod_(i <- r2) x i.
Proof.
(* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Equality.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r1 (fun i : Equality.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Equality.sort I) i (central_product gT) true (A i))) (@gval gT G)) (_ : @prop_in1 (Equality.sort I) (@mem (Equality.sort I) (seq_predType I) r1) (fun i : Equality.sort I => is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (A i))))) (inPhantom (forall i : Equality.sort I, is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (x i) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (A i))))))) (_ : is_true (@perm_eq I r1 r2)), @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r1 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
elim: r1 r2 G => [|i r1 IHr] r2 G defG Ax eq_r12.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@cons (Equality.sort I) i r1) (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@nil (Equality.sort I)) (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
by rewrite perm_eq_sym in eq_r12; rewrite (perm_eq_small _ eq_r12) ?big_nil.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@cons (Equality.sort I) i r1) (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
have /rot_to[n r3 Dr2]: i \in r2 by rewrite -(perm_eq_mem eq_r12) mem_head.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@cons (Equality.sort I) i r1) (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
transitivity (\prod_(j <- rot n r2) x j).
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@rot (Equality.sort I) n r2) (fun j : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) j (@mulg (FinGroup.base gT)) true (x j))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@cons (Equality.sort I) i r1) (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@rot (Equality.sort I) n r2) (fun j : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) j (@mulg (FinGroup.base gT)) true (x j))) *)
rewrite Dr2 !big_cons in defG Ax *; have [[_ G1 _ defG1] _ _] := cprodP defG.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@rot (Equality.sort I) n r2) (fun j : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) j (@mulg (FinGroup.base gT)) true (x j))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) (x i) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r1 (fun j : Equality.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) j (@mulg (FinGroup.base gT)) true (x j)))) (@mulg (FinGroup.base gT) (x i) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r3 (fun j : Equality.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) j (@mulg (FinGroup.base gT)) true (x j)))) *)
rewrite (IHr r3 G1) //; first by case/allP/andP: Ax => _ /allP.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@rot (Equality.sort I) n r2) (fun j : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) j (@mulg (FinGroup.base gT)) true (x j))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
(* Goal: is_true (@perm_eq I r1 r3) *)
by rewrite -(perm_cons i) -Dr2 perm_eq_sym perm_rot perm_eq_sym.
(* Goal: @eq (FinGroup.sort (FinGroup.base gT)) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) (@rot (Equality.sort I) n r2) (fun j : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) j (@mulg (FinGroup.base gT)) true (x j))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Equality.sort I) (oneg (FinGroup.base gT)) r2 (fun i : Equality.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Equality.sort I) i (@mulg (FinGroup.base gT)) true (x i))) *)
rewrite -{-2}(cat_take_drop n r2) in eq_r12 *.
rewrite (eq_big_perm _ eq_r12) !big_cat /= !(big_nth i) !big_mkord in defG *.
have /cprodP[[G1 G2 defG1 defG2] _ /centsP-> //] := defG.
rewrite defG2 -(bigcprodW defG2) mem_prodg // => k _; apply: Ax.
by rewrite (perm_eq_mem eq_r12) mem_cat orbC mem_nth.
rewrite defG1 -(bigcprodW defG1) mem_prodg // => k _; apply: Ax.
by rewrite (perm_eq_mem eq_r12) mem_cat mem_nth.
Qed.
Qed.
Lemma reindex_bigcprod (I J : finType) (h : J -> I) P (A : I -> {set gT}) G x :
{on SimplPred P, bijective h} -> \big[cprod/1]_(i | P i) A i = G ->
{in SimplPred P, forall i, x i \in A i} ->
\prod_(i | P i) x i = \prod_(j | P (h j)) x (h j).
Lemma dprod1g : left_id 1 dprod.
Proof.
(* Goal: @left_id (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT) *)
by move=> A; rewrite /dprod subsetIl cprod1g.
Qed.
Lemma dprodg1 : right_id 1 dprod.
Proof.
(* Goal: @right_id (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT) *)
by move=> A; rewrite /dprod subsetIr cprodg1.
Qed.
Lemma dprodP A B G :
A \x B = G -> [/\ are_groups A B, A * B = G, B \subset 'C(A) & A :&: B = 1].
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), and4 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT A))))) (@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)) A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *)
rewrite /dprod; case: ifP => trAB; last by case/group_not0.
(* 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), and4 (are_groups A B) (@eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G)) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) B)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT A))))) (@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)) A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) *)
by case/cprodP=> gAB; split=> //; case: gAB trAB => ? ? -> -> /trivgP.
Qed.
Lemma dprodE G H : H \subset 'C(G) -> G :&: H = 1 -> G \x 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))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT G) (@gval gT H)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *)
by move=> cGH trGH; rewrite /dprod trGH sub1G cprodE.
Qed.
Lemma dprodEY G H : H \subset 'C(G) -> G :&: H = 1 -> G \x 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))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT G) (@gval gT H)) (@joing gT (@gval gT G) (@gval gT H)) *)
by move=> cGH trGH; rewrite /dprod trGH subxx cprodEY.
Qed.
Lemma dprodEcp A B : A :&: B = 1 -> A \x B = A \* B.
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)) A B) (oneg (group_set_of_baseGroupType (FinGroup.base gT))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) (central_product gT A B) *)
by move=> trAB; rewrite /dprod trAB subxx.
Qed.
Lemma dprodEsd A B : B \subset 'C(A) -> A \x B = 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)) (@centraliser gT A)))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) (semidirect_product gT A B) *)
by rewrite /dprod /cprod => ->.
Qed.
Lemma dprodWcp A B G : A \x B = G -> A \* B = 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)))) (central_product gT A B) (@gval gT G) *)
by move=> defG; have [_ _ _ /dprodEcp <-] := dprodP defG.
Qed.
Lemma dprodWsd A B G : A \x B = G -> A ><| B = 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)))) (semidirect_product gT A B) (@gval gT G) *)
by move=> defG; have [_ _ /dprodEsd <-] := dprodP defG.
Qed.
Lemma dprodW A B G : A \x B = G -> A * B = 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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) (@gval gT G) *)
by move/dprodWsd/sdprodW.
Qed.
Lemma dprodWC A B G : A \x B = G -> B * A = 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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B A) (@gval gT G) *)
by move/dprodWsd/sdprodWC.
Qed.
Lemma dprodWY A B G : A \x B = G -> A <*> B = 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 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@joing gT A B) (@gval gT G) *)
by move/dprodWsd/sdprodWY.
Qed.
Lemma cprod_card_dprod G A B :
A \* B = G -> #|A| * #|B| <= #|G| -> A \x B = 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)) (_ : 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)) 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)) B)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A B) (@gval gT G) *)
by case/cprodP=> [[K H -> ->] <- cKH] /cardMg_TI; apply: dprodE.
Qed.
Lemma dprodJ A B x : (A \x B) :^ x = A :^ x \x B :^ x.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (direct_product gT A B) x) (direct_product gT (@conjugate gT A x) (@conjugate gT B x)) *)
rewrite /dprod -conjIg sub_conjg conjs1g -cprodJ.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@conjugate gT (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then central_product gT A B else @set0 (FinGroup.arg_finType (FinGroup.base gT))) x) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A 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)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))) then @conjugate gT (central_product gT A B) x else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by case: ifP => _ //; apply: imset0.
Qed.
Lemma dprod_normal2 A B G : A \x B = G -> A <| G /\ B <| 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), and (is_true (@normal gT A (@gval gT G))) (is_true (@normal gT B (@gval gT G))) *)
by move/dprodWcp/cprod_normal2.
Qed.
Lemma dprodYP K H : reflect (K \x H = K <*> H) (H \subset 'C(K) :\: K^#).
Proof.
(* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@joing gT (@gval gT K) (@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)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT K)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT K) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))))))) *)
rewrite subsetD -setI_eq0 setIDA setD_eq0 setIC subG1 /=.
(* Goal: Bool.reflect (@eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@joing gT (@gval gT K) (@gval gT H))) (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)) (@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)) (@centraliser gT (@gval gT K))))) (@eq_op (set_of_eqType (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))))) *)
by apply: (iffP andP) => [[cKH /eqP/dprodEY->] | /dprodP[_ _ -> ->]].
Qed.
Lemma dprodC : commutative dprod.
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 (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT) *)
by move=> A B; rewrite /dprod setIC cprodC.
Qed.
Lemma dprodWsdC A B G : A \x B = G -> B ><| A = 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)))) (semidirect_product gT B A) (@gval gT G) *)
by rewrite dprodC => /dprodWsd.
Qed.
Lemma dprodA : associative dprod.
Proof.
(* Goal: @associative (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT) *)
move=> A B C; case A1: (A == 1); first by rewrite (eqP A1) !dprod1g.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A (direct_product gT B C)) (direct_product gT (direct_product gT A B) C) *)
case B1: (B == 1); first by rewrite (eqP B1) dprod1g dprodg1.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A (direct_product gT B C)) (direct_product gT (direct_product gT A B) C) *)
case C1: (C == 1); first by rewrite (eqP C1) !dprodg1.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A (direct_product gT B C)) (direct_product gT (direct_product gT A B) C) *)
rewrite /dprod (fun_if (cprod A)) (fun_if (cprod^~ C)) -cprodA.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) B 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 (one_group gT)))) then central_product gT B C else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) B 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 (one_group gT)))) then central_product gT A (central_product gT B C) else central_product gT A (@set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then central_product gT A B else @set0 (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)) (@gval gT (one_group gT)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then central_product gT A (central_product gT B C) else central_product gT (@set0 (FinGroup.arg_finType (FinGroup.base gT))) C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
rewrite -(cprodC set0) !cprod0g cprod_ntriv ?B1 ?{}C1 //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) B 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 (one_group gT)))) then if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) B 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 (one_group gT)))) then central_product gT A (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then central_product gT A B else @set0 (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)) (@gval gT (one_group gT)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then central_product gT A (if andb (@group_set gT B) (andb (@group_set gT 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)) 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))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT))) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case: and3P B1 => [[] | _ _]; last by rewrite cprodC cprod0g !if_same.
(* Goal: forall (_ : is_true (@group_set gT B)) (_ : is_true (@group_set 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)) 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))))) (_ : @eq bool (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) B (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) false), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) B 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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) B 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 (one_group gT)))) then central_product gT A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then central_product gT A B else @set0 (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)) (@gval gT (one_group gT)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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)) (@gval gT (one_group gT)))) then central_product gT A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) B C) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case/isgroupP=> H ->; case/isgroupP=> K -> {B C}; move/cent_joinEr=> eHK H1.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then central_product gT A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base 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 (one_group gT)))) then central_product gT A (@gval gT H) else @set0 (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 (one_group gT)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base 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 (one_group gT)))) then central_product gT A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
rewrite cprod_ntriv ?trivMg ?{}A1 ?{}H1 // mulG_subG.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then if andb (@group_set gT A) (andb (@group_set gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@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 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 (@centraliser_group 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)) (@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 (@centraliser_group gT A))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base 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 (one_group gT)))) then central_product gT A (@gval gT H) else @set0 (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 (one_group gT)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base 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 (one_group gT)))) then if andb (@group_set gT A) (andb (@group_set gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@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 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 (@centraliser_group 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)) (@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 (@centraliser_group gT A))))))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case: and4P => [[] | _]; last by rewrite !if_same.
(* Goal: forall (_ : is_true (@group_set gT A)) (_ : is_true (@group_set gT (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@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 (@centraliser_group 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 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 (@centraliser_group gT A)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) A (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base 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 (one_group gT)))) then central_product gT A (@gval gT H) else @set0 (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 (one_group gT)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base 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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) A (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case/isgroupP=> G ->{A} _ cGH _; rewrite cprodEY // -eHK.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then @joing gT (@gval gT H) (@gval gT K) else @set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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 (one_group gT)))) then @joing gT (@gval gT G) (@gval gT H) else @set0 (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 (one_group gT)))) then if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
case trGH: (G :&: H \subset _); case trHK: (H :&: K \subset _); last first.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@set0 (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 (one_group gT)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@set0 (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 (one_group gT)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
-
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@set0 (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 (one_group gT)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@set0 (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 (one_group gT)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
by rewrite !if_same.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@set0 (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 (one_group gT)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
-
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@set0 (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 (one_group gT)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
rewrite if_same; case: ifP => // trG_HK; case/negP: trGH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (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)) (@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 (one_group gT))))) *)
by apply: subset_trans trG_HK; rewrite setIS ?joing_subl.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
-
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@set0 (FinGroup.arg_finType (FinGroup.base gT)))))) (@mem (Finite.sort (FinGroup.arg_finType (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)))) then @set0 (FinGroup.arg_finType (FinGroup.base gT)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
rewrite if_same; case: ifP => // trGH_K; case/negP: trHK.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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 (one_group gT))))) *)
by apply: subset_trans trGH_K; rewrite setSI ?joing_subr.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT)))) then @mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@gval gT K)) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) *)
do 2![case: ifP] => // trGH_K trG_HK; [case/negP: trGH_K | case/negP: trG_HK].
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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 (one_group gT))))) *)
apply: subset_trans trHK; rewrite subsetI subsetIr -{2}(mulg1 H) -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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT))))) *)
(* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT G) (@gval gT H)) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))))) true) *)
rewrite setIC group_modl ?joing_subr //= cent_joinEr // -eHK.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT))))) *)
(* 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@joing gT (@gval gT H) (@gval gT K)) (@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 H) (oneg (group_set_of_baseGroupType (FinGroup.base gT))))))) true) *)
by rewrite -group_modr ?joing_subl //= setIC -(normC (sub1G _)) 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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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 (one_group gT))))) *)
apply: subset_trans trGH; rewrite subsetI subsetIl -{2}(mul1g H) -mulSG.
(* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@joing gT (@gval gT H) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT H)))))) *)
rewrite setIC group_modr ?joing_subl //= eHK -(cent_joinEr cGH).
(* 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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)) (@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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (@gval gT H))))) *)
by rewrite -group_modl ?joing_subr //= setIC (normC (sub1G _)) mulgS.
Qed.
Canonical dprod_law := Monoid.Law dprodA dprod1g dprodg1.
Canonical dprod_abelaw := Monoid.ComLaw dprodC.
Lemma bigdprodWcp I (r : seq I) P F G :
\big[dprod/1]_(i <- r | P i) F i = G -> \big[cprod/1]_(i <- r | P i) F i = 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 (central_product gT) (P i) (F i))) (@gval gT G) *)
elim/big_rec2: _ G => // i A B _ IH G /dprodP[[K H -> defB] <- cKH _].
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT (@gval gT K) A) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) B) *)
by rewrite (IH H) // cprodE -defB.
Qed.
Lemma bigdprodW I (r : seq I) P F G :
\big[dprod/1]_(i <- r | P i) F i = G -> \prod_(i <- r | P i) F i = 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 (FinGroup.arg_sort (group_set_of_baseGroupType (FinGroup.base gT))) I i (@mulg (group_set_of_baseGroupType (FinGroup.base gT))) (P i) (F i))) (@gval gT G) *)
by move/bigdprodWcp; apply: bigcprodW.
Qed.
Lemma bigdprodWY I (r : seq I) P F G :
\big[dprod/1]_(i <- r | P i) F i = G -> << \bigcup_(i <- r | P i) F i >> = 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 (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@generated gT (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) 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)))) (@gval gT G) *)
by move/bigdprodWcp; apply: bigcprodWY.
Qed.
Lemma bigdprodYP (I : finType) (P : pred I) (F : I -> {group gT}) :
reflect (forall i, P i ->
(\prod_(j | P j && (j != i)) F j)%G \subset 'C(F i) :\: (F i)^#)
(\big[dprod/1]_(i | P i) F i == (\prod_(i | P i) F i)%G).
Proof.
(* Goal: Bool.reflect (forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun j : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) j (@joinG gT) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (F j)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (F i))) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (F i)) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT))))))))) (@eq_op (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (P i) (@gval gT (F i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (F i))))) *)
apply: (iffP eqP) => [defG i Pi | dxG].
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (P i) (@gval gT (F i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (F i)))) *)
(* 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 (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun j : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) j (@joinG gT) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (F j)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (F i))) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (F i)) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))))))) *)
rewrite !(bigD1 i Pi) /= in defG; have [[_ G' _ defG'] _ _ _] := dprodP defG.
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (P i) (@gval gT (F i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (F i)))) *)
(* 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 (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun j : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) j (@joinG gT) (andb (P j) (negb (@eq_op (Finite.eqType I) j i))) (F j)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@centraliser gT (@gval gT (F i))) (@setD (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (F i)) (@set1 (FinGroup.finType (FinGroup.base gT)) (oneg (FinGroup.base gT)))))))) *)
by apply/dprodYP; rewrite -defG defG' bigprodGE (bigdprodWY defG').
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (P i) (@gval gT (F i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (P i) (F i)))) *)
set Q := P; have: subpred Q P by [].
(* Goal: forall _ : @subpred (Finite.sort I) Q P, @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (Q i) (@gval gT (F i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (Q i) (F i)))) *)
elim: {Q}_.+1 {-2}Q (ltnSn #|Q|) => // n IHn Q leQn sQP.
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (Q i) (@gval gT (F i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (Q i) (F i)))) *)
have [i Qi | Q0] := pickP Q; last by rewrite !big_pred0.
(* Goal: @eq (Equality.sort (FinGroup.eqType (group_set_of_baseGroupType (FinGroup.base gT)))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (Q i) (@gval gT (F i)))) (@gval gT (@BigOp.bigop (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) (one_group gT) (index_enum I) (fun i : Finite.sort I => @BigBody (@group_of gT (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (@joinG gT) (Q i) (F i)))) *)
rewrite (cardD1x Qi) add1n ltnS !(bigD1 i Qi) /= in leQn *.
rewrite {}IHn {n leQn}// => [|j /andP[/sQP //]].
apply/dprodYP; apply: subset_trans (dxG i (sQP i Qi)); rewrite !bigprodGE.
by apply: genS; apply/bigcupsP=> j /andP[Qj ne_ji]; rewrite (bigcup_max j) ?sQP.
Qed.
Qed.
Lemma dprod_modl A B G H :
A \x B = G -> A \subset H -> A \x (B :&: H) = G :&: H.
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)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_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.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT A (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *)
case/dprodP=> [[U V -> -> {A B}]] defG cUV trUV sUH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT U) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT V) (@gval gT H))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@gval gT H)) *)
rewrite dprodEcp; first by apply: cprod_modl; rewrite ?cprodE.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT U) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT V) (@gval gT H))) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) *)
by rewrite setIA trUV (setIidPl _) ?sub1G.
Qed.
Lemma dprod_modr A B G H :
A \x B = G -> B \subset H -> (H :&: A) \x B = H :&: 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)) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.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 H))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) A) B) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT G)) *)
by rewrite -!(dprodC B) !(setIC H); apply: dprod_modl.
Qed.
Lemma subcent_dprod B C G A :
B \x C = G -> A \subset 'N(B) :&: 'N(C) -> 'C_B(A) \x 'C_C(A) = 'C_G(A).
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT B C) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT B) (@normaliser gT C)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@centraliser gT A)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) C (@centraliser gT A))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT A)) *)
move=> defG; have [_ _ cBC _] := dprodP defG; move: defG.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT B C) (@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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@normaliser gT B) (@normaliser gT C)))))), @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@setI (FinGroup.arg_finType (FinGroup.base gT)) B (@centraliser gT A)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) C (@centraliser gT A))) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G) (@centraliser gT A)) *)
by rewrite !dprodEsd 1?(centSS _ _ cBC) ?subsetIl //; apply: subcent_sdprod.
Qed.
Lemma dprod_card A B G : A \x B = G -> (#|A| * #|B|)%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 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)) 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)) B)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
by case/dprodP=> [[H K -> ->] <- _]; move/TI_cardMg.
Qed.
Lemma bigdprod_card I r (P : pred I) E G :
\big[dprod/1]_(i <- r | P i) E i = G ->
(\prod_(i <- r | P i) #|E i|)%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) (E i))) (@gval gT G), @eq nat (@BigOp.bigop nat I (S O) r (fun i : I => @BigBody nat I i muln (P i) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (E i)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
elim/big_rec2: _ G => [G <- | i A B _ IH G defG]; first by rewrite cards1.
(* 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)) (E i)))) B) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
have [[_ H _ defH] _ _ _] := dprodP defG.
(* Goal: @eq nat (muln (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (E i)))) B) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
by rewrite -(dprod_card defG) (IH H) defH.
Qed.
Lemma bigcprod_card_dprod I r (P : pred I) (A : I -> {set gT}) G :
\big[cprod/1]_(i <- r | P i) A i = G ->
\prod_(i <- r | P i) #|A i| <= #|G| ->
\big[dprod/1]_(i <- r | P i) A i = 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) (A i))) (@gval gT G)) (_ : is_true (leq (@BigOp.bigop nat I (S O) r (fun i : I => @BigBody nat I i muln (P i) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (A i)))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT 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) (A i))) (@gval gT G) *)
elim: r G => [|i r IHr]; rewrite !(big_nil, big_cons) //; case: ifP => _ // G.
(* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (central_product gT (A i) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I j (central_product gT) (P j) (A j)))) (@gval gT G)) (_ : 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)) (A i)))) (@BigOp.bigop nat I (S O) r (fun j : I => @BigBody nat I j muln (P j) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (A j))))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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))) (direct_product gT (A i) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I j (direct_product gT) (P j) (A j)))) (@gval gT G) *)
case/cprodP=> [[K H -> defH]]; rewrite defH => <- cKH leKH_G.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT (@gval gT K) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I j (direct_product gT) (P j) (A j)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) *)
have /implyP := leq_trans leKH_G (dvdn_leq _ (dvdn_cardMg K H)).
(* Goal: forall _ : is_true (implb (leq (S O) (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)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))))) (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 K)))) (@BigOp.bigop nat I (S O) r (fun j : I => @BigBody nat I j muln (P j) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (A j))))))) (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)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT (@gval gT K) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) I j (direct_product gT) (P j) (A j)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) *)
rewrite muln_gt0 leq_pmul2l !cardG_gt0 //= => /(IHr H defH){defH}defH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@BigOp.bigop (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) I j (direct_product gT) (P j) (A j)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT K) (@gval gT H)) *)
by rewrite defH dprodE // cardMg_TI // -(bigdprod_card defH).
Qed.
Lemma bigcprod_coprime_dprod (I : finType) (P : pred I) (A : I -> {set gT}) G :
\big[cprod/1]_(i | P i) A i = G ->
(forall i j, P i -> P j -> i != j -> coprime #|A i| #|A j|) ->
\big[dprod/1]_(i | P i) A i = 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))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (central_product gT) (P i) (A i))) (@gval gT G)) (_ : forall (i j : Finite.sort I) (_ : is_true (P i)) (_ : is_true (P j)) (_ : is_true (negb (@eq_op (Finite.eqType I) i j))), 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)) (A i)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (A j)))))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (P i) (A i))) (@gval gT G) *)
move=> defG coA; set Q := P in defG *; have: subpred Q P by [].
(* Goal: forall _ : @subpred (Finite.sort I) Q P, @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (Q i) (A i))) (@gval gT G) *)
elim: {Q}_.+1 {-2}Q (ltnSn #|Q|) => // m IHm Q leQm in G defG * => sQP.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (Q i) (A i))) (@gval gT G) *)
have [i Qi | Q0] := pickP Q; last by rewrite !big_pred0 in defG *.
move: defG; rewrite !(bigD1 i Qi) /= => /cprodP[[Hi Gi defAi defGi] <-].
rewrite defAi defGi => cHGi.
have{defGi} defGi: \big[dprod/1]_(j | Q j && (j != i)) A j = Gi.
by apply: IHm => [||j /andP[/sQP]] //; rewrite (cardD1x Qi) in leQm.
rewrite defGi dprodE // coprime_TIg // -defAi -(bigdprod_card defGi).
elim/big_rec: _ => [|j n /andP[neq_ji Qj] IHn]; first exact: coprimen1.
by rewrite coprime_mulr coprime_sym coA ?sQP.
Qed.
Qed.
Lemma mem_dprod G A B x : A \x B = G -> x \in G ->
exists y, exists z,
[/\ y \in A, z \in B, x = y * z &
{in A & B, forall u t, x = u * t -> u = y /\ t = z}].
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)) (_ : 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))))), @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => and4 (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)) A)))) (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)) B)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) y z)) (@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)) B)) (fun u t : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) u t), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z)) (inPhantom (forall (u t : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) u t)), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z)))))) *)
move=> defG; have [_ _ cBA _] := dprodP defG.
(* 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)))), @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun y : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @ex (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun z : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => and4 (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)) A)))) (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)) B)))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) y z)) (@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)) B)) (fun u t : FinGroup.arg_sort (FinGroup.base gT) => forall _ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) u t), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z)) (inPhantom (forall (u t : FinGroup.arg_sort (FinGroup.base gT)) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mulg (FinGroup.base gT) u t)), and (@eq (FinGroup.arg_sort (FinGroup.base gT)) u y) (@eq (FinGroup.arg_sort (FinGroup.base gT)) t z)))))) *)
by apply: mem_sdprod; rewrite -dprodEsd.
Qed.
Lemma mem_bigdprod (I : finType) (P : pred I) F G x :
\big[dprod/1]_(i | P i) F i = G -> x \in G ->
exists c, [/\ forall i, P i -> c i \in F i, x = \prod_(i | P i) c i
& forall e, (forall i, P i -> e i \in F i) ->
x = \prod_(i | P i) e i ->
forall i, P i -> e i = c i].
Proof.
(* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (P i) (F i))) (@gval gT G)) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))))), @ex (forall _ : Finite.sort I, Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun c : forall _ : Finite.sort I, Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => and3 (forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (c 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)) (F i))))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (c i)))) (forall (e : forall _ : Finite.sort I, Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (_ : forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e 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)) (F i))))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) x (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (e i)))) (i : Finite.sort I) (_ : is_true (P i)), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i))) *)
move=> defG; rewrite -(bigdprodW defG) => /prodsgP[c Fc ->].
(* Goal: @ex (forall _ : Finite.sort I, Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (fun c0 : forall _ : Finite.sort I, Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => and3 (forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (c0 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)) (F i))))) (@eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (c i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (c0 i)))) (forall (e : forall _ : Finite.sort I, Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (_ : forall (i : Finite.sort I) (_ : is_true (P i)), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e 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)) (F i))))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (c i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) (index_enum I) (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (e i)))) (i : Finite.sort I) (_ : is_true (P i)), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c0 i))) *)
exists c; split=> // e Fe eq_ce i Pi.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i) *)
set r := index_enum _ in defG eq_ce.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i) *)
have: i \in r by rewrite -[r]enumT mem_enum.
(* Goal: forall _ : is_true (@in_mem (Finite.sort I) i (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) r)), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i) *)
elim: r G defG eq_ce => // j r IHr G; rewrite !big_cons inE.
(* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (if P j then direct_product gT (F j) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) j (direct_product gT) (P j) (F j))) else @BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) j (direct_product gT) (P j) (F j))) (@gval gT G)) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (if P j then @mulg (FinGroup.base gT) (c j) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (c j))) else @BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (c j))) (if P j then @mulg (FinGroup.base gT) (e j) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (e j))) else @BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (e j)))) (_ : is_true (orb (@eq_op (Finite.eqType I) i j) (@in_mem (Equality.sort (Finite.eqType I)) i (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) r)))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i) *)
case Pj: (P j); last by case: eqP (IHr G) => // eq_ij; rewrite eq_ij Pj in Pi.
(* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (direct_product gT (F j) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) j (direct_product gT) (P j) (F j)))) (@gval gT G)) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) (c j) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (c j)))) (@mulg (FinGroup.base gT) (e j) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun j : Finite.sort I => @BigBody (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) j (@mulg (FinGroup.base gT)) (P j) (e j))))) (_ : is_true (orb (@eq_op (Finite.eqType I) i j) (@in_mem (Equality.sort (Finite.eqType I)) i (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) r)))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i) *)
case/dprodP=> [[K H defK defH] _ _]; rewrite defK defH => tiFjH eq_ce.
(* Goal: forall _ : is_true (orb (@eq_op (Finite.eqType I) i j) (@in_mem (Equality.sort (Finite.eqType I)) i (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) r))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i) *)
suffices{i Pi IHr} eq_cej: c j = e j.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (c j) (e j) *)
(* Goal: forall _ : is_true (orb (@eq_op (Finite.eqType I) i j) (@in_mem (Equality.sort (Finite.eqType I)) i (@mem (Equality.sort (Finite.eqType I)) (seq_predType (Finite.eqType I)) r))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (e i) (c i) *)
case/predU1P=> [-> //|]; apply: IHr defH _.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (c j) (e j) *)
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (c i))) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort I) (oneg (FinGroup.base gT)) r (fun i : Finite.sort I => @BigBody (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort I) i (@mulg (FinGroup.base gT)) (P i) (e i))) *)
by apply: (mulgI (c j)); rewrite eq_ce eq_cej.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (c j) (e j) *)
rewrite !(big_nth j) !big_mkord in defH eq_ce.
(* Goal: @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (c j) (e j) *)
move/(congr1 (divgr K H)) : eq_ce; move/bigdprodW: defH => defH.
(* Goal: forall _ : @eq (FinGroup.sort (FinGroup.base gT)) (@divgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) (c j) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort (ordinal_finType (@size (Finite.sort I) r))) (oneg (FinGroup.base gT)) (index_enum (ordinal_finType (@size (Finite.sort I) r))) (fun i : ordinal (@size (Finite.sort I) r) => @BigBody (FinGroup.sort (FinGroup.base gT)) (ordinal (@size (Finite.sort I) r)) i (@mulg (FinGroup.base gT)) (P (@nth (Finite.sort I) j r (@nat_of_ord (@size (Finite.sort I) r) i))) (c (@nth (Finite.sort I) j r (@nat_of_ord (@size (Finite.sort I) r) i))))))) (@divgr gT (@gval gT K) (@gval gT H) (@mulg (FinGroup.base gT) (e j) (@BigOp.bigop (FinGroup.sort (FinGroup.base gT)) (Finite.sort (ordinal_finType (@size (Finite.sort I) r))) (oneg (FinGroup.base gT)) (index_enum (ordinal_finType (@size (Finite.sort I) r))) (fun i : ordinal (@size (Finite.sort I) r) => @BigBody (FinGroup.sort (FinGroup.base gT)) (ordinal (@size (Finite.sort I) r)) i (@mulg (FinGroup.base gT)) (P (@nth (Finite.sort I) j r (@nat_of_ord (@size (Finite.sort I) r) i))) (e (@nth (Finite.sort I) j r (@nat_of_ord (@size (Finite.sort I) r) i))))))), @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (c j) (e j) *)
by rewrite !divgrMid // -?defK -?defH ?mem_prodg // => *; rewrite ?Fc ?Fe.
Qed.
End InternalProd.
Arguments complP {gT H A B}.
Arguments splitsP {gT B A}.
Arguments sdprod_normal_complP {gT G K H}.
Arguments dprodYP {gT K H}.
Arguments bigdprodYP {gT I P F}.
Section MorphimInternalProd.
Variables (gT rT : finGroupType) (D : {group gT}) (f : {morphism D >-> rT}).
Section OneProd.
Variables G H K : {group gT}.
Hypothesis sGD : G \subset D.
Lemma morphim_pprod : pprod K H = G -> pprod (f @* K) (f @* H) = f @* G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT (@gval gT K) (@gval gT H)) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (partial_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
case/pprodP=> _ defG mKH; rewrite pprodE ?morphim_norms //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) K)) (@gval rT (@morphim_group gT rT D f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite -morphimMl ?(subset_trans _ sGD) -?defG // mulG_subl.
Qed.
Lemma morphim_coprime_sdprod :
K ><| H = G -> coprime #|K| #|H| -> f @* K ><| f @* H = f @* G.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : 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 K)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (semidirect_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
rewrite /sdprod => defG coHK; move: defG.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (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 (one_group gT)))) then partial_product gT (@gval gT K) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (if @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)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (one_group rT)))) then partial_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H)) else @set0 (FinGroup.arg_finType (FinGroup.base rT))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite !coprime_TIg ?coprime_morph // !subxx; apply: morphim_pprod.
Qed.
Lemma injm_sdprod : 'injm f -> K ><| H = G -> f @* K ><| f @* H = f @* G.
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (semidirect_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
move=> inj_f; case/sdprodP=> _ defG nKH tiKH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (semidirect_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite /sdprod -injmI // tiKH morphim1 subxx morphim_pprod // pprodE.
Qed.
Lemma morphim_cprod : K \* H = G -> f @* K \* f @* H = f @* G.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT K) (@gval gT H)) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (central_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
case/cprodP=> _ defG cKH; rewrite /cprod morphim_cents // morphim_pprod //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT (@gval gT K) (@gval gT H)) (@gval gT G) *)
by rewrite pprodE // cents_norm // centsC.
Qed.
Lemma injm_dprod : 'injm f -> K \x H = G -> f @* K \x f @* H = f @* G.
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@gval gT G)), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
move=> inj_f; case/dprodP=> _ defG cHK tiKH.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite /dprod -injmI // tiKH morphim1 subxx morphim_cprod // cprodE.
Qed.
Lemma morphim_coprime_dprod :
K \x H = G -> coprime #|K| #|H| -> f @* K \x f @* H = f @* G.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : 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 K)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
rewrite /dprod => defG coHK; move: defG.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (if @subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@setI (FinGroup.arg_finType (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 (one_group gT)))) then central_product gT (@gval gT K) (@gval gT H) else @set0 (FinGroup.arg_finType (FinGroup.base gT))) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (if @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)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT (one_group rT)))) then central_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT K)) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT H)) else @set0 (FinGroup.arg_finType (FinGroup.base rT))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite !coprime_TIg ?coprime_morph // !subxx; apply: morphim_cprod.
Qed.
End OneProd.
Implicit Type G : {group gT}.
Lemma morphim_bigcprod I r (P : pred I) (H : I -> {group gT}) G :
G \subset D -> \big[cprod/1]_(i <- r | P i) H i = G ->
\big[cprod/1]_(i <- r | P i) f @* H i = f @* G.
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (_ : @eq (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) (@gval gT (H i)))) (@gval gT G)), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) I (oneg (group_set_of_baseGroupType (FinGroup.base rT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) I i (central_product rT) (P i) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
elim/big_rec2: _ G => [|i fB B Pi def_fB] G sGD defG.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (central_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))) fB) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite -defG morphim1.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (central_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))) fB) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
case/cprodP: defG (defG) => [[Hi Gi -> defB] _ _]; rewrite defB => defG.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (central_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT Hi)) fB) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
rewrite (def_fB Gi) //; first exact: morphim_cprod.
(* 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 Gi))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D)))) *)
by apply: subset_trans sGD; case/cprod_normal2: defG => _ /andP[].
Qed.
Lemma injm_bigdprod I r (P : pred I) (H : I -> {group gT}) G :
G \subset D -> 'injm f -> \big[dprod/1]_(i <- r | P i) H i = G ->
\big[dprod/1]_(i <- r | P i) f @* H i = f @* G.
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (_ : @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) (@gval gT (H i)))) (@gval gT G)), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) I (oneg (group_set_of_baseGroupType (FinGroup.base rT))) r (fun i : I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) I i (direct_product rT) (P i) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
move=> sGD injf; elim/big_rec2: _ G sGD => [|i fB B Pi def_fB] G sGD defG.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (direct_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))) fB) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by rewrite -defG morphim1.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (direct_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))) fB) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
case/dprodP: defG (defG) => [[Hi Gi -> defB] _ _ _]; rewrite defB => defG.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (direct_product rT (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT Hi)) fB) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
rewrite (def_fB Gi) //; first exact: injm_dprod.
(* 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 Gi))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D)))) *)
by apply: subset_trans sGD; case/dprod_normal2: defG => _ /andP[].
Qed.
Lemma morphim_coprime_bigdprod (I : finType) P (H : I -> {group gT}) G :
G \subset D -> \big[dprod/1]_(i | P i) H i = G ->
(forall i j, P i -> P j -> i != j -> coprime #|H i| #|H j|) ->
\big[dprod/1]_(i | P i) f @* H i = f @* G.
Proof.
(* Goal: forall (_ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT D))))) (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base gT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base gT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (Finite.sort I) i (direct_product gT) (P i) (@gval gT (H i)))) (@gval gT G)) (_ : forall (i j : Finite.sort I) (_ : is_true (P i)) (_ : is_true (P j)) (_ : is_true (negb (@eq_op (Finite.eqType I) i j))), 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 i))))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT (H j))))))), @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (Finite.sort I) i (direct_product rT) (P i) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
move=> sGD /bigdprodWcp defG coH; have def_fG := morphim_bigcprod sGD defG.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (@BigOp.bigop (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (Finite.sort I) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) (index_enum I) (fun i : Finite.sort I => @BigBody (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (Finite.sort I) i (direct_product rT) (P i) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT (H i))))) (@morphim gT rT (@gval gT D) f (@MorPhantom gT rT (@mfun gT rT (@gval gT D) f)) (@gval gT G)) *)
by apply: bigcprod_coprime_dprod => // i j *; rewrite coprime_morph ?coH.
Qed.
End MorphimInternalProd.
Section QuotientInternalProd.
Variables (gT : finGroupType) (G K H M : {group gT}).
Hypothesis nMG: G \subset 'N(M).
Lemma quotient_pprod : pprod K H = G -> pprod (K / M) (H / M) = G / M.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (partial_product gT (@gval gT K) (@gval gT H)) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M)))) (Phant (FinGroup.arg_sort (FinGroup.base (@coset_groupType gT (@gval gT M)))))) (partial_product (@coset_groupType gT (@gval gT M)) (@quotient gT (@gval gT K) (@gval gT M)) (@quotient gT (@gval gT H) (@gval gT M))) (@quotient gT (@gval gT G) (@gval gT M)) *)
exact: morphim_pprod.
Qed.
Lemma quotient_coprime_sdprod :
K ><| H = G -> coprime #|K| #|H| -> (K / M) ><| (H / M) = G / M.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (semidirect_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : 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 K)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@coset_groupType gT (@gval gT M)))) (Phant (FinGroup.arg_sort (FinGroup.base (@coset_groupType gT (@gval gT M)))))) (semidirect_product (@coset_groupType gT (@gval gT M)) (@quotient gT (@gval gT K) (@gval gT M)) (@quotient gT (@gval gT H) (@gval gT M))) (@quotient gT (@gval gT G) (@gval gT M)) *)
exact: morphim_coprime_sdprod.
Qed.
Lemma quotient_cprod : K \* H = G -> (K / M) \* (H / M) = G / M.
Proof.
(* Goal: forall _ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT K) (@gval gT H)) (@gval gT G), @eq (@set_of (FinGroup.arg_finType (FinGroup.base (@coset_groupType gT (@gval gT M)))) (Phant (FinGroup.arg_sort (FinGroup.base (@coset_groupType gT (@gval gT M)))))) (central_product (@coset_groupType gT (@gval gT M)) (@quotient gT (@gval gT K) (@gval gT M)) (@quotient gT (@gval gT H) (@gval gT M))) (@quotient gT (@gval gT G) (@gval gT M)) *)
exact: morphim_cprod.
Qed.
Lemma quotient_coprime_dprod :
K \x H = G -> coprime #|K| #|H| -> (K / M) \x (H / M) = G / M.
Proof.
(* Goal: forall (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (direct_product gT (@gval gT K) (@gval gT H)) (@gval gT G)) (_ : is_true (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 K)))) (@card (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.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 (@coset_groupType gT (@gval gT M)))) (Phant (FinGroup.arg_sort (FinGroup.base (@coset_groupType gT (@gval gT M)))))) (direct_product (@coset_groupType gT (@gval gT M)) (@quotient gT (@gval gT K) (@gval gT M)) (@quotient gT (@gval gT H) (@gval gT M))) (@quotient gT (@gval gT G) (@gval gT M)) *)
exact: morphim_coprime_dprod.
Qed.
End QuotientInternalProd.
Section ExternalDirProd.
Variables gT1 gT2 : finGroupType.
Definition extprod_mulg (x y : gT1 * gT2) := (x.1 * y.1, x.2 * y.2).
Definition extprod_invg (x : gT1 * gT2) := (x.1^-1, x.2^-1).
Lemma extprod_mul1g : left_id (1, 1) extprod_mulg.
Proof.
(* Goal: @left_id (prod (FinGroup.sort (FinGroup.base gT1)) (FinGroup.sort (FinGroup.base gT2))) (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (@pair (FinGroup.sort (FinGroup.base gT1)) (FinGroup.sort (FinGroup.base gT2)) (oneg (FinGroup.base gT1)) (oneg (FinGroup.base gT2))) extprod_mulg *)
by case=> x1 x2; congr (_, _); apply: mul1g.
Qed.
Lemma extprod_mulVg : left_inverse (1, 1) extprod_invg extprod_mulg.
Proof.
(* Goal: @left_inverse (prod (FinGroup.sort (FinGroup.base gT1)) (FinGroup.sort (FinGroup.base gT2))) (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (prod (FinGroup.sort (FinGroup.base gT1)) (FinGroup.sort (FinGroup.base gT2))) (@pair (FinGroup.sort (FinGroup.base gT1)) (FinGroup.sort (FinGroup.base gT2)) (oneg (FinGroup.base gT1)) (oneg (FinGroup.base gT2))) extprod_invg extprod_mulg *)
by move=> x; congr (_, _); apply: mulVg.
Qed.
Lemma extprod_mulgA : associative extprod_mulg.
Proof.
(* Goal: @associative (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) extprod_mulg *)
by move=> x y z; congr (_, _); apply: mulgA.
Qed.
Definition extprod_groupMixin :=
Eval hnf in FinGroup.Mixin extprod_mulgA extprod_mul1g extprod_mulVg.
Canonical extprod_baseFinGroupType :=
Eval hnf in BaseFinGroupType (gT1 * gT2) extprod_groupMixin.
Canonical prod_group := FinGroupType extprod_mulVg.
Lemma group_setX (H1 : {group gT1}) (H2 : {group gT2}) : group_set (setX H1 H2).
Proof.
(* Goal: is_true (@group_set prod_group (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (@gval gT2 H2))) *)
apply/group_setP; split; first by rewrite inE !group1.
(* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base prod_group)) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (@gval gT2 H2)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base prod_group)) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (@gval gT2 H2)))) (fun x y : FinGroup.arg_sort (FinGroup.base prod_group) => is_true (@in_mem (FinGroup.sort (FinGroup.base prod_group)) (@mulg (FinGroup.base prod_group) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base prod_group)) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (@gval gT2 H2)))))) (inPhantom (forall x y : FinGroup.arg_sort (FinGroup.base prod_group), is_true (@in_mem (FinGroup.sort (FinGroup.base prod_group)) (@mulg (FinGroup.base prod_group) x y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base prod_group)) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (@gval gT2 H2))))))) *)
case=> [x1 x2] [y1 y2]; rewrite !inE; case/andP=> Hx1 Hx2; case/andP=> Hy1 Hy2.
(* Goal: is_true (andb (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (@fst (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (@mulg (FinGroup.base prod_group) (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) x1 x2) (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) y1 y2))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (@snd (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (@mulg (FinGroup.base prod_group) (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) x1 x2) (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) y1 y2))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2))))) *)
by rewrite /= !groupM.
Qed.
Canonical setX_group H1 H2 := Group (group_setX H1 H2).
Definition pairg1 x : gT1 * gT2 := (x, 1).
Definition pair1g x : gT1 * gT2 := (1, x).
Lemma pairg1_morphM : {morph pairg1 : x y / x * y}.
Proof.
(* Goal: @morphism_2 (FinGroup.arg_sort (FinGroup.base gT1)) (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) pairg1 (fun x y : FinGroup.arg_sort (FinGroup.base gT1) => @mulg (FinGroup.base gT1) x y) (fun x y : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @mulg extprod_baseFinGroupType x y) *)
by move=> x y /=; rewrite {2}/mulg /= /extprod_mulg /= mul1g.
Qed.
Canonical pairg1_morphism := @Morphism _ _ setT _ (in2W pairg1_morphM).
Lemma pair1g_morphM : {morph pair1g : x y / x * y}.
Proof.
(* Goal: @morphism_2 (FinGroup.arg_sort (FinGroup.base gT2)) (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) pair1g (fun x y : FinGroup.arg_sort (FinGroup.base gT2) => @mulg (FinGroup.base gT2) x y) (fun x y : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @mulg extprod_baseFinGroupType x y) *)
by move=> x y /=; rewrite {2}/mulg /= /extprod_mulg /= mul1g.
Qed.
Canonical pair1g_morphism := @Morphism _ _ setT _ (in2W pair1g_morphM).
Lemma fst_morphM : {morph (@fst gT1 gT2) : x y / x * y}.
Proof.
(* Goal: @morphism_2 (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (FinGroup.arg_sort (FinGroup.base gT1)) (@fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (fun x y : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @mulg extprod_baseFinGroupType x y) (fun x y : FinGroup.arg_sort (FinGroup.base gT1) => @mulg (FinGroup.base gT1) x y) *)
by move=> x y.
Qed.
Lemma snd_morphM : {morph (@snd gT1 gT2) : x y / x * y}.
Proof.
(* Goal: @morphism_2 (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (FinGroup.arg_sort (FinGroup.base gT2)) (@snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (fun x y : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @mulg extprod_baseFinGroupType x y) (fun x y : FinGroup.arg_sort (FinGroup.base gT2) => @mulg (FinGroup.base gT2) x y) *)
by move=> x y.
Qed.
Canonical fst_morphism := @Morphism _ _ setT _ (in2W fst_morphM).
Canonical snd_morphism := @Morphism _ _ setT _ (in2W snd_morphM).
Lemma injm_pair1g : 'injm pair1g.
Proof.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT2)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) (@ker gT2 prod_group (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) pair1g_morphism (@MorPhantom gT2 prod_group pair1g)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_baseGroupType (FinGroup.base gT2)))))) *)
by apply/subsetP=> x /morphpreP[_ /set1P[->]]; apply: set11.
Qed.
Lemma injm_pairg1 : 'injm pairg1.
Proof.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT1)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) (@ker gT1 prod_group (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) pairg1_morphism (@MorPhantom gT1 prod_group pairg1)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) (oneg (group_set_baseGroupType (FinGroup.base gT1)))))) *)
by apply/subsetP=> x /morphpreP[_ /set1P[->]]; apply: set11.
Qed.
Lemma morphim_pairg1 (H1 : {set gT1}) : pairg1 @* H1 = setX H1 1.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base prod_group))))) (@morphim gT1 prod_group (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) pairg1_morphism (@MorPhantom gT1 prod_group pairg1) H1) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))) *)
by rewrite -imset2_pair imset2_set1r morphimEsub ?subsetT.
Qed.
Lemma morphim_pair1g (H2 : {set gT2}) : pair1g @* H2 = setX 1 H2.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base prod_group))))) (@morphim gT2 prod_group (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) pair1g_morphism (@MorPhantom gT2 prod_group pair1g) H2) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) H2) *)
by rewrite -imset2_pair imset2_set1l morphimEsub ?subsetT.
Qed.
Lemma morphim_fstX (H1: {set gT1}) (H2 : {group gT2}) :
[morphism of fun x => x.1] @* setX H1 H2 = H1.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT1))))) (@morphim prod_group gT1 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (@clone_morphism prod_group gT1 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) fst_morphism (@Morphism prod_group gT1 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (fun x : FinGroup.arg_sort (FinGroup.base prod_group) => @fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x))) (@MorPhantom prod_group gT1 (@mfun prod_group gT1 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (@clone_morphism prod_group gT1 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) fst_morphism (@Morphism prod_group gT1 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (fun x : FinGroup.arg_sort (FinGroup.base prod_group) => @fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x))))) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (@gval gT2 H2))) H1 *)
apply/eqP; rewrite eqEsubset morphimE setTI /=.
(* Goal: is_true (andb (@subset (FinGroup.finType (FinGroup.base gT1)) (@mem (FinGroup.sort (FinGroup.base gT1)) (predPredType (FinGroup.sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT1)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (@gval gT2 H2))))))) (@mem (FinGroup.sort (FinGroup.base gT1)) (predPredType (FinGroup.sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) H1))) (@subset (FinGroup.finType (FinGroup.base gT1)) (@mem (FinGroup.sort (FinGroup.base gT1)) (predPredType (FinGroup.sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) H1)) (@mem (FinGroup.sort (FinGroup.base gT1)) (predPredType (FinGroup.sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT1)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (@gval gT2 H2))))))))) *)
apply/andP; split; apply/subsetP=> x.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) H1))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT1)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (@gval gT2 H2)))))))) *)
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT1)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (@gval gT2 H2)))))))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) H1))) *)
by case/imsetP=> x0; rewrite inE; move/andP=> [Hx1 _] ->.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) H1))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT1)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT1)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @fst (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (@gval gT2 H2)))))))) *)
move=> Hx1; apply/imsetP; exists (x, 1); last by trivial.
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (@pair (Finite.sort (FinGroup.finType (FinGroup.base gT1))) (FinGroup.sort (FinGroup.base gT2)) x (oneg (FinGroup.base gT2))) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (@gval gT2 H2))))) *)
by rewrite in_setX Hx1 /=.
Qed.
Lemma morphim_sndX (H1: {group gT1}) (H2 : {set gT2}) :
[morphism of fun x => x.2] @* setX H1 H2 = H2.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT2))))) (@morphim prod_group gT2 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (@clone_morphism prod_group gT2 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) snd_morphism (@Morphism prod_group gT2 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (fun x : FinGroup.arg_sort (FinGroup.base prod_group) => @snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x))) (@MorPhantom prod_group gT2 (@mfun prod_group gT2 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (@clone_morphism prod_group gT2 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) snd_morphism (@Morphism prod_group gT2 (@setTfor (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (fun x : FinGroup.arg_sort (FinGroup.base prod_group) => @snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x))))) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) H2)) H2 *)
apply/eqP; rewrite eqEsubset morphimE setTI /=.
(* Goal: is_true (andb (@subset (FinGroup.finType (FinGroup.base gT2)) (@mem (FinGroup.sort (FinGroup.base gT2)) (predPredType (FinGroup.sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT2)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) H2)))))) (@mem (FinGroup.sort (FinGroup.base gT2)) (predPredType (FinGroup.sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) H2))) (@subset (FinGroup.finType (FinGroup.base gT2)) (@mem (FinGroup.sort (FinGroup.base gT2)) (predPredType (FinGroup.sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) H2)) (@mem (FinGroup.sort (FinGroup.base gT2)) (predPredType (FinGroup.sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT2)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) H2)))))))) *)
apply/andP; split; apply/subsetP=> x.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) H2))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT2)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) H2))))))) *)
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT2)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) H2))))))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) H2))) *)
by case/imsetP=> x0; rewrite inE; move/andP=> [_ Hx2] ->.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) H2))), is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) x (@mem (Finite.sort (FinGroup.finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base gT2)) (@Imset.imset (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.finType (FinGroup.base gT2)) (fun x : prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) => @snd (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) H2))))))) *)
move=> Hx2; apply/imsetP; exists (1, x); last by [].
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (@pair (FinGroup.sort (FinGroup.base gT1)) (Finite.sort (FinGroup.finType (FinGroup.base gT2))) (oneg (FinGroup.base gT1)) x) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) H2)))) *)
by rewrite in_setX Hx2 andbT.
Qed.
Lemma setX_prod (H1 : {set gT1}) (H2 : {set gT2}) :
setX H1 1 * setX 1 H2 = setX H1 H2.
Proof.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType extprod_baseFinGroupType)) (@mulg (group_set_of_baseGroupType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) H2)) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 H2) *)
apply/setP=> [[x y]]; rewrite !inE /=.
(* Goal: @eq bool (@in_mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x y) (@mem (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@mulg (group_set_of_baseGroupType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) H2))))) (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT1)) x (@mem (FinGroup.arg_sort (FinGroup.base gT1)) (predPredType (FinGroup.arg_sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) H1))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT2)) y (@mem (FinGroup.arg_sort (FinGroup.base gT2)) (predPredType (FinGroup.arg_sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) H2)))) *)
apply/imset2P/andP=> [[[x1 u1] [v1 y1]] | [Hx Hy]].
(* Goal: @imset2_spec (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.arg_finType extprod_baseFinGroupType) (prod_finType (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2))) (@mulg extprod_baseFinGroupType) (@mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))))) (fun _ : Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType) => @mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) H2))) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x y) *)
(* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) x1 u1) (@mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) v1 y1) (@mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) H2))))) (_ : @eq (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)))) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x y) (@mulg extprod_baseFinGroupType (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) x1 u1) (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) v1 y1))), and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT1)) x (@mem (FinGroup.arg_sort (FinGroup.base gT1)) (predPredType (FinGroup.arg_sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) H1)))) (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT2)) y (@mem (FinGroup.arg_sort (FinGroup.base gT2)) (predPredType (FinGroup.arg_sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) H2)))) *)
rewrite !inE /= => /andP[Hx1 /eqP->] /andP[/eqP-> Hx] [-> ->].
(* Goal: @imset2_spec (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.arg_finType extprod_baseFinGroupType) (prod_finType (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2))) (@mulg extprod_baseFinGroupType) (@mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))))) (fun _ : Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType) => @mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) H2))) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x y) *)
(* Goal: and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT1)) (@mulg (FinGroup.base gT1) x1 (oneg (FinGroup.base gT1))) (@mem (FinGroup.arg_sort (FinGroup.base gT1)) (predPredType (FinGroup.arg_sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) H1)))) (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT2)) (@mulg (FinGroup.base gT2) (oneg (FinGroup.base gT2)) y1) (@mem (FinGroup.arg_sort (FinGroup.base gT2)) (predPredType (FinGroup.arg_sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) H2)))) *)
by rewrite mulg1 mul1g.
(* Goal: @imset2_spec (FinGroup.arg_finType extprod_baseFinGroupType) (FinGroup.arg_finType extprod_baseFinGroupType) (prod_finType (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2))) (@mulg extprod_baseFinGroupType) (@mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) H1 (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))))) (fun _ : Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType) => @mem (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType)) (predPredType (Finite.sort (FinGroup.arg_finType extprod_baseFinGroupType))) (@SetDef.pred_of_set (FinGroup.arg_finType extprod_baseFinGroupType) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) H2))) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x y) *)
exists (x, 1 : gT2) (1 : gT1, y); rewrite ?inE ?Hx ?eqxx //.
(* Goal: @eq (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)))) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x y) (@mulg extprod_baseFinGroupType (@pair (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (FinGroup.arg_sort (FinGroup.base gT2)) x (oneg (FinGroup.base gT2))) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (oneg (FinGroup.base gT1)) y)) *)
by rewrite /mulg /= /extprod_mulg /= mulg1 mul1g.
Qed.
Lemma setX_dprod (H1 : {group gT1}) (H2 : {group gT2}) :
setX H1 1 \x setX 1 H2 = setX H1 H2.
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (FinGroup.arg_sort (FinGroup.base prod_group)))) (direct_product prod_group (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (oneg (group_set_of_baseGroupType (FinGroup.base gT2)))) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) (@gval gT2 H2))) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (@gval gT2 H2)) *)
rewrite dprodE ?setX_prod //.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (@setI (FinGroup.arg_finType (FinGroup.base prod_group)) (@gval prod_group (setX_group H1 (one_group gT2))) (@gval prod_group (setX_group (one_group gT1) H2))) (oneg (group_set_of_baseGroupType (FinGroup.base prod_group))) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base prod_group)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base prod_group)) (@gval prod_group (setX_group (one_group gT1) H2)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base prod_group)) (@centraliser prod_group (@gval prod_group (setX_group H1 (one_group gT2))))))) *)
apply/centsP=> [[x u]]; rewrite !inE /= => /andP[/eqP-> _] [v y].
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (@setI (FinGroup.arg_finType (FinGroup.base prod_group)) (@gval prod_group (setX_group H1 (one_group gT2))) (@gval prod_group (setX_group (one_group gT1) H2))) (oneg (group_set_of_baseGroupType (FinGroup.base prod_group))) *)
(* Goal: forall _ : is_true (@in_mem (FinGroup.arg_sort (FinGroup.base prod_group)) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) v y) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base prod_group)) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (oneg (group_set_of_baseGroupType (FinGroup.base gT2))))))), @commute (FinGroup.base prod_group) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) (oneg (FinGroup.base gT1)) u) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) v y) *)
by rewrite !inE /= => /andP[_ /eqP->]; congr (_, _); rewrite ?mul1g ?mulg1.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base prod_group))))) (@setI (FinGroup.arg_finType (FinGroup.base prod_group)) (@gval prod_group (setX_group H1 (one_group gT2))) (@gval prod_group (setX_group (one_group gT1) H2))) (oneg (group_set_of_baseGroupType (FinGroup.base prod_group))) *)
apply/trivgP; apply/subsetP=> [[x y]]; rewrite !inE /= -!andbA.
(* Goal: forall _ : is_true (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT1)) x (@mem (FinGroup.arg_sort (FinGroup.base gT1)) (predPredType (FinGroup.arg_sort (FinGroup.base gT1))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)))) (andb (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base gT2))) y (oneg (FinGroup.base gT2))) (andb (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base gT1))) x (oneg (FinGroup.base gT1))) (@in_mem (FinGroup.arg_sort (FinGroup.base gT2)) y (@mem (FinGroup.arg_sort (FinGroup.base gT2)) (predPredType (FinGroup.arg_sort (FinGroup.base gT2))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2))))))), is_true (@eq_op (Finite.eqType (FinGroup.finType extprod_baseFinGroupType)) (@pair (FinGroup.arg_sort (FinGroup.base gT1)) (FinGroup.arg_sort (FinGroup.base gT2)) x y) (oneg extprod_baseFinGroupType)) *)
by case/and4P=> _ /eqP-> /eqP->; rewrite eqxx.
Qed.
Lemma isog_setX1 (H1 : {group gT1}) : isog H1 (setX H1 1).
Proof.
(* Goal: is_true (@isog gT1 prod_group (@gval gT1 H1) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT1 H1) (oneg (group_set_of_baseGroupType (FinGroup.base gT2))))) *)
apply/isogP; exists [morphism of restrm (subsetT H1) pairg1].
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base prod_group))))) (@morphim gT1 prod_group (@gval gT1 H1) (@clone_morphism gT1 prod_group (@gval gT1 H1) (@restrm_morphism gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1_morphism) (@Morphism gT1 prod_group (@gval gT1 H1) (@restrm gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1))) (@MorPhantom gT1 prod_group (@mfun gT1 prod_group (@gval gT1 H1) (@clone_morphism gT1 prod_group (@gval gT1 H1) (@restrm_morphism gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1_morphism) (@Morphism gT1 prod_group (@gval gT1 H1) (@restrm gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1))))) (@gval gT1 H1)) (@gval prod_group (setX_group H1 (one_group gT2))) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT1)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) (@ker gT1 prod_group (@gval gT1 H1) (@clone_morphism gT1 prod_group (@gval gT1 H1) (@restrm_morphism gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1_morphism) (@Morphism gT1 prod_group (@gval gT1 H1) (@restrm gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1))) (@MorPhantom gT1 prod_group (@mfun gT1 prod_group (@gval gT1 H1) (@clone_morphism gT1 prod_group (@gval gT1 H1) (@restrm_morphism gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1_morphism) (@Morphism gT1 prod_group (@gval gT1 H1) (@restrm gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT1)) (oneg (group_set_baseGroupType (FinGroup.base gT1)))))) *)
by rewrite injm_restrm ?injm_pairg1.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base prod_group))))) (@morphim gT1 prod_group (@gval gT1 H1) (@clone_morphism gT1 prod_group (@gval gT1 H1) (@restrm_morphism gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1_morphism) (@Morphism gT1 prod_group (@gval gT1 H1) (@restrm gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1))) (@MorPhantom gT1 prod_group (@mfun gT1 prod_group (@gval gT1 H1) (@clone_morphism gT1 prod_group (@gval gT1 H1) (@restrm_morphism gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1_morphism) (@Morphism gT1 prod_group (@gval gT1 H1) (@restrm gT1 prod_group (@gval gT1 H1) (@setTfor (FinGroup.arg_finType (FinGroup.base gT1)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT1))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT1)) (@gval gT1 H1)) pairg1))))) (@gval gT1 H1)) (@gval prod_group (setX_group H1 (one_group gT2))) *)
by rewrite morphim_restrm morphim_pairg1 setIid.
Qed.
Lemma isog_set1X (H2 : {group gT2}) : isog H2 (setX 1 H2).
Proof.
(* Goal: is_true (@isog gT2 prod_group (@gval gT2 H2) (@setX (FinGroup.arg_finType (FinGroup.base gT1)) (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_of_baseGroupType (FinGroup.base gT1))) (@gval gT2 H2))) *)
apply/isogP; exists [morphism of restrm (subsetT H2) pair1g].
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base prod_group))))) (@morphim gT2 prod_group (@gval gT2 H2) (@clone_morphism gT2 prod_group (@gval gT2 H2) (@restrm_morphism gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g_morphism) (@Morphism gT2 prod_group (@gval gT2 H2) (@restrm gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g))) (@MorPhantom gT2 prod_group (@mfun gT2 prod_group (@gval gT2 H2) (@clone_morphism gT2 prod_group (@gval gT2 H2) (@restrm_morphism gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g_morphism) (@Morphism gT2 prod_group (@gval gT2 H2) (@restrm gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g))))) (@gval gT2 H2)) (@gval prod_group (setX_group (one_group gT1) H2)) *)
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base gT2)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) (@ker gT2 prod_group (@gval gT2 H2) (@clone_morphism gT2 prod_group (@gval gT2 H2) (@restrm_morphism gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g_morphism) (@Morphism gT2 prod_group (@gval gT2 H2) (@restrm gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g))) (@MorPhantom gT2 prod_group (@mfun gT2 prod_group (@gval gT2 H2) (@clone_morphism gT2 prod_group (@gval gT2 H2) (@restrm_morphism gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g_morphism) (@Morphism gT2 prod_group (@gval gT2 H2) (@restrm gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g)))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT2)) (oneg (group_set_baseGroupType (FinGroup.base gT2)))))) *)
by rewrite injm_restrm ?injm_pair1g.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base prod_group)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base prod_group))))) (@morphim gT2 prod_group (@gval gT2 H2) (@clone_morphism gT2 prod_group (@gval gT2 H2) (@restrm_morphism gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g_morphism) (@Morphism gT2 prod_group (@gval gT2 H2) (@restrm gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g))) (@MorPhantom gT2 prod_group (@mfun gT2 prod_group (@gval gT2 H2) (@clone_morphism gT2 prod_group (@gval gT2 H2) (@restrm_morphism gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g_morphism) (@Morphism gT2 prod_group (@gval gT2 H2) (@restrm gT2 prod_group (@gval gT2 H2) (@setTfor (FinGroup.arg_finType (FinGroup.base gT2)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT2))))) (@subsetT (FinGroup.arg_finType (FinGroup.base gT2)) (@gval gT2 H2)) pair1g))))) (@gval gT2 H2)) (@gval prod_group (setX_group (one_group gT1) H2)) *)
by rewrite morphim_restrm morphim_pair1g setIid.
Qed.
Lemma setX_gen (H1 : {set gT1}) (H2 : {set gT2}) :
1 \in H1 -> 1 \in H2 -> <<setX H1 H2>> = setX <<H1>> <<H2>>.
End ExternalDirProd.
Section ExternalSDirProd.
Variables (aT rT : finGroupType) (D : {group aT}) (R : {group rT}).
Inductive sdprod_by (to : groupAction D R) : predArgType :=
SdPair (ax : aT * rT) of ax \in setX D R.
Coercion pair_of_sd to (u : sdprod_by to) := let: SdPair ax _ := u in ax.
Variable to : groupAction D R.
Notation sdT := (sdprod_by to).
Notation sdval := (@pair_of_sd to).
Canonical sdprod_subType := Eval hnf in [subType for sdval].
Definition sdprod_eqMixin := Eval hnf in [eqMixin of sdT by <:].
Canonical sdprod_eqType := Eval hnf in EqType sdT sdprod_eqMixin.
Definition sdprod_choiceMixin := [choiceMixin of sdT by <:].
Canonical sdprod_choiceType := ChoiceType sdT sdprod_choiceMixin.
Definition sdprod_countMixin := [countMixin of sdT by <:].
Canonical sdprod_countType := CountType sdT sdprod_countMixin.
Canonical sdprod_subCountType := Eval hnf in [subCountType of sdT].
Definition sdprod_finMixin := [finMixin of sdT by <:].
Canonical sdprod_finType := FinType sdT sdprod_finMixin.
Canonical sdprod_subFinType := Eval hnf in [subFinType of sdT].
Definition sdprod_one := SdPair to (group1 _).
Lemma sdprod_inv_proof (u : sdT) : (u.1^-1, to u.2^-1 u.1^-1) \in setX D R.
Proof.
(* Goal: is_true (@in_mem (prod (FinGroup.sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@invg (FinGroup.base aT) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u))) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@invg (FinGroup.base rT) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u))) (@invg (FinGroup.base aT) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u))))) (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) *)
by case: u => [[a x]] /= /setXP[Da Rx]; rewrite inE gact_stable !groupV ?Da.
Qed.
Definition sdprod_inv u := SdPair to (sdprod_inv_proof u).
Lemma sdprod_mul_proof (u v : sdT) :
(u.1 * v.1, to u.2 v.1 * v.2) \in setX D R.
Proof.
(* Goal: is_true (@in_mem (prod (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u)) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v))) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u)) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v))) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v)))) (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) *)
case: u v => [[a x] /= /setXP[Da Rx]] [[b y] /= /setXP[Db Ry]].
(* Goal: is_true (@in_mem (prod (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) a b) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) x b) y)) (@mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) (predPredType (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) *)
by rewrite inE !groupM //= gact_stable.
Qed.
Definition sdprod_mul u v := SdPair to (sdprod_mul_proof u v).
Lemma sdprod_mul1g : left_id sdprod_one sdprod_mul.
Proof.
(* Goal: @left_id (sdprod_by to) (sdprod_by to) sdprod_one sdprod_mul *)
move=> u; apply: val_inj; case: u => [[a x] /=]; case/setXP=> Da _.
(* Goal: @eq (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) (oneg (FinGroup.base aT)) a) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (oneg (FinGroup.base rT)) a) x)) (@pair (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) a x) *)
by rewrite gact1 // !mul1g.
Qed.
Lemma sdprod_mulVg : left_inverse sdprod_one sdprod_inv sdprod_mul.
Proof.
(* Goal: @left_inverse (sdprod_by to) (sdprod_by to) (sdprod_by to) sdprod_one sdprod_inv sdprod_mul *)
move=> u; apply: val_inj; case: u => [[a x] /=]; case/setXP=> Da _.
(* Goal: @eq (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) (@invg (FinGroup.base aT) a) a) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@invg (FinGroup.base rT) x) (@invg (FinGroup.base aT) a)) a) x)) (oneg (extprod_baseFinGroupType aT rT)) *)
by rewrite actKVin ?mulVg.
Qed.
Lemma sdprod_mulgA : associative sdprod_mul.
Proof.
(* Goal: @associative (sdprod_by to) sdprod_mul *)
move=> u v w; apply: val_inj; case: u => [[a x]] /=; case/setXP=> Da Rx.
(* Goal: @eq (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) a (@mulg (FinGroup.base aT) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v)) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to w)))) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) x (@mulg (FinGroup.base aT) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v)) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to w)))) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v)) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to w))) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to w))))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) (@mulg (FinGroup.base aT) a (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v))) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to w))) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) x (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v))) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to v))) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to w))) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to w)))) *)
case: v w => [[b y]] /=; case/setXP=> Db Ry [[c z]] /=; case/setXP=> Dc Rz.
(* Goal: @eq (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) a (@mulg (FinGroup.base aT) b c)) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) x (@mulg (FinGroup.base aT) b c)) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) y c) z))) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) (@mulg (FinGroup.base aT) a b) c) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) x b) y) c) z)) *)
by rewrite !(actMin to) // gactM ?gact_stable // !mulgA.
Qed.
Canonical sdprod_groupMixin :=
FinGroup.Mixin sdprod_mulgA sdprod_mul1g sdprod_mulVg.
Canonical sdprod_baseFinGroupType :=
Eval hnf in BaseFinGroupType sdT sdprod_groupMixin.
Canonical sdprod_groupType := FinGroupType sdprod_mulVg.
Definition sdpair1 x := insubd sdprod_one (1, x) : sdT.
Definition sdpair2 a := insubd sdprod_one (a, 1) : sdT.
Lemma sdpair1_morphM : {in R &, {morph sdpair1 : x y / x * y}}.
Lemma sdpair2_morphM : {in D &, {morph sdpair2 : a b / a * b}}.
Canonical sdpair1_morphism := Morphism sdpair1_morphM.
Canonical sdpair2_morphism := Morphism sdpair2_morphM.
Lemma injm_sdpair1 : 'injm sdpair1.
Proof.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@ker rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (oneg (group_set_baseGroupType (FinGroup.base rT)))))) *)
apply/subsetP=> x /setIP[Rx].
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@preimset (FinGroup.arg_finType (FinGroup.base rT)) (FinGroup.sort (FinGroup.base sdprod_groupType)) (@mfun rT sdprod_groupType (@gval rT R) sdpair1_morphism) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (oneg (group_set_of_baseGroupType (FinGroup.base sdprod_groupType))))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) x (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (oneg (group_set_baseGroupType (FinGroup.base rT)))))) *)
by rewrite !inE -val_eqE val_insubd inE Rx group1 /=; case/andP.
Qed.
Lemma injm_sdpair2 : 'injm sdpair2.
Proof.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *)
apply/subsetP=> a /setIP[Da].
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@preimset (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.sort (FinGroup.base sdprod_groupType)) (@mfun aT sdprod_groupType (@gval aT D) sdpair2_morphism) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (oneg (group_set_of_baseGroupType (FinGroup.base sdprod_groupType))))))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) a (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) *)
by rewrite !inE -val_eqE val_insubd inE Da group1 /=; case/andP.
Qed.
Lemma sdpairE (u : sdT) : u = sdpair2 u.1 * sdpair1 u.2.
Proof.
(* Goal: @eq (sdprod_by to) u (@mulg sdprod_baseFinGroupType (sdpair2 (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u))) (sdpair1 (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u)))) *)
apply: val_inj; case: u => [[a x] /= /setXP[Da Rx]].
(* Goal: @eq (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) (@pair (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) a x) (@pair (FinGroup.sort (FinGroup.base aT)) (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base aT) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to (sdpair2 a))) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to (sdpair1 x)))) (@mulg (FinGroup.base rT) (@act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to (sdpair2 a))) (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to (sdpair1 x)))) (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to (sdpair1 x))))) *)
by rewrite !val_insubd !inE Da Rx !(group1, gact1) // mulg1 mul1g.
Qed.
Lemma sdpair_act : {in R & D,
forall x a, sdpair1 (to x a) = sdpair1 x ^ sdpair2 a}.
Lemma sdpair_setact (G : {set rT}) a : G \subset R -> a \in D ->
sdpair1 @* (to^~ a @: G) = (sdpair1 @* G) :^ sdpair2 a.
Lemma im_sdpair_norm : sdpair2 @* D \subset 'N(sdpair1 @* R).
Proof.
(* Goal: is_true (@subset (FinGroup.finType (FinGroup.base sdprod_groupType)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base sdprod_groupType)) (@morphim aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) (@gval aT D)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (@normaliser sdprod_groupType (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) (@gval rT R)))))) *)
apply/subsetP=> _ /morphimP[a _ Da ->].
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType))) (@mfun aT sdprod_groupType (@gval aT D) sdpair2_morphism a) (@mem (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (@normaliser sdprod_groupType (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) (@gval rT R)))))) *)
rewrite inE -sdpair_setact // morphimS //.
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base rT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@Imset.imset (FinGroup.arg_finType (FinGroup.base rT)) (FinGroup.arg_finType (FinGroup.base rT)) (fun x : Finite.sort (FinGroup.arg_finType (FinGroup.base rT)) => @act aT (@gval aT D) (FinGroup.arg_sort (FinGroup.base rT)) (@gact aT rT (@gval aT D) (@gval rT R) to) x a) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT R)))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@gval rT R)))) *)
by apply/subsetP=> _ /imsetP[x Rx ->]; rewrite gact_stable.
Qed.
Lemma im_sdpair_TI : (sdpair1 @* R) :&: (sdpair2 @* D) = 1.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base sdprod_groupType)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType))))) (@setI (FinGroup.finType (FinGroup.base sdprod_groupType)) (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) (@gval rT R)) (@morphim aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) (@gval aT D))) (oneg (group_set_of_baseGroupType (FinGroup.base sdprod_groupType))) *)
apply/trivgP; apply/subsetP=> _ /setIP[/morphimP[x _ Rx ->]].
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (@mfun rT sdprod_groupType (@gval rT R) sdpair1_morphism x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (@gval sdprod_groupType (@morphim_group aT sdprod_groupType D sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) D))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (@mfun rT sdprod_groupType (@gval rT R) sdpair1_morphism x) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base sdprod_groupType)) (oneg (group_set_of_baseGroupType (FinGroup.base sdprod_groupType)))))) *)
case/morphimP=> a _ Da /eqP; rewrite inE -!val_eqE.
(* Goal: forall _ : is_true (@eq_op (prod_eqType (FinGroup.arg_eqType (FinGroup.base aT)) (FinGroup.arg_eqType (FinGroup.base rT))) (@val (Equality.sort (prod_eqType (FinGroup.arg_eqType (FinGroup.base aT)) (FinGroup.arg_eqType (FinGroup.base rT)))) (fun x : prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) => @in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) x (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) sdprod_subType (@mfun rT sdprod_groupType (@gval rT R) sdpair1_morphism x)) (@val (Equality.sort (prod_eqType (FinGroup.arg_eqType (FinGroup.base aT)) (FinGroup.arg_eqType (FinGroup.base rT)))) (fun x : prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) => @in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) x (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) sdprod_subType (@mfun aT sdprod_groupType (@gval aT D) sdpair2_morphism a))), is_true (@eq_op (Choice.eqType (prod_choiceType (FinGroup.arg_choiceType (FinGroup.base aT)) (FinGroup.arg_choiceType (FinGroup.base rT)))) (@val (Equality.sort (Choice.eqType (prod_choiceType (FinGroup.arg_choiceType (FinGroup.base aT)) (FinGroup.arg_choiceType (FinGroup.base rT))))) (fun x : prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) => @in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) x (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) (@subFin_sort (prod_choiceType (FinGroup.arg_choiceType (FinGroup.base aT)) (FinGroup.arg_choiceType (FinGroup.base rT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) => @in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) x (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) sdprod_subFinType) (@mfun rT sdprod_groupType (@gval rT R) sdpair1_morphism x)) (@val (Equality.sort (Choice.eqType (prod_choiceType (FinGroup.arg_choiceType (FinGroup.base aT)) (FinGroup.arg_choiceType (FinGroup.base rT))))) (fun x : prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) => @in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) x (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) (@subFin_sort (prod_choiceType (FinGroup.arg_choiceType (FinGroup.base aT)) (FinGroup.arg_choiceType (FinGroup.base rT))) (fun x : prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) => @in_mem (prod (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT))) x (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT))) (@setX (FinGroup.arg_finType (FinGroup.base aT)) (FinGroup.arg_finType (FinGroup.base rT)) (@gval aT D) (@gval rT R))))) sdprod_subFinType) (oneg (FinGroup.base sdprod_groupType)))) *)
by rewrite !val_insubd !inE Da Rx !group1 /eq_op /= eqxx; case/andP.
Qed.
Lemma im_sdpair : (sdpair1 @* R) * (sdpair2 @* D) = setT.
Proof.
(* Goal: @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base sdprod_groupType))) (@mulg (group_set_of_baseGroupType (FinGroup.base sdprod_groupType)) (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) (@gval rT R)) (@morphim aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) (@gval aT D))) (@setTfor (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))))) *)
apply/eqP; rewrite -subTset -(normC im_sdpair_norm).
(* Goal: is_true (@subset (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (@setTfor (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (@mulg (group_set_of_baseGroupType (FinGroup.base sdprod_groupType)) (@morphim aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) (@gval aT D)) (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) (@gval rT R)))))) *)
apply/subsetP=> /= u _; rewrite [u]sdpairE.
(* Goal: is_true (@in_mem (sdprod_by to) (@mulg sdprod_baseFinGroupType (sdpair2 (@fst (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u))) (sdpair1 (@snd (FinGroup.arg_sort (FinGroup.base aT)) (FinGroup.arg_sort (FinGroup.base rT)) (@pair_of_sd to u)))) (@mem (sdprod_by to) (predPredType (sdprod_by to)) (@SetDef.pred_of_set (FinGroup.arg_finType sdprod_baseFinGroupType) (@mulg (group_set_of_baseGroupType sdprod_baseFinGroupType) (@morphim aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) (@gval aT D)) (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) (@gval rT R)))))) *)
by case: u => [[a x] /= /setXP[Da Rx]]; rewrite mem_mulg ?mem_morphim.
Qed.
Lemma sdprod_sdpair : sdpair1 @* R ><| sdpair2 @* D = setT.
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (Phant (FinGroup.arg_sort (FinGroup.base sdprod_groupType)))) (semidirect_product sdprod_groupType (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) (@gval rT R)) (@morphim aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) (@gval aT D))) (@setTfor (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))))) *)
by rewrite sdprodE ?(im_sdpair_norm, im_sdpair, im_sdpair_TI).
Qed.
Variables (A : {set aT}) (G : {set rT}).
Lemma gacentEsd : 'C_(|to)(A) = sdpair1 @*^-1 'C(sdpair2 @* A).
Hypotheses (sAD : A \subset D) (sGR : G \subset R).
Lemma astabEsd : 'C(G | to) = sdpair2 @*^-1 'C(sdpair1 @* G).
Lemma astabsEsd : 'N(G | to) = sdpair2 @*^-1 'N(sdpair1 @* G).
Lemma actsEsd : [acts A, on G | to] = (sdpair2 @* A \subset 'N(sdpair1 @* G)).
Proof.
(* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@astabs aT (@gval aT D) (FinGroup.arg_finType (FinGroup.base rT)) G (@gact aT rT (@gval aT D) (@gval rT R) to))))) (@subset (FinGroup.finType (FinGroup.base sdprod_groupType)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base sdprod_groupType)) (@morphim aT sdprod_groupType (@gval aT D) sdpair2_morphism (@MorPhantom aT sdprod_groupType sdpair2) A))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base sdprod_groupType)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base sdprod_groupType)) (@normaliser sdprod_groupType (@morphim rT sdprod_groupType (@gval rT R) sdpair1_morphism (@MorPhantom rT sdprod_groupType sdpair1) G))))) *)
by rewrite sub_morphim_pre -?astabsEsd.
Qed.
End ExternalSDirProd.
Section ProdMorph.
Variables gT rT : finGroupType.
Implicit Types A B : {set gT}.
Implicit Types G H K : {group gT}.
Implicit Types C D : {set rT}.
Implicit Type L : {group rT}.
Section defs.
Variables (A B : {set gT}) (fA fB : gT -> FinGroup.sort rT).
Definition pprodm of B \subset 'N(A) & {in A & B, morph_act 'J 'J fA fB}
& {in A :&: B, fA =1 fB} :=
fun x => fA (divgr A B x) * fB (remgr A B x).
End defs.
Section Props.
Variables H K : {group gT}.
Variables (fH : {morphism H >-> rT}) (fK : {morphism K >-> rT}).
Hypothesis nHK : K \subset 'N(H).
Hypothesis actf : {in H & K, morph_act 'J 'J fH fK}.
Hypothesis eqfHK : {in H :&: K, fH =1 fK}.
Local Notation f := (pprodm nHK actf eqfHK).
Lemma pprodmE x a : x \in H -> a \in K -> f (x * a) = fH x * fK a.
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))))) (_ : 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)) (@gval gT K))))), @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) x a)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)) *)
move=> Hx Ka; have: x * a \in H * K by rewrite mem_mulg.
(* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base gT)) (@mulg (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)) (@gval gT H) (@gval gT K))))), @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) x a)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)) *)
rewrite -remgrP inE /f rcoset_sym mem_rcoset /divgr -mulgA groupMl //.
(* Goal: forall _ : is_true (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) a (@invg (FinGroup.base gT) (@remgr gT (@gval gT H) (@gval gT K) (@mulg (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)) (@gval gT H)))) (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@remgr gT (@gval gT H) (@gval gT K) (@mulg (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)) (@gval gT K))))), @eq (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH (@mulg (FinGroup.base gT) x (@mulg (FinGroup.base gT) a (@invg (FinGroup.base gT) (@remgr gT (@gval gT H) (@gval gT K) (@mulg (FinGroup.base gT) x a)))))) (@mfun gT rT (@gval gT K) fK (@remgr gT (@gval gT H) (@gval gT K) (@mulg (FinGroup.base gT) x a)))) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)) *)
case/andP; move: (remgr H K _) => b Hab Kb; rewrite morphM // -mulgA.
(* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH (@mulg (FinGroup.base gT) a (@invg (FinGroup.base gT) b))) (@mfun gT rT (@gval gT K) fK b))) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)) *)
have Kab: a * b^-1 \in K by rewrite groupM ?groupV.
(* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH (@mulg (FinGroup.base gT) a (@invg (FinGroup.base gT) b))) (@mfun gT rT (@gval gT K) fK b))) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)) *)
by congr (_ * _); rewrite eqfHK 1?inE ?Hab // -morphM // mulgKV.
Qed.
Lemma pprodmEl : {in H, f =1 fH}.
Proof.
(* Goal: @prop_in1 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK x) (@mfun gT rT (@gval gT H) fH x)) (inPhantom (@eqfun (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK) (@mfun gT rT (@gval gT H) fH))) *)
by move=> x Hx; rewrite -(mulg1 x) pprodmE // morph1 !mulg1.
Qed.
Lemma pprodmEr : {in K, f =1 fK}.
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 K))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK x) (@mfun gT rT (@gval gT K) fK x)) (inPhantom (@eqfun (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK) (@mfun gT rT (@gval gT K) fK))) *)
by move=> a Ka; rewrite -(mul1g a) pprodmE // morph1 !mul1g.
Qed.
Lemma pprodmM : {in H <*> K &, {morph f: 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)) (@joing gT (@gval gT H) (@gval gT K)))) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK ((fun x0 y0 : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x0 y0) x y)) ((fun x0 y0 : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x0 y0) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK x) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK y))) (inPhantom (@morphism_2 (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK) (fun x y : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x y) (fun x y : FinGroup.sort (FinGroup.base rT) => @mulg (FinGroup.base rT) x y))) *)
move=> xa yb; rewrite norm_joinEr //.
(* Goal: forall (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) xa (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))) (_ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) yb (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))), @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) xa yb)) (@mulg (FinGroup.base rT) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK xa) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK yb)) *)
move=> /imset2P[x a Ha Ka ->{xa}] /imset2P[y b Hy Kb ->{yb}].
(* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x a) (@mulg (FinGroup.base gT) y b))) (@mulg (FinGroup.base rT) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) x a)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) y b))) *)
have Hya: y ^ a^-1 \in H by rewrite -mem_conjg (normsP nHK).
(* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) (@mulg (FinGroup.base gT) x a) (@mulg (FinGroup.base gT) y b))) (@mulg (FinGroup.base rT) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) x a)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) y b))) *)
rewrite mulgA -(mulgA x) (conjgCV a y) (mulgA x) -mulgA !pprodmE 1?groupMl //.
(* Goal: @eq (FinGroup.sort (FinGroup.base rT)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH (@mulg (FinGroup.base gT) x (@conjg gT y (@invg (FinGroup.base gT) a)))) (@mfun gT rT (@gval gT K) fK (@mulg (FinGroup.base gT) a b))) (@mulg (FinGroup.base rT) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH y) (@mfun gT rT (@gval gT K) fK b))) *)
by rewrite morphM // actf ?groupV ?morphV // morphM // !mulgA mulgKV invgK.
Qed.
Canonical pprodm_morphism := Morphism pprodmM.
Lemma morphim_pprodm A B :
A \subset H -> B \subset K -> f @* (A * B) = fH @* A * fK @* B.
Lemma morphim_pprodml A : A \subset H -> f @* A = fH @* A.
Proof.
(* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK)) A) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) A) *)
by move=> sAH; rewrite -{1}(mulg1 A) morphim_pprodm ?sub1G // morphim1 mulg1.
Qed.
Lemma morphim_pprodmr B : B \subset K -> f @* B = fK @* 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 K)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK)) B) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) B) *)
by move=> sBK; rewrite -{1}(mul1g B) morphim_pprodm ?sub1G // morphim1 mul1g.
Qed.
Lemma ker_pprodm : 'ker f = [set x * a^-1 | x in H, a in K & fH x == fK a].
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))) (@Imset.imset2 (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @mulg (FinGroup.base gT) x (@invg (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))) (fun x : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@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)) (@gval gT K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a))))))) *)
apply/setP=> y; rewrite 3!inE {1}norm_joinEr //=.
(* Goal: @eq bool (andb (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K))))) (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK y) (oneg (FinGroup.base rT)))) (@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)) (@Imset.imset2 (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x a : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x (@invg (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 H))) (fun x : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : FinGroup.arg_sort (FinGroup.base gT) => andb (@in_mem (FinGroup.arg_sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)))))))))) *)
apply/andP/imset2P=> [[/mulsgP[x a Hx Ka ->{y}]]|[x a Hx]].
(* Goal: forall (_ : is_true (@in_mem (Finite.sort (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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : FinGroup.arg_sort (FinGroup.base gT) => andb (@in_mem (FinGroup.arg_sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)))))))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mulg (FinGroup.base gT) x (@invg (FinGroup.base gT) a))), and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))) (is_true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK y) (oneg (FinGroup.base rT)))) *)
(* Goal: forall _ : is_true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) x a)) (oneg (FinGroup.base rT))), @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (fun x a : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x (@invg (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 H))) (fun x : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : FinGroup.arg_sort (FinGroup.base gT) => andb (@in_mem (FinGroup.arg_sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)))))) (@mulg (FinGroup.base gT) x a) *)
rewrite pprodmE // => fxa1.
(* Goal: forall (_ : is_true (@in_mem (Finite.sort (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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : FinGroup.arg_sort (FinGroup.base gT) => andb (@in_mem (FinGroup.arg_sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)))))))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mulg (FinGroup.base gT) x (@invg (FinGroup.base gT) a))), and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))) (is_true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK y) (oneg (FinGroup.base rT)))) *)
(* Goal: @imset2_spec (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (fun x a : FinGroup.arg_sort (FinGroup.base gT) => @mulg (FinGroup.base gT) x (@invg (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 H))) (fun x : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : FinGroup.arg_sort (FinGroup.base gT) => andb (@in_mem (FinGroup.arg_sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)))))) (@mulg (FinGroup.base gT) x a) *)
by exists x a^-1; rewrite ?invgK // inE groupVr ?morphV // eq_mulgV1 invgK.
(* Goal: forall (_ : is_true (@in_mem (Finite.sort (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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : FinGroup.arg_sort (FinGroup.base gT) => andb (@in_mem (FinGroup.arg_sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)))))))) (_ : @eq (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mulg (FinGroup.base gT) x (@invg (FinGroup.base gT) a))), and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) y (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))) (is_true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK y) (oneg (FinGroup.base rT)))) *)
case/setIdP=> Kx /eqP fx ->{y}.
(* Goal: and (is_true (@in_mem (FinGroup.arg_sort (FinGroup.base gT)) (@mulg (FinGroup.base gT) x (@invg (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)) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))))) (is_true (@eq_op (Finite.eqType (FinGroup.finType (FinGroup.base rT))) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK (@mulg (FinGroup.base gT) x (@invg (FinGroup.base gT) a))) (oneg (FinGroup.base rT)))) *)
by rewrite mem_imset2 ?pprodmE ?groupV ?morphV // fx mulgV.
Qed.
Lemma injm_pprodm :
'injm f = [&& 'injm fH, 'injm fK & fH @* H :&: fK @* K == fH @* 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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT K))))) *)
apply/idP/and3P=> [injf | [injfH injfK]].
(* Goal: forall _ : is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) *)
(* Goal: and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.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 (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT K)))) *)
rewrite eq_sym -{1}morphimIdom -(morphim_pprodml (subsetIl _ _)) injmI //.
(* Goal: forall _ : is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) *)
(* Goal: and3 (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT))))))) (is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.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 (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT (@joing_group gT (@gval gT H) (@gval gT K))) pprodm_morphism (@MorPhantom gT rT (@mfun gT rT (@gval gT (@joing_group gT (@gval gT H) (@gval gT K))) pprodm_morphism)) (@gval gT H)) (@morphim gT rT (@gval gT (@joing_group gT (@gval gT H) (@gval gT K))) pprodm_morphism (@MorPhantom gT rT (@mfun gT rT (@gval gT (@joing_group gT (@gval gT H) (@gval gT K))) pprodm_morphism)) (@gval gT K))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))))) *)
rewrite morphim_pprodml // morphim_pprodmr //=; split=> //.
(* Goal: forall _ : is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) *)
(* 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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
(* 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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
apply/injmP=> x y Hx Hy /=; rewrite -!pprodmEl //.
(* Goal: forall _ : is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) *)
(* 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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
(* Goal: forall _ : @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK x) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK y), @eq (FinGroup.arg_sort (FinGroup.base gT)) x y *)
by apply: (injmP injf); rewrite ?mem_gen ?inE ?Hx ?Hy.
(* Goal: forall _ : is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) *)
(* 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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (FinGroup.arg_sort (FinGroup.base gT)) (predPredType (FinGroup.arg_sort (FinGroup.base gT))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
apply/injmP=> a b Ka Kb /=; rewrite -!pprodmEr //.
(* Goal: forall _ : is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) *)
(* Goal: forall _ : @eq (FinGroup.sort (FinGroup.base rT)) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK a) (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK b), @eq (FinGroup.arg_sort (FinGroup.base gT)) a b *)
by apply: (injmP injf); rewrite ?mem_gen //; apply/setUP; right.
(* Goal: forall _ : is_true (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@joing gT (@gval gT H) (@gval gT K)) pprodm_morphism (@MorPhantom gT rT (@pprodm (@gval gT H) (@gval gT K) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK) nHK actf eqfHK))))) (@mem (Finite.sort (FinGroup.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)))))) *)
move/eqP=> fHK; rewrite ker_pprodm; apply/subsetP=> y.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) y (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@Imset.imset2 (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun x a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @mulg (FinGroup.base gT) x (@invg (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))) (fun x : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun a : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@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)) (@gval gT K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a)))))))))), 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)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
case/imset2P=> x a Hx /setIdP[Ka /eqP fxa] ->.
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x (@invg (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)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
have: fH x \in fH @* K by rewrite -fHK inE {2}fxa !mem_morphim.
(* Goal: forall _ : is_true (@in_mem (FinGroup.sort (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mem (Finite.sort (FinGroup.finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT K))))), is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x (@invg (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)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
case/morphimP=> z Hz Kz /(injmP injfH) def_x.
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x (@invg (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)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
rewrite def_x // eqfHK ?inE ?Hz // in fxa.
(* Goal: is_true (@in_mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mulg (FinGroup.base gT) x (@invg (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)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) *)
by rewrite def_x // (injmP injfK _ _ Kz Ka fxa) mulgV set11.
Qed.
End Props.
Section Sdprodm.
Variables H K G : {group gT}.
Variables (fH : {morphism H >-> rT}) (fK : {morphism K >-> rT}).
Hypothesis eqHK_G : H ><| K = G.
Hypothesis actf : {in H & K, morph_act 'J 'J fH fK}.
Lemma sdprodm_norm : K \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)) (@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))))) *)
by case/sdprodP: eqHK_G.
Qed.
Lemma sdprodm_sub : G \subset H <*> K.
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)) (@joing gT (@gval gT H) (@gval gT K))))) *)
by case/sdprodP: eqHK_G => _ <- nHK _; rewrite norm_joinEr.
Qed.
Lemma sdprodm_eqf : {in H :&: K, fH =1 fK}.
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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK x)) (inPhantom (@eqfun (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK))) *)
by case/sdprodP: eqHK_G => _ _ _ -> _ /set1P->; rewrite !morph1.
Qed.
Definition sdprodm :=
restrm sdprodm_sub (pprodm sdprodm_norm actf sdprodm_eqf).
Canonical sdprodm_morphism := Eval hnf in [morphism of sdprodm].
Lemma sdprodmE a b : a \in H -> b \in K -> sdprodm (a * b) = fH a * fK b.
Proof.
(* Goal: forall (_ : 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)) (@gval gT H))))) (_ : is_true (@in_mem (Finite.sort (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 K))))), @eq (FinGroup.sort (FinGroup.base rT)) (sdprodm (@mulg (FinGroup.base gT) a b)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH a) (@mfun gT rT (@gval gT K) fK b)) *)
exact: pprodmE.
Qed.
Lemma sdprodmEl a : a \in H -> sdprodm a = fH a.
Proof.
(* Goal: forall _ : 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)) (@gval gT H)))), @eq (FinGroup.sort (FinGroup.base rT)) (sdprodm a) (@mfun gT rT (@gval gT H) fH a) *)
exact: pprodmEl.
Qed.
Lemma sdprodmEr b : b \in K -> sdprodm b = fK b.
Proof.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (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 K)))), @eq (FinGroup.sort (FinGroup.base rT)) (sdprodm b) (@mfun gT rT (@gval gT K) fK b) *)
exact: pprodmEr.
Qed.
Lemma morphim_sdprodm A B :
A \subset H -> B \subset K -> sdprodm @* (A * B) = fH @* A * fK @* 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)) (@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)) (@gval gT K))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) sdprodm_morphism (@MorPhantom gT rT sdprodm) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) A) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) B)) *)
move=> sAH sBK; rewrite morphim_restrm /= (setIidPr _) ?morphim_pprodm //.
(* 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 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 case/sdprodP: eqHK_G => _ <- _ _; apply: mulgSS.
Qed.
Lemma im_sdprodm : sdprodm @* G = fH @* H * fK @* K.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) sdprodm_morphism (@MorPhantom gT rT sdprodm) (@gval gT G)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) *)
by rewrite -morphim_sdprodm //; case/sdprodP: eqHK_G => _ ->.
Qed.
Lemma morphim_sdprodml A : A \subset H -> sdprodm @* A = fH @* A.
Proof.
(* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) sdprodm_morphism (@MorPhantom gT rT sdprodm) A) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) A) *)
by move=> sHA; rewrite -{1}(mulg1 A) morphim_sdprodm ?sub1G // morphim1 mulg1.
Qed.
Lemma morphim_sdprodmr B : B \subset K -> sdprodm @* B = fK @* 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 K)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) sdprodm_morphism (@MorPhantom gT rT sdprodm) B) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) B) *)
by move=> sBK; rewrite -{1}(mul1g B) morphim_sdprodm ?sub1G // morphim1 mul1g.
Qed.
Lemma ker_sdprodm :
'ker sdprodm = [set a * b^-1 | a in H, b in K & fH a == fK b].
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT rT (@gval gT G) sdprodm_morphism (@MorPhantom gT rT sdprodm)) (@Imset.imset2 (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun a b : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @mulg (FinGroup.base gT) a (@invg (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 H))) (fun a : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun b : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH a) (@mfun gT rT (@gval gT K) fK b))))))) *)
rewrite ker_restrm (setIidPr _) ?subIset ?ker_pprodm //; apply/orP; left.
(* 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 (@gval gT H) (@gval gT K)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
by case/sdprodP: eqHK_G => _ <- nHK _; rewrite norm_joinEr.
Qed.
Lemma injm_sdprodm :
'injm sdprodm = [&& 'injm fH, 'injm fK & fH @* H :&: fK @* K == 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)) (@ker gT rT (@gval gT G) sdprodm_morphism (@MorPhantom gT rT sdprodm)))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) *)
rewrite ker_sdprodm -(ker_pprodm sdprodm_norm actf sdprodm_eqf) injm_pprodm.
(* Goal: @eq bool (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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) *)
congr [&& _, _ & _ == _]; have [_ _ _ tiHK] := sdprodP eqHK_G.
(* Goal: @eq (Equality.sort (set_of_eqType (FinGroup.finType (FinGroup.base rT)))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT K)) (oneg (group_set_of_baseGroupType (FinGroup.base rT))) *)
by rewrite -morphimIdom tiHK morphim1.
Qed.
End Sdprodm.
Section Cprodm.
Variables H K G : {group gT}.
Variables (fH : {morphism H >-> rT}) (fK : {morphism K >-> rT}).
Hypothesis eqHK_G : H \* K = G.
Hypothesis cfHK : fK @* K \subset 'C(fH @* H).
Hypothesis eqfHK : {in H :&: K, fH =1 fK}.
Lemma cprodm_norm : K \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)) (@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))))) *)
by rewrite cents_norm //; case/cprodP: eqHK_G.
Qed.
Lemma cprodm_sub : G \subset H <*> K.
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)) (@joing gT (@gval gT H) (@gval gT K))))) *)
by case/cprodP: eqHK_G => _ <- cHK; rewrite cent_joinEr.
Qed.
Lemma cprodm_actf : {in H & K, morph_act 'J 'J fH fK}.
Proof.
(* Goal: @prop_in11 (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT 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))) (fun x a : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.arg_sort (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH (@act gT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (FinGroup.arg_sort (FinGroup.base gT)) (conjg_action gT) x a)) (@act rT (@setTfor (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (FinGroup.arg_sort (FinGroup.base rT)) (conjg_action rT) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK a))) (inPhantom (@morph_act gT rT (@setTfor (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@setTfor (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (FinGroup.arg_sort (FinGroup.base gT)) (FinGroup.arg_sort (FinGroup.base rT)) (conjg_action gT) (conjg_action rT) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK))) *)
case/cprodP: eqHK_G => _ _ cHK a b Ha Kb /=.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH (@conjg gT a b)) (@conjg rT (@mfun gT rT (@gval gT H) fH a) (@mfun gT rT (@gval gT K) fK b)) *)
by rewrite /conjg -(centsP cHK b) // -(centsP cfHK (fK b)) ?mulKg ?mem_morphim.
Qed.
Definition cprodm := restrm cprodm_sub (pprodm cprodm_norm cprodm_actf eqfHK).
Canonical cprodm_morphism := Eval hnf in [morphism of cprodm].
Lemma cprodmE a b : a \in H -> b \in K -> cprodm (a * b) = fH a * fK b.
Proof.
(* Goal: forall (_ : 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)) (@gval gT H))))) (_ : is_true (@in_mem (Finite.sort (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 K))))), @eq (FinGroup.sort (FinGroup.base rT)) (cprodm (@mulg (FinGroup.base gT) a b)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH a) (@mfun gT rT (@gval gT K) fK b)) *)
exact: pprodmE.
Qed.
Lemma cprodmEl a : a \in H -> cprodm a = fH a.
Proof.
(* Goal: forall _ : 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)) (@gval gT H)))), @eq (FinGroup.sort (FinGroup.base rT)) (cprodm a) (@mfun gT rT (@gval gT H) fH a) *)
exact: pprodmEl.
Qed.
Lemma cprodmEr b : b \in K -> cprodm b = fK b.
Proof.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (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 K)))), @eq (FinGroup.sort (FinGroup.base rT)) (cprodm b) (@mfun gT rT (@gval gT K) fK b) *)
exact: pprodmEr.
Qed.
Lemma morphim_cprodm A B :
A \subset H -> B \subset K -> cprodm @* (A * B) = fH @* A * fK @* 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)) (@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)) (@gval gT K))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) cprodm_morphism (@MorPhantom gT rT cprodm) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) A) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) B)) *)
move=> sAH sBK; rewrite morphim_restrm /= (setIidPr _) ?morphim_pprodm //.
(* 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 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 case/cprodP: eqHK_G => _ <- _; apply: mulgSS.
Qed.
Lemma im_cprodm : cprodm @* G = fH @* H * fK @* K.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) cprodm_morphism (@MorPhantom gT rT cprodm) (@gval gT G)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) *)
by have [_ defHK _] := cprodP eqHK_G; rewrite -{2}defHK morphim_cprodm.
Qed.
Lemma morphim_cprodml A : A \subset H -> cprodm @* A = fH @* A.
Proof.
(* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) cprodm_morphism (@MorPhantom gT rT cprodm) A) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) A) *)
by move=> sHA; rewrite -{1}(mulg1 A) morphim_cprodm ?sub1G // morphim1 mulg1.
Qed.
Lemma morphim_cprodmr B : B \subset K -> cprodm @* B = fK @* 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 K)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) cprodm_morphism (@MorPhantom gT rT cprodm) B) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) B) *)
by move=> sBK; rewrite -{1}(mul1g B) morphim_cprodm ?sub1G // morphim1 mul1g.
Qed.
Lemma ker_cprodm : 'ker cprodm = [set a * b^-1 | a in H, b in K & fH a == fK b].
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT rT (@gval gT G) cprodm_morphism (@MorPhantom gT rT cprodm)) (@Imset.imset2 (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun a b : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @mulg (FinGroup.base gT) a (@invg (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 H))) (fun a : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun b : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH a) (@mfun gT rT (@gval gT K) fK b))))))) *)
rewrite ker_restrm (setIidPr _) ?subIset ?ker_pprodm //; apply/orP; left.
(* 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 (@gval gT H) (@gval gT K)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT G)))) *)
by case/cprodP: eqHK_G => _ <- cHK; rewrite cent_joinEr.
Qed.
Lemma injm_cprodm :
'injm cprodm = [&& 'injm fH, 'injm fK & fH @* H :&: fK @* K == fH @* 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)) (@ker gT rT (@gval gT G) cprodm_morphism (@MorPhantom gT rT cprodm)))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT K))))) *)
by rewrite ker_cprodm -(ker_pprodm cprodm_norm cprodm_actf eqfHK) injm_pprodm.
Qed.
End Cprodm.
Section Dprodm.
Variables G H K : {group gT}.
Variables (fH : {morphism H >-> rT}) (fK : {morphism K >-> rT}).
Hypothesis eqHK_G : H \x K = G.
Hypothesis cfHK : fK @* K \subset 'C(fH @* H).
Lemma dprodm_cprod : H \* K = G.
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (FinGroup.arg_sort (FinGroup.base gT)))) (central_product gT (@gval gT H) (@gval gT K)) (@gval gT G) *)
by rewrite -eqHK_G /dprod; case/dprodP: eqHK_G => _ _ _ ->; rewrite subxx.
Qed.
Lemma dprodm_eqf : {in H :&: K, fH =1 fK}.
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)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@gval gT K)))) (fun x : FinGroup.arg_sort (FinGroup.base gT) => @eq (FinGroup.sort (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH x) (@mfun gT rT (@gval gT K) fK x)) (inPhantom (@eqfun (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (@mfun gT rT (@gval gT H) fH) (@mfun gT rT (@gval gT K) fK))) *)
by case/dprodP: eqHK_G => _ _ _ -> _ /set1P->; rewrite !morph1.
Qed.
Definition dprodm := cprodm dprodm_cprod cfHK dprodm_eqf.
Canonical dprodm_morphism := Eval hnf in [morphism of dprodm].
Lemma dprodmE a b : a \in H -> b \in K -> dprodm (a * b) = fH a * fK b.
Proof.
(* Goal: forall (_ : 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)) (@gval gT H))))) (_ : is_true (@in_mem (Finite.sort (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 K))))), @eq (FinGroup.sort (FinGroup.base rT)) (dprodm (@mulg (FinGroup.base gT) a b)) (@mulg (FinGroup.base rT) (@mfun gT rT (@gval gT H) fH a) (@mfun gT rT (@gval gT K) fK b)) *)
exact: pprodmE.
Qed.
Lemma dprodmEl a : a \in H -> dprodm a = fH a.
Proof.
(* Goal: forall _ : 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)) (@gval gT H)))), @eq (FinGroup.sort (FinGroup.base rT)) (dprodm a) (@mfun gT rT (@gval gT H) fH a) *)
exact: pprodmEl.
Qed.
Lemma dprodmEr b : b \in K -> dprodm b = fK b.
Proof.
(* Goal: forall _ : is_true (@in_mem (Finite.sort (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 K)))), @eq (FinGroup.sort (FinGroup.base rT)) (dprodm b) (@mfun gT rT (@gval gT K) fK b) *)
exact: pprodmEr.
Qed.
Lemma morphim_dprodm A B :
A \subset H -> B \subset K -> dprodm @* (A * B) = fH @* A * fK @* 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)) (@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)) (@gval gT K))))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) dprodm_morphism (@MorPhantom gT rT dprodm) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) A) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) B)) *)
exact: morphim_cprodm.
Qed.
Lemma im_dprodm : dprodm @* G = fH @* H * fK @* K.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) dprodm_morphism (@MorPhantom gT rT dprodm) (@gval gT G)) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) *)
exact: im_cprodm.
Qed.
Lemma morphim_dprodml A : A \subset H -> dprodm @* A = fH @* A.
Proof.
(* Goal: forall _ : is_true (@subset (FinGroup.arg_finType (FinGroup.base gT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) A)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) dprodm_morphism (@MorPhantom gT rT dprodm) A) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) A) *)
exact: morphim_cprodml.
Qed.
Lemma morphim_dprodmr B : B \subset K -> dprodm @* B = fK @* 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 K)))), @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) dprodm_morphism (@MorPhantom gT rT dprodm) B) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) B) *)
exact: morphim_cprodmr.
Qed.
Lemma ker_dprodm : 'ker dprodm = [set a * b^-1 | a in H, b in K & fH a == fK b].
Proof.
(* Goal: @eq (@set_of (FinGroup.arg_finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))))) (@ker gT rT (@gval gT G) dprodm_morphism (@MorPhantom gT rT dprodm)) (@Imset.imset2 (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.finType (FinGroup.base gT)) (fun a b : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => @mulg (FinGroup.base gT) a (@invg (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 H))) (fun a : 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)) (@SetDef.finset (FinGroup.arg_finType (FinGroup.base gT)) (fun b : Finite.sort (FinGroup.arg_finType (FinGroup.base gT)) => andb (@in_mem (Finite.sort (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 K)))) (@eq_op (FinGroup.eqType (FinGroup.base rT)) (@mfun gT rT (@gval gT H) fH a) (@mfun gT rT (@gval gT K) fK b))))))) *)
exact: ker_cprodm.
Qed.
Lemma injm_dprodm :
'injm dprodm = [&& 'injm fH, 'injm fK & fH @* H :&: fK @* K == 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)) (@ker gT rT (@gval gT G) dprodm_morphism (@MorPhantom gT rT dprodm)))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) *)
rewrite injm_cprodm -(morphimIdom fH K).
(* Goal: @eq bool (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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@setI (FinGroup.arg_finType (FinGroup.base gT)) (@gval gT H) (@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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (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)) (@ker gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base gT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base gT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base gT)) (oneg (group_set_baseGroupType (FinGroup.base gT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim gT rT (@gval gT K) fK (@MorPhantom gT rT (@mfun gT rT (@gval gT K) fK)) (@gval gT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) *)
by case/dprodP: eqHK_G => _ _ _ ->; rewrite morphim1.
Qed.
End Dprodm.
Lemma isog_dprod A B G C D L :
A \x B = G -> C \x D = L -> isog A C -> isog B D -> isog G L.
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 rT)) (Phant (FinGroup.arg_sort (FinGroup.base rT)))) (direct_product rT C D) (@gval rT L)) (_ : is_true (@isog gT rT A C)) (_ : is_true (@isog gT rT B D)), is_true (@isog gT rT (@gval gT G) (@gval rT L)) *)
move=> defG {C D} /dprodP[[C D -> ->] defL cCD trCD].
(* Goal: forall (_ : is_true (@isog gT rT A (@gval rT C))) (_ : is_true (@isog gT rT B (@gval rT D))), is_true (@isog gT rT (@gval gT G) (@gval rT L)) *)
case/dprodP: defG (defG) => {A B} [[A B -> ->] defG _ _] dG defC defD.
(* Goal: is_true (@isog gT rT (@gval gT G) (@gval rT L)) *)
case/isogP: defC defL cCD trCD => fA injfA <-{C}.
(* Goal: forall (_ : @eq (FinGroup.sort (group_set_of_baseGroupType (FinGroup.base rT))) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT A) fA (@MorPhantom gT rT (@mfun gT rT (@gval gT A) fA)) (@gval gT A)) (@gval rT D)) (@gval rT L)) (_ : 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 D))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base rT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base rT)) (@centraliser rT (@morphim gT rT (@gval gT A) fA (@MorPhantom gT rT (@mfun gT rT (@gval gT A) fA)) (@gval gT A))))))) (_ : @eq (@set_of (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (@setI (FinGroup.arg_finType (FinGroup.base rT)) (@morphim gT rT (@gval gT A) fA (@MorPhantom gT rT (@mfun gT rT (@gval gT A) fA)) (@gval gT A)) (@gval rT D)) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))), is_true (@isog gT rT (@gval gT G) (@gval rT L)) *)
case/isogP: defD => fB injfB <-{D} defL cCD trCD.
(* Goal: is_true (@isog gT rT (@gval gT G) (@gval rT L)) *)
apply/isogP; exists (dprodm_morphism dG cCD).
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) (@dprodm_morphism G A B fA fB dG cCD) (@MorPhantom gT rT (@mfun gT rT (@gval gT G) (@dprodm_morphism G A B fA fB dG cCD))) (@gval gT G)) (@gval rT L) *)
(* 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 rT (@gval gT G) (@dprodm_morphism G A B fA fB dG cCD) (@MorPhantom gT rT (@mfun gT rT (@gval gT G) (@dprodm_morphism G A B fA fB dG cCD)))))) (@mem (Finite.sort (FinGroup.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 injm_dprodm injfA injfB trCD eqxx.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim gT rT (@gval gT G) (@dprodm_morphism G A B fA fB dG cCD) (@MorPhantom gT rT (@mfun gT rT (@gval gT G) (@dprodm_morphism G A B fA fB dG cCD))) (@gval gT G)) (@gval rT L) *)
by rewrite /= -{2}defG morphim_dprodm.
Qed.
End ProdMorph.
Section ExtSdprodm.
Variables gT aT rT : finGroupType.
Variables (H : {group gT}) (K : {group aT}) (to : groupAction K H).
Variables (fH : {morphism H >-> rT}) (fK : {morphism K >-> rT}).
Hypothesis actf : {in H & K, morph_act to 'J fH fK}.
Local Notation fsH := (fH \o invm (injm_sdpair1 to)).
Local Notation fsK := (fK \o invm (injm_sdpair2 to)).
Let DgH := sdpair1 to @* H.
Let DgK := sdpair2 to @* K.
Lemma xsdprodm_dom1 : DgH \subset 'dom fsH.
Proof.
(* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))) DgH)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))))))) *)
by rewrite ['dom _]morphpre_invm.
Qed.
Local Notation gH := (restrm xsdprodm_dom1 fsH).
Lemma xsdprodm_dom2 : DgK \subset 'dom fsK.
Proof.
(* Goal: is_true (@subset (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))) DgK)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) aT (@mfun (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))) (@gval aT K)) (@comp_morphism (@sdprod_groupType aT gT K H to) aT rT (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K) K (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) fK) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))))))) *)
by rewrite ['dom _]morphpre_invm.
Qed.
Local Notation gK := (restrm xsdprodm_dom2 fsK).
Lemma im_sdprodm1 : gH @* DgH = fH @* H.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim (@sdprod_groupType aT gT K H to) rT DgH (@restrm_morphism (@sdprod_groupType aT gT K H to) rT DgH (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) xsdprodm_dom1 (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH)) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@restrm (@sdprod_groupType aT gT K H to) rT DgH (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) xsdprodm_dom1 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) DgH) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) *)
by rewrite morphim_restrm setIid morphim_comp im_invm.
Qed.
Lemma im_sdprodm2 : gK @* DgK = fK @* K.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim (@sdprod_groupType aT gT K H to) rT DgK (@restrm_morphism (@sdprod_groupType aT gT K H to) rT DgK (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) aT (@mfun (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))) (@gval aT K)) (@comp_morphism (@sdprod_groupType aT gT K H to) aT rT (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K) K (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) fK) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))))) xsdprodm_dom2 (@comp_morphism (@sdprod_groupType aT gT K H to) aT rT (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K) K (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) fK)) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@restrm (@sdprod_groupType aT gT K H to) rT DgK (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) aT (@mfun (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))) (@gval aT K)) (@comp_morphism (@sdprod_groupType aT gT K H to) aT rT (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K) K (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) fK) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))))) xsdprodm_dom2 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))))) DgK) (@morphim aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)) (@gval aT K)) *)
by rewrite morphim_restrm setIid morphim_comp im_invm.
Qed.
Lemma xsdprodm_act : {in DgH & DgK, morph_act 'J 'J gH gK}.
Proof.
(* Goal: @prop_in11 (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))) DgH)) (@mem (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.finType (FinGroup.base (@sdprod_groupType aT gT K H to))) DgK)) (fun x a : FinGroup.arg_sort (FinGroup.base (@sdprod_groupType aT gT K H to)) => @eq (FinGroup.arg_sort (FinGroup.base rT)) (@restrm (@sdprod_groupType aT gT K H to) rT DgH (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) xsdprodm_dom1 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))) (@act (@sdprod_groupType aT gT K H to) (@setTfor (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))))) (FinGroup.arg_sort (FinGroup.base (@sdprod_groupType aT gT K H to))) (conjg_action (@sdprod_groupType aT gT K H to)) x a)) (@act rT (@setTfor (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (FinGroup.arg_sort (FinGroup.base rT)) (conjg_action rT) (@restrm (@sdprod_groupType aT gT K H to) rT DgH (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) xsdprodm_dom1 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))) x) (@restrm (@sdprod_groupType aT gT K H to) rT DgK (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) aT (@mfun (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))) (@gval aT K)) (@comp_morphism (@sdprod_groupType aT gT K H to) aT rT (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K) K (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) fK) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))))) xsdprodm_dom2 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))) a))) (inPhantom (@morph_act (@sdprod_groupType aT gT K H to) rT (@setTfor (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))))) (@setTfor (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (FinGroup.arg_sort (FinGroup.base (@sdprod_groupType aT gT K H to))) (FinGroup.arg_sort (FinGroup.base rT)) (conjg_action (@sdprod_groupType aT gT K H to)) (conjg_action rT) (@restrm (@sdprod_groupType aT gT K H to) rT DgH (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) xsdprodm_dom1 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@restrm (@sdprod_groupType aT gT K H to) rT DgK (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) aT (@mfun (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))) (@gval aT K)) (@comp_morphism (@sdprod_groupType aT gT K H to) aT rT (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K) K (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) fK) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))))) xsdprodm_dom2 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))))) *)
move=> fh fk; case/morphimP=> h _ Hh ->{fh}; case/morphimP=> k _ Kk ->{fk}.
(* Goal: @eq (FinGroup.arg_sort (FinGroup.base rT)) (@restrm (@sdprod_groupType aT gT K H to) rT DgH (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) xsdprodm_dom1 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))) (@act (@sdprod_groupType aT gT K H to) (@setTfor (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))))) (FinGroup.arg_sort (FinGroup.base (@sdprod_groupType aT gT K H to))) (conjg_action (@sdprod_groupType aT gT K H to)) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to) h) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to) k))) (@act rT (@setTfor (FinGroup.arg_finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base rT))))) (FinGroup.arg_sort (FinGroup.base rT)) (conjg_action rT) (@restrm (@sdprod_groupType aT gT K H to) rT DgH (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@gval gT H)) (@comp_morphism (@sdprod_groupType aT gT K H to) gT rT (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) H) H (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) fH) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))))) xsdprodm_dom1 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base gT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun gT rT (@gval gT H) fH) (@invm gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to))) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to) h)) (@restrm (@sdprod_groupType aT gT K H to) rT DgK (@dom (@sdprod_groupType aT gT K H to) rT (@morphpre (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) aT (@mfun (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))) (@gval aT K)) (@comp_morphism (@sdprod_groupType aT gT K H to) aT rT (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) K) K (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) fK) (@MorPhantom (@sdprod_groupType aT gT K H to) rT (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))))) xsdprodm_dom2 (@funcomp (FinGroup.sort (FinGroup.base rT)) (FinGroup.arg_sort (FinGroup.base aT)) (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) tt (@mfun aT rT (@gval aT K) fK) (@invm aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to))) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to) k))) *)
by rewrite /= -sdpair_act // /restrm /= !invmE ?actf ?gact_stable.
Qed.
Definition xsdprodm := sdprodm (sdprod_sdpair to) xsdprodm_act.
Canonical xsdprod_morphism := [morphism of xsdprodm].
Lemma im_xsdprodm : xsdprodm @* setT = fH @* H * fK @* K.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base rT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base rT))))) (@morphim (@sdprod_groupType aT gT K H to) rT (@gval (@sdprod_groupType aT gT K H to) (@setT_group (@sdprod_groupType aT gT K H to) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))))))) xsdprod_morphism (@MorPhantom (@sdprod_groupType aT gT K H to) rT xsdprodm) (@setTfor (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))))))) (@mulg (group_set_of_baseGroupType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)) (@gval aT K))) *)
by rewrite -im_sdpair morphim_sdprodm // im_sdprodm1 im_sdprodm2.
Qed.
Lemma injm_xsdprodm :
'injm xsdprodm = [&& 'injm fH, 'injm fK & fH @* H :&: fK @* K == 1].
Proof.
(* Goal: @eq bool (@subset (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@ker (@sdprod_groupType aT gT K H to) rT (@gval (@sdprod_groupType aT gT K H to) (@setT_group (@sdprod_groupType aT gT K H to) (Phant (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))))))) xsdprod_morphism (@MorPhantom (@sdprod_groupType aT gT K H to) rT xsdprodm)))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to)))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (oneg (group_set_baseGroupType (FinGroup.base (@sdprod_groupType aT gT K H to))))))) (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)) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (@mem (Finite.sort (FinGroup.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)))))) (andb (@subset (FinGroup.arg_finType (FinGroup.base aT)) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (@ker aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK))))) (@mem (Finite.sort (FinGroup.arg_finType (FinGroup.base aT))) (predPredType (Finite.sort (FinGroup.arg_finType (FinGroup.base aT)))) (@SetDef.pred_of_set (FinGroup.arg_finType (FinGroup.base aT)) (oneg (group_set_baseGroupType (FinGroup.base aT)))))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)) (@gval aT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) *)
rewrite injm_sdprodm im_sdprodm1 im_sdprodm2 !subG1 /= !ker_restrm !ker_comp.
(* Goal: @eq bool (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (@sdprod_baseFinGroupType aT gT K H to))) (@setI (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@morphim gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@sdpair1 aT gT K H to)) (@gval gT H)) (@morphpre (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@sdpair1 aT gT K H to)) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) gT (@mfun (@sdprod_groupType aT gT K H to) gT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@sdpair1 aT gT K H to)) H)) (@invm_morphism gT (@sdprod_groupType aT gT K H to) H (@sdpair1_morphism aT gT K H to) (@injm_sdpair1 aT gT K H to)))) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))))) (oneg (group_set_of_baseGroupType (@sdprod_baseFinGroupType aT gT K H to)))) (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (@sdprod_baseFinGroupType aT gT K H to))) (@setI (FinGroup.arg_finType (FinGroup.base (@sdprod_groupType aT gT K H to))) (@morphim aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@sdpair2 aT gT K H to)) (@gval aT K)) (@morphpre (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@sdpair2 aT gT K H to)) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)) (@MorPhantom (@sdprod_groupType aT gT K H to) aT (@mfun (@sdprod_groupType aT gT K H to) aT (@gval (@sdprod_groupType aT gT K H to) (@morphim_group aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@sdpair2 aT gT K H to)) K)) (@invm_morphism aT (@sdprod_groupType aT gT K H to) K (@sdpair2_morphism aT gT K H to) (@injm_sdpair2 aT gT K H to)))) (@ker aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK))))) (oneg (group_set_of_baseGroupType (@sdprod_baseFinGroupType aT gT K H to)))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)) (@gval aT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base aT))) (@ker aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK))) (oneg (group_set_of_baseGroupType (FinGroup.base aT)))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)) (@gval aT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) *)
rewrite !morphpre_invm !morphimIim.
(* Goal: @eq bool (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (@sdprod_baseFinGroupType aT gT K H to))) (@morphim gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to) (@MorPhantom gT (@sdprod_groupType aT gT K H to) (@mfun gT (@sdprod_groupType aT gT K H to) (@gval gT H) (@sdpair1_morphism aT gT K H to))) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)))) (oneg (group_set_of_baseGroupType (@sdprod_baseFinGroupType aT gT K H to)))) (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (@sdprod_baseFinGroupType aT gT K H to))) (@morphim aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to) (@MorPhantom aT (@sdprod_groupType aT gT K H to) (@mfun aT (@sdprod_groupType aT gT K H to) (@gval aT K) (@sdpair2_morphism aT gT K H to))) (@ker aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)))) (oneg (group_set_of_baseGroupType (@sdprod_baseFinGroupType aT gT K H to)))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)) (@gval aT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base gT))) (@ker gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH))) (oneg (group_set_of_baseGroupType (FinGroup.base gT)))) (andb (@eq_op (set_of_eqType (FinGroup.arg_finType (FinGroup.base aT))) (@ker aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK))) (oneg (group_set_of_baseGroupType (FinGroup.base aT)))) (@eq_op (set_of_eqType (FinGroup.finType (FinGroup.base rT))) (@setI (FinGroup.finType (FinGroup.base rT)) (@morphim gT rT (@gval gT H) fH (@MorPhantom gT rT (@mfun gT rT (@gval gT H) fH)) (@gval gT H)) (@morphim aT rT (@gval aT K) fK (@MorPhantom aT rT (@mfun aT rT (@gval aT K) fK)) (@gval aT K))) (oneg (group_set_of_baseGroupType (FinGroup.base rT)))))) *)
by rewrite !morphim_injm_eq1 ?subsetIl ?injm_sdpair1 ?injm_sdpair2.
Qed.
End ExtSdprodm.
Section DirprodIsom.
Variable gT : finGroupType.
Implicit Types G H : {group gT}.
Definition mulgm : gT * gT -> _ := prod_curry mulg.
Lemma imset_mulgm (A B : {set gT}) : mulgm @: setX A B = A * B.
Proof.
(* Goal: @eq (@set_of (FinGroup.finType (FinGroup.base gT)) (Phant (Finite.sort (FinGroup.finType (FinGroup.base gT))))) (@Imset.imset (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT))) (FinGroup.finType (FinGroup.base gT)) mulgm (@mem (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)))) (predPredType (Finite.sort (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT))))) (@SetDef.pred_of_set (prod_finType (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT))) (@setX (FinGroup.arg_finType (FinGroup.base gT)) (FinGroup.arg_finType (FinGroup.base gT)) A B)))) (@mulg (group_set_of_baseGroupType (FinGroup.base gT)) A B) *)
by rewrite -curry_imset2X.
Qed.
Lemma mulgmP H1 H2 G : reflect (H1 \x H2 = G) (misom (setX H1 H2) G mulgm).
End DirprodIsom.
Arguments mulgmP {gT H1 H2 G}.
Prenex Implicits mulgm.
|
Set Implicit Arguments.
Unset Strict Implicit.
Require Export Sub_group.
Require Export Group_util.
Section Def.
Variable G : GROUP.
Variable H : subgroup G.
Definition normal :=
forall x y : G,
in_part y H ->
in_part (sgroup_law _ x (sgroup_law _ y (group_inverse _ x))) H.
Hypothesis Hnormal : normal.
Definition group_quo_eq (x y : G) :=
in_part (sgroup_law _ x (group_inverse _ y)) H.
Definition group_quo_eqrel : Relation G.
Proof.
(* Goal: Relation (sgroup_set (monoid_sgroup (group_monoid G))) *)
apply (Build_Relation (E:=G) (Rel_fun:=group_quo_eq)).
(* Goal: @rel_compatible (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eq *)
red in |- *.
(* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y y') (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) group_quo_eq x y), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) group_quo_eq x' y' *)
unfold app_rel, group_quo_eq in |- *.
(* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x x') (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) y y') (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x' (group_inverse G y')) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros x x' y y' H' H'0 H'1; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x' (group_inverse G y')) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (group_inverse G y)); auto with algebra.
Qed.
Lemma group_quo_eqrel_equiv : equivalence group_quo_eqrel.
Proof.
(* Goal: @equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
red in Hnormal.
(* Goal: @equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
red in |- *.
(* Goal: and (@reflexive (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) (@partial_equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) *)
split; [ try assumption | idtac ].
(* Goal: @partial_equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @reflexive (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
red in |- *.
(* Goal: @partial_equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) x x *)
intros x; red in |- *.
(* Goal: @partial_equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel x x *)
simpl in |- *.
(* Goal: @partial_equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: group_quo_eq x x *)
unfold app_rel, group_quo_eq in |- *.
(* Goal: @partial_equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (sgroup_law G (monoid_unit G) (group_inverse G x))); auto with algebra.
(* Goal: @partial_equivalence (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
red in |- *.
(* Goal: and (@transitive (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) (@symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel)) *)
split; [ try assumption | idtac ].
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @transitive (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
red in |- *.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) x y) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) y z), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) x z *)
simpl in |- *.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) group_quo_eq x y) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) group_quo_eq y z), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) group_quo_eq x z *)
unfold app_rel, group_quo_eq in |- *.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: forall (x y z : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G z)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G z)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros x y z H' H'0; try assumption.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G z)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G x (group_inverse G y)) (sgroup_law G y (group_inverse G z))); auto with algebra.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G z))) *)
apply Trans with (sgroup_law G x (sgroup_law G (group_inverse G y) (sgroup_law G y (group_inverse G z)))); auto with algebra.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G z)))) *)
apply Trans with (sgroup_law G x (sgroup_law G (sgroup_law G (group_inverse G y) y) (group_inverse G z))); auto with algebra.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) y) (group_inverse G z))) *)
apply Trans with (sgroup_law G x (sgroup_law G (monoid_unit G) (group_inverse G z))); auto with algebra.
(* Goal: @symmetric (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) *)
red in |- *.
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) x y), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (@Rel_fun (sgroup_set (monoid_sgroup (group_monoid G))) group_quo_eqrel) y x *)
simpl in |- *.
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) group_quo_eq x y), @app_rel (Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) group_quo_eq y x *)
unfold app_rel, group_quo_eq in |- *.
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros x y H'; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (group_inverse G (sgroup_law G x (group_inverse G y))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G x)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y))) *)
apply Trans with (sgroup_law G (group_inverse G (group_inverse G y)) (group_inverse G x)); auto with algebra.
Qed.
Definition group_quo_set := quotient G group_quo_eqrel group_quo_eqrel_equiv.
Lemma normal_com_in :
forall x y : G, in_part (sgroup_law _ x y) H -> in_part (sgroup_law _ y x) H.
Proof.
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros x y H'; try assumption.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G y (sgroup_law G (sgroup_law G x y) (group_inverse G y))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y x) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G y))) *)
apply SGROUP_comp; auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G y)) *)
apply Trans with (sgroup_law G x (sgroup_law G y (group_inverse G y))); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y))) *)
apply Trans with (sgroup_law G x (monoid_unit G)); auto with algebra.
Qed.
Hint Immediate normal_com_in: algebra.
Set Strict Implicit.
Unset Implicit Arguments.
Definition group_quo : group.
Proof.
(* Goal: group *)
apply (BUILD_GROUP (E:=group_quo_set) (genlaw:=fun x y : G => sgroup_law _ x y) (e:=monoid_unit G) (geninv:=fun x : G => group_inverse _ x)).
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: forall (x x' y y' : Carrier group_quo_set) (_ : @Equal group_quo_set x x') (_ : @Equal group_quo_set y y'), @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) x' y') *)
simpl in |- *; auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : group_quo_eq x x') (_ : group_quo_eq y y'), group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) x' y') *)
unfold app_rel, group_quo_eq in |- *.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: forall (x x' y y' : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x')) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))) (_ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H)))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros x x' y y' H' H'0; try assumption.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (group_inverse G (sgroup_law G x' y')))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y')))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply normal_com_in.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x' y'))) x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G y (sgroup_law G (group_inverse G y') (group_inverse G x'))) x); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y') (group_inverse G x'))) x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G (sgroup_law G y (group_inverse G y')) (group_inverse G x')) x); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y (group_inverse G y')) (group_inverse G x')) x) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G y (group_inverse G y')) (sgroup_law G (group_inverse G x') x)); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: forall x y z : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
intros x y z; try assumption.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
simpl in |- *; auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) *)
unfold app_rel, group_quo_eq in |- *.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G (sgroup_law G x y) z) (sgroup_law G (group_inverse G (sgroup_law G y z)) (group_inverse G x))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (group_inverse G x))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G (sgroup_law G x y) z) (sgroup_law G (sgroup_law G (group_inverse G z) (group_inverse G y)) (group_inverse G x))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) z) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (group_inverse G y)) (group_inverse G x))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G x (sgroup_law G y z)) (sgroup_law G (group_inverse G z) (sgroup_law G (group_inverse G y) (group_inverse G x)))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (sgroup_law G (sgroup_law G y z) (sgroup_law G (group_inverse G z) (sgroup_law G (group_inverse G y) (group_inverse G x))))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) y z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G z (sgroup_law G (group_inverse G z) (sgroup_law G (group_inverse G y) (group_inverse G x)))))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) z (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G z) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G (sgroup_law G z (group_inverse G z)) (sgroup_law G (group_inverse G y) (group_inverse G x))))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) z (group_inverse G z)) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G (monoid_unit G) (sgroup_law G (group_inverse G y) (group_inverse G x))))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (sgroup_law G y (sgroup_law G (group_inverse G y) (group_inverse G x)))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (sgroup_law (monoid_sgroup (group_monoid G)) y (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x)))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G x y) (sgroup_law G (group_inverse G y) (group_inverse G x))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G y) (group_inverse G x))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G x y) (group_inverse G (sgroup_law G x y))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (group_inverse G (sgroup_law (monoid_sgroup (group_monoid G)) x y))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (monoid_unit G); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
simpl in |- *; auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) x *)
unfold cart_eq, group_quo_eq in |- *.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: forall x : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros x; try assumption.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (group_inverse G x)); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (monoid_unit G); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall (x y : Carrier group_quo_set) (_ : @Equal group_quo_set x y), @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
intros x y; try assumption.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall _ : @Equal group_quo_set x y, @Equal group_quo_set (group_inverse G x) (group_inverse G y) *)
simpl in |- *; auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall _ : group_quo_eq x y, group_quo_eq (group_inverse G x) (group_inverse G y) *)
unfold cart_eq, group_quo_eq in |- *.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: forall _ : @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))), @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x) (group_inverse G (group_inverse G y))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros H'; try assumption.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G x) (group_inverse G (group_inverse G y))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply normal_com_in.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (group_inverse G (group_inverse G y)) (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (group_inverse G (sgroup_law G x (group_inverse G y))); auto with algebra.
(* Goal: forall x : Carrier group_quo_set, @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
intros x; try assumption.
(* Goal: @Equal group_quo_set (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
simpl in |- *; auto with algebra.
(* Goal: group_quo_eq (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) *)
unfold cart_eq, group_quo_eq in |- *.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (group_inverse G (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G (sgroup_law G x (group_inverse G x)) (monoid_unit G)); auto with algebra.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G)))) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (group_inverse G x)); auto with algebra.
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (monoid_unit G); auto with algebra.
Qed.
Set Implicit Arguments.
Unset Strict Implicit.
Definition group_quo_surj : Hom G group_quo.
Proof.
(* Goal: Carrier (@Hom GROUP G group_quo) *)
apply (BUILD_HOM_GROUP (G:=G) (G':=group_quo) (ff:=fun x : G => x)).
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *)
(* Goal: forall (x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G)))) (_ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *)
intros x y; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *)
(* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) x y *)
simpl in |- *; auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *)
(* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, group_quo_eq x y *)
unfold cart_eq, group_quo_eq in |- *.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *)
(* Goal: forall _ : @Equal (sgroup_set (monoid_sgroup (group_monoid G))) x y, @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
intros H'; try assumption.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G y)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (sgroup_law G x (group_inverse G x)); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *)
(* Goal: @in_part (sgroup_set (monoid_sgroup (group_monoid G))) (sgroup_law (monoid_sgroup (group_monoid G)) x (group_inverse G x)) (@subsgroup_part (monoid_sgroup (group_monoid G)) (@submonoid_subsgroup (group_monoid G) (@subgroup_submonoid G H))) *)
apply in_part_comp_l with (monoid_unit G); auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
(* Goal: forall x y : Carrier (sgroup_set (monoid_sgroup (group_monoid G))), @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (sgroup_law (monoid_sgroup (group_monoid G)) x y) (sgroup_law (monoid_sgroup (group_monoid group_quo)) x y) *)
auto with algebra.
(* Goal: @Equal (sgroup_set (monoid_sgroup (group_monoid group_quo))) (@monoid_unit (monoid_sgroup (group_monoid G)) (monoid_on_def (group_monoid G))) (@monoid_unit (monoid_sgroup (group_monoid group_quo)) (monoid_on_def (group_monoid group_quo))) *)
auto with algebra.
Qed.
End Def.
Hint Immediate normal_com_in: algebra. |
Require Export GeoCoq.Elements.OriginalProofs.lemma_NCdistinct.
Require Export GeoCoq.Elements.OriginalProofs.proposition_28A.
Require Export GeoCoq.Elements.OriginalProofs.lemma_collinearparallel.
Require Export GeoCoq.Elements.OriginalProofs.lemma_parallelsymmetric.
Section Euclid.
Context `{Ax:euclidean_neutral_ruler_compass}.
Lemma proposition_28D :
forall B D E G H,
BetS E G H -> CongA E G B G H D -> OS B D G H ->
Par G B H D.
Proof.
(* Goal: forall (B D E G H : @Point Ax0) (_ : @BetS Ax0 E G H) (_ : @CongA Ax0 E G B G H D) (_ : @OS Ax0 B D G H), @Par Ax0 G B H D *)
intros.
(* Goal: @Par Ax0 G B H D *)
assert (nCol G H B) by (conclude_def OS ).
(* Goal: @Par Ax0 G B H D *)
assert (nCol G H D) by (conclude_def OS ).
(* Goal: @Par Ax0 G B H D *)
assert (neq H D) by (forward_using lemma_NCdistinct).
(* Goal: @Par Ax0 G B H D *)
assert (neq D H) by (conclude lemma_inequalitysymmetric).
(* Goal: @Par Ax0 G B H D *)
assert (neq G B) by (forward_using lemma_NCdistinct).
(* Goal: @Par Ax0 G B H D *)
assert (neq B G) by (conclude lemma_inequalitysymmetric).
(* Goal: @Par Ax0 G B H D *)
let Tf:=fresh in assert (Tf:exists A, (BetS B G A /\ Cong G A G B)) by (conclude lemma_extension);destruct Tf as [A];spliter.
(* Goal: @Par Ax0 G B H D *)
assert (BetS A G B) by (conclude axiom_betweennesssymmetry).
(* Goal: @Par Ax0 G B H D *)
let Tf:=fresh in assert (Tf:exists C, (BetS D H C /\ Cong H C H D)) by (conclude lemma_extension);destruct Tf as [C];spliter.
(* Goal: @Par Ax0 G B H D *)
assert (BetS C H D) by (conclude axiom_betweennesssymmetry).
(* Goal: @Par Ax0 G B H D *)
assert (Par A B C D) by (conclude proposition_28A).
(* Goal: @Par Ax0 G B H D *)
assert (Col D H C) by (conclude_def Col ).
(* Goal: @Par Ax0 G B H D *)
assert (Col C D H) by (forward_using lemma_collinearorder).
(* Goal: @Par Ax0 G B H D *)
assert (neq H D) by (forward_using lemma_NCdistinct).
(* Goal: @Par Ax0 G B H D *)
assert (Par A B H D) by (conclude lemma_collinearparallel).
(* Goal: @Par Ax0 G B H D *)
assert (Par H D A B) by (conclude lemma_parallelsymmetric).
(* Goal: @Par Ax0 G B H D *)
assert (Col B G A) by (conclude_def Col ).
(* Goal: @Par Ax0 G B H D *)
assert (Col A B G) by (forward_using lemma_collinearorder).
(* Goal: @Par Ax0 G B H D *)
assert (Par H D G B) by (conclude lemma_collinearparallel).
(* Goal: @Par Ax0 G B H D *)
assert (Par G B H D) by (conclude lemma_parallelsymmetric).
(* Goal: @Par Ax0 G B H D *)
close.
Qed.
End Euclid.
|
Require Import securite.
Lemma POinv1rel2 :
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) ->
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) ->
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)) (_ : 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)), 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)) (_ : 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)), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
unfold rel2 in |- *; intros Inv0 Inv1 and1.
(* Goal: inv1 (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: inv1 (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 POinv1rel3 :
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) ->
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) ->
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)) (_ : 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)), 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)) (_ : 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)), inv1 (ABSI (MBNaKab d18 d19 d20 k2) (MANbKabCaCb d15 d16 d17 k1 c1 c2) (MABNaNbKeyK d10 d11 d12 d13 d14) l0) *)
unfold inv0, inv1, rel3 in |- *.
(* Goal: forall (_ : and (known_in c l) (known_in c0 l)) (_ : 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 (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)) (and (new d17 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 D d4 d15) (and (@eq D d5 d16) (and (@eq K k k1) (and (@eq C c c1) (@eq C c0 c2))))))))), and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB))) *)
intros know_c_c0_l know_Kas_Kbs and1.
(* Goal: and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB))) *)
elim know_Kas_Kbs; intros know_Kas know_Kbs.
(* Goal: and (not (known_in (B2C (K2B (KeyX Aid))) (@app C l0 rngDDKKeyAB))) (not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB))) *)
elim and1; 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 know_Kas_Kbs and1 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 (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) rngDDKKeyAB) *)
unfold quint 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 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) 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 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 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 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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C c (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyAB))) *)
apply equivncomp with (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid) :: c :: l ++ rngDDKKeyAB).
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@cons C c (@app C l rngDDKKeyAB))) *)
(* Goal: equivS (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@cons C c (@app C l rngDDKKeyAB))) (@cons C c (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyAB))) *)
auto with otway_rees.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@cons C c (@app C l rngDDKKeyAB))) *)
unfold quad in |- *.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid)) (@cons C c (@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 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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C c (@app C l rngDDKKeyAB)) *)
elim know_c_c0_l; intros know_c_l t.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@cons C c (@app C l rngDDKKeyAB)) *)
apply equivncomp with (l ++ rngDDKKeyAB).
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Aid))) (@app C l rngDDKKeyAB) *)
(* Goal: equivS (@app C l rngDDKKeyAB) (@cons C c (@app C l rngDDKKeyAB)) *)
apply AlreadyIn; apply EP0; assumption.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Bid))) *)
(* 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 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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B Bid))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d16))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d4))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (B2C (D2B d17))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (Pair c (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B Bid))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d5))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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 (KeyX Aid))) (B2C (D2B d4))) *)
discriminate.
(* Goal: not (known_in (B2C (K2B (KeyX Bid))) (@app C l0 rngDDKKeyAB)) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Aid))) (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.
(* 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 (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) rngDDKKeyAB) *)
unfold quint in |- *.
(* Goal: not_comp_of (B2C (K2B (KeyX 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) rngDDKKeyAB) *)
simpl in |- *.
(* Goal: not_comp_of (B2C (K2B (KeyX 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 rngDDKKeyAB)) *)
repeat apply C2 || apply C3 || apply C4.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 rngDDKKeyAB))) *)
apply equivncomp with (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid) :: c :: l ++ rngDDKKeyAB).
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@cons C c (@app C l rngDDKKeyAB))) *)
(* Goal: equivS (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@cons C c (@app C l rngDDKKeyAB))) (@cons C c (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@app C l rngDDKKeyAB))) *)
auto with otway_rees.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (@cons C (Encrypt (quad (B2C (D2B d17)) (B2C (D2B d4)) (B2C (D2B d16)) (B2C (D2B Bid))) (KeyX Bid)) (@cons C c (@app C l rngDDKKeyAB))) *)
unfold quad in |- *.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (@cons C (Encrypt (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) (KeyX Bid)) (@cons C c (@app C l rngDDKKeyAB))) *)
repeat apply C2 || apply C3 || apply C4.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@cons C c (@app C l rngDDKKeyAB)) *)
elim know_c_c0_l; intros know_c_l t.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@cons C c (@app C l rngDDKKeyAB)) *)
apply equivncomp with (l ++ rngDDKKeyAB).
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not_comp_of (B2C (K2B (KeyX Bid))) (@app C l rngDDKKeyAB) *)
(* Goal: equivS (@app C l rngDDKKeyAB) (@cons C c (@app C l rngDDKKeyAB)) *)
apply AlreadyIn; apply EP0; assumption.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Bid))) *)
(* 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 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d16))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B Bid))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d16))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d4))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid))))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX Bid))) (B2C (D2B d17))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (Pair (B2C (D2B d17)) (Pair (B2C (D2B d4)) (Pair (B2C (D2B d16)) (B2C (D2B Bid)))))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B Bid))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d5))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
(* Goal: not (@eq C (B2C (K2B (KeyX 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 (KeyX 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 (KeyX Bid))) (B2C (D2B d4))) *)
discriminate.
(* Goal: not (@eq C (B2C (K2B (KeyX 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.
|