@@ -13,13 +13,6 @@ Local Open Scope ring_scope.
1313
1414Section Temp.
1515
16- Lemma ord_S_split n (i: 'I_n.+1): {j: 'I_n | i = lift ord0 j} + {i = ord0}.
17- Proof .
18- case: i; case=>[| i] ilt.
19- by right; apply val_inj.
20- by left; exists (Ordinal (ltnSE ilt)); apply val_inj.
21- Qed .
22-
2316(* NB : rpredM and mulrPred uses that 1 is in the subset, which is useless. Predicates should be defined for {aspace aT}. *)
2417
2518Lemma memv_mulr_2closed [K : fieldType] [aT : FalgType K] (U : {aspace aT}) : GRing.mulr_2closed U.
@@ -41,22 +34,23 @@ Lemma ahom_eq_adjoin [F0 : fieldType] [K : fieldExtType F0] [rT : FalgType F0] (
4134 (U : {subfield K}) (x : K) :
4235 {in U, f =1 g} -> f x = g x -> {in <<U; x>>%VS, f =1 g}.
4336Proof .
44- move=>fgU fgx y /Fadjoin_poly_eq <-.
45- move:(Fadjoin_polyOver U x y); generalize (Fadjoin_poly U x y) => p /polyOverP pU.
37+ move=> fgU fgx y /Fadjoin_poly_eq <-.
38+ move: (Fadjoin_poly U x y) (Fadjoin_polyOver U x y) => p /polyOverP pU.
4639rewrite -(coefK p) horner_poly 2!rmorph_sum/=; apply eq_bigr => i _.
4740by rewrite 2!rmorphM /= fgU// 2!rmorphX/= fgx.
4841Qed .
4942
5043Lemma ahom_eq_adjoin_seq [F0 : fieldType] [K : fieldExtType F0] [rT : FalgType F0] (f g : 'AHom(K, rT))
5144 (U : {aspace K}) (xs : seq K) :
52- {in U, f =1 g} -> all ( fun x => f x == g x) xs -> {in <<U & xs>>%VS, f =1 g}.
45+ {in U, f =1 g} -> { in xs, forall x, f x = g x} -> {in <<U & xs>>%VS, f =1 g}.
5346Proof .
5447elim: xs U => [|x xs IHxs] U fgU fgxs.
5548 by rewrite adjoin_nil subfield_closed.
5649rewrite adjoin_cons.
5750have ->: <<U; x>>%VS = ASpace (agenv_is_aspace <<U; x>>%VS) by rewrite /= agenv_id.
58- move: fgxs (IHxs (ASpace (agenv_is_aspace <<U; x>>))) => /andP[/eqP fgx fgxs] /=.
59- by rewrite agenv_id => /(_ (ahom_eq_adjoin fgU fgx) fgxs).
51+ move: fgxs (IHxs (ASpace (agenv_is_aspace <<U; x>>))) => fgxs /=.
52+ rewrite agenv_id; apply; first by apply/ahom_eq_adjoin/fgxs=>//; apply mem_head.
53+ by move=>a axs; apply fgxs; rewrite in_cons axs orbT.
6054Qed .
6155
6256Lemma agenv_span (K : fieldType) (L : fieldExtType K) (U : {subfield L}) (X : seq L) : <<X>>%VS = U -> <<1%VS & X>>%VS = U.
@@ -67,13 +61,13 @@ rewrite -{2}(subfield_closed U) (agenvEr U) subfield_closed.
6761by congr (1 + _)%VS; apply/esym/field_module_eq; rewrite sup_field_module.
6862Qed .
6963
70- Lemma gal_ne (F0 : fieldType) (L : splittingFieldType F0) (E : {subfield L}) (f g : FinGroup.finType (gal_finGroupType E) ) : f = g \/ exists x, x \in E /\ f x != g x.
64+ Lemma gal_ne (F0 : fieldType) (L : splittingFieldType F0) (E : {subfield L}) (f g : gal_of E ) : f = g \/ exists x, x \in E /\ f x != g x.
7165Proof .
7266move:(vbasisP E)=>/span_basis/agenv_span LE.
73- case/boolP: (all (fun x => f x == g x) (vbasis E)) => [fgE | /allPn[x] xE fgx]; [ left | right ].
67+ case/boolP: (all (fun x => f x == g x) (vbasis E)) => [/allP fgE | /allPn[x] xE fgx]; [ left | right ].
7468 2: by exists x; split=>//; apply vbasis_mem.
7569apply/eqP/gal_eqP.
76- rewrite -{1}LE; apply ahom_eq_adjoin_seq=>//.
70+ rewrite -{1}LE; apply ahom_eq_adjoin_seq=>//; last by move=>x /fgE/eqP .
7771move:(gal1 f)(gal1 g).
7872rewrite gal_kHom ?sub1v// gal_kHom ?sub1v// => /andP [_ /subvP f1] /andP [_ /subvP g1].
7973by move=>x /[dup] /f1/fixedSpaceP -> /g1/fixedSpaceP ->.
8276Lemma tnth_cons (T : Type) (x : T) (l : seq T) (i : 'I_(size l)): tnth (in_tuple (x :: l)) (lift ord0 i) = tnth (in_tuple l) i.
8377Proof . by rewrite/tnth/=; apply set_nth_default. Qed .
8478
85- Lemma gal_free (F0 : fieldType) (L : splittingFieldType F0) (E : {subfield L}) (f : seq (FinGroup.finType (gal_finGroupType E) )) (k : 'I_(size f) -> L) : uniq f -> (forall i, k i = 0) \/ (exists a, a \in E /\ \sum_(i < size f) k i * tnth (in_tuple f) i a != 0).
79+ Lemma gal_free (F0 : fieldType) (L : splittingFieldType F0) (E : {subfield L}) (f : seq (gal_of E )) (k : 'I_(size f) -> L) : uniq f -> (forall i, k i = 0) \/ (exists a, a \in E /\ \sum_(i < size f) k i * tnth (in_tuple f) i a != 0).
8680Proof .
8781move:(Logic.eq_refl (size f)); generalize (size f) at 1 => n.
8882elim: n f k => [|n IHn] f k fsize funiq.
@@ -101,27 +95,30 @@ case: (gal_ne s s0) => [/eqP ss0E | [x [xE /negPf ss0x]]].
10195move:fsize=>/eqP; rewrite eqSS=>/eqP fsize.
10296case: (IHn [:: s0 & f] (fun i => (k (lift ord0 i) * (tnth (in_tuple [:: s0 & f]) i x - s x))) fsize s0f).
10397 move=>/(_ ord0)/=/eqP; rewrite mulf_eq0 subr_eq0 [s0 x == _]eq_sym ss0x orbF => k10.
104- set k' := fun i : 'I_(size f).+1 => k (if ord_S_split i then lift ord0 i else ord0).
98+ set k' := fun i : 'I_(size f).+1 => k
99+ (match splitP (i : 'I_(1 + size f)%N) with
100+ | SplitLo _ _ => ord0
101+ | SplitHi _ _ => lift ord0 i
102+ end).
105103 move: (IHn [:: s & f] k' fsize).
106104 have /[swap]/[apply]: uniq (s :: f) by apply/andP; split.
107105 case => [k0 | [a [aE fne0]]]; [left => i | right; exists a].
108106 case: i; case.
109107 move: (k0 ord0); rewrite/k'.
110- case: (ord_S_split _) => [[i /=/(congr1 val)//] | /= _ /[swap] ilt].
111- by congr (k _ = 0); apply val_inj.
108+ by case: splitP => // + _ + ilt => _; congr (k _ = 0); apply val_inj.
112109 case => [|i] ilt.
113110 by move: k10 => /eqP; congr (k _ = 0); apply val_inj.
114111 have ile: (i.+1 < (size f).+1)%N by rewrite -ltnS.
115112 move:(k0 (Ordinal ile)); rewrite/k'.
116- case: (ord_S_split _) => [/= _| /[dup]/(congr1 val)// ].
113+ case: splitP => [[j]/=/[swap]<-// | /= _ _ ].
117114 by congr (k _ = 0); apply val_inj.
118115 split=>//.
119116 move:k10 fne0 => /eqP k10.
120117 rewrite 3!big_ord_recl/= k10 mul0r add0r.
121118 congr (_ * _ + _ != 0).
122- by rewrite/k'; case: (ord_S_split _) => // [[i]] /=/(congr1 val).
119+ by rewrite/k'; case: splitP => // [[i]] /=/(congr1 val).
123120 apply eq_bigr => i _; rewrite tnth_cons (@tnth_cons _ s (s0 :: f) (lift ord0 i)) tnth_cons; congr (_ * _).
124- by rewrite/k'; case: (ord_S_split _) .
121+ by rewrite/k'; case: splitP => // [[j]]/=/[swap]<- .
125122move=>[y [yE fne0]]; right.
126123case /boolP: (\sum_(i < (size f).+2) k i * tnth (in_tuple [:: s, s0 & f]) i y == 0) => [| yne0].
127124 2: by exists y.
@@ -157,12 +154,14 @@ move=> a f IHf.
157154by rewrite 2!big_cons ffunE IHf.
158155Qed .
159156
160-
161- Definition Zp_succ n (i : 'I_n) := Ordinal (
162- match n with
163- | 0 => fun i0 : 'I_0 => match i0 with | @Ordinal _ _ i0 => i0 end
164- | n0.+1 => fun i0 => (ltn_pmod i0.+1 (is_true_true : (is_true (0 < n0.+1)%N)))
165- end i).
157+ Definition Zp_succ n (i : 'I_n) :=
158+ match i with
159+ | @Ordinal _ k klt => Ordinal (
160+ match n as n0 return (k < n0)%N -> (k.+1 %% n0 < n0)%N with
161+ | 0 => id
162+ | n0.+1 => fun => ltn_pmod k.+1 (is_true_true : 0 < n0.+1)%N
163+ end klt)
164+ end .
166165
167166Lemma cycle_imset [gT : finGroupType] (g : gT) : <[g]>%g = @Imset.imset (ordinal_finType #[g]%g) (FinGroup.finType gT) (fun i => (g ^+ (val i))%g) (mem setT).
168167Proof .
@@ -192,7 +191,7 @@ Proof. by apply congr_big => // i; rewrite in_setT. Qed.
192191
193192Lemma Hilbert's_theorem_90_additive
194193 [F : fieldType] [L : splittingFieldType F]
195- [K E : {subfield L}] [x : gal_finGroupType E]
194+ [K E : {subfield L}] [x : gal_of E]
196195 [a : L] :
197196 galois K E ->
198197 generator 'Gal(E / K) x ->
@@ -320,30 +319,24 @@ have ->: ((if p \in primes m then p ^ logn p m else 1) = p ^ logn p m)%N.
320319by rewrite -expnD subnK// vp_leq.
321320Qed .
322321
323- Lemma muln_gt0 [I : Type ] (r : seq I) (P : pred I) (F : I -> nat) (p : nat) :
324- all (fun n : I => P n ==> (0 < F n)%N) r ->
325- (0 < \prod_(n <- r | P n) F n)%N.
326- Proof .
327- elim: r => [|n r IHn /andP[Fn0 Fr0]]; first by rewrite big_nil.
328- rewrite big_cons; case /boolP: (P n) => Pn; last by apply IHn.
329- rewrite muln_gt0.
330- by move:Fn0; rewrite Pn/= IHn ?andbT.
331- Qed .
332-
333- Lemma logn_prod [I : Type ] (r : seq I) (P : pred I) (F : I -> nat) (p : nat) :
334- all (fun n : I => P n ==> (0 < F n)%N) r ->
322+ Lemma logn_prod [I : eqType] (r : seq I) (P : pred I) (F : I -> nat) (p : nat) :
323+ {in r, forall n, P n -> (0 < F n)%N} ->
335324 (logn p (\prod_(n <- r | P n) F n) = \sum_(n <- r | P n) logn p (F n))%N.
336325Proof .
337- elim: r => [|n r IHn /andP[Fn0 Fr0]]; first by rewrite 2!big_nil logn1.
326+ elim: r => [|n r IHn Fnr0]; first by rewrite 2!big_nil logn1.
327+ have Fr0: {in r, forall n : I, P n -> (0 < F n)%N}.
328+ by move=> i ir; apply Fnr0; rewrite in_cons ir orbT.
338329rewrite 2!big_cons; case /boolP: (P n) => Pn; last by apply IHn.
339- move:Fn0; rewrite Pn => /= Fn0.
340- by rewrite lognM// ?muln_gt0// IHn.
330+ move:(Fnr0 n); rewrite mem_head Pn => /= /(_ is_true_true is_true_true) Fn0.
331+ rewrite lognM// ?IHn//.
332+ rewrite big_seq_cond big_mkcond prodn_gt0// => i.
333+ by case /boolP: ((i \in r) && P i) => // /andP[/Fr0].
341334Qed .
342335
343336Lemma logn_partn (p n : nat) (pi : nat_pred) :
344337 logn p (n`_pi)%N = ((p \in pi) * logn p n)%N.
345338Proof .
346- rewrite/partn logn_prod; last by apply/allP => i _; rewrite pfactor_gt0 implybT .
339+ rewrite/partn logn_prod; last by move => i _; rewrite pfactor_gt0.
347340under eq_bigr do rewrite lognX.
348341have logp (i : nat): (i == p) || (logn i n * logn p i == 0)%N.
349342 case /boolP: (i == p) => //= /negPf ip.
0 commit comments