Section Vect.
(* Our Field *)
Variable F: fparams.
Hypothesis FT:
@field_theory (Field.K F) (v0 F) (v1 F) (addK F) (multK F)
(fun x y => (addK F) x (oppK F y)) (oppK F)
(fun x y => (multK F) x (invK F y)) (invK F) (@Logic.eq F).
Add Field Kfth : FT.
(******************************************************************************)
(*   Instanciation of Grassman for n = 3                                      *)
(******************************************************************************)
Definition Pp: params :=  {| dim := 3; K := F |}.
Variable HP : fparamsProp Pp.
SubClass point := Kn Pp.
SubClass vect := Vect Pp.
Definition Vjoin (x y : vect): vect := Vjoin Pp x y.
Notation "x '∨' y" := (Vjoin x y) (at level 40, left associativity).
Definition Vadd (x y : vect): vect := Vadd Pp x y.
Notation "x + y" := (Vadd x y).
Definition Vsub (x y : vect): vect := sub Pp Pp x y.
Notation "x - y" := (Vsub x y).
Definition Vscal (k : F) (x : vect): vect := Vscal Pp k x.
Notation "k .* x" := (Vscal k x).
Definition Vmeet (x y : vect): vect := Vmeet Pp x y.
Notation "x '∧' y" := (Vmeet x y) (at level 45, left associativity).
Definition Vdual (x : vect): vect := Vdual Pp x.
Notation "'@  x" := (Vdual x) (at level 9).
Definition Veq (x y : vect): bool := Veq Pp x y.
Notation "x ?= y" := (Veq x y).
Definition Vgenk (k : F): vect := (Vgenk Pp k).
Notation "0" := (Vgenk 0%f).
Notation "1" := (Vgenk 1%f).
Definition hom (n: nat) (x : vect) := (hom Pp Pp n x).
Notation "'dC[ x ]" := (dconst Pp 3 x).
Notation "'C[ x ]" := (const Pp 3 x).
Notation "'E'" := (all Pp 3: vect).
Coercion p2v (x : point) := (K2G Pp x): vect.
Let scal0l x : 0%f .*  x = 0.
Let join_id: forall (x : point), x ∨ x = 0.
Let add_com x y : x + y = y + x.
(******************************************************************************)
(*   Definition of the bracket operator                                       *)
(******************************************************************************)
Definition bracket x y z : F := 'dC[x ∨ y ∨ z].
Notation "'E'" := (all Pp 3: vect).
Notation "'[ x , y , z ]" := (bracket x y z).
(******************************************************************************)
(* A tactic to prove homogeneity                                              *)
(******************************************************************************)

(* Specifications: *)
Lemma hom3E: hom 3 E.
Lemma hom0l x y : hom 1 x -> hom 2 y -> hom 0 (x ∧ y).
Lemma hom0r x y : hom 2 x -> hom 1 y -> hom 0 (x ∧ y).
Lemma hom0p x y : hom 0 x -> hom 0 y -> hom 0 (x ∨ y).
Lemma hom01 : hom 0 1.
Lemma homd k x : hom k x -> hom (3 - k) '@x.
Lemma bracket_defr (x y z : point) :
(x ∨ y) ∧ z = '[x, y, z] .* 1.
Lemma bracket0l (a b: point) : '[a,a,b] = 0%f.
Lemma bracket0m (a b: point) : '[a,b,a] = 0%f.
Lemma bracket0r (a b: point) : '[a,b,b] = 0%f.
Lemma bracket_swapl (x y z : point) : '[y,x,z] = (- ('[x,y,z]))%f.
Lemma bracket_swapr (x y z : point) : '[x,z,y] = (- ('[x,y,z]))%f.
Lemma bracket_norm (a b c: point) :
('[a,c,b] =  (-(1)) * '[a,b,c] /\
'[b,a,c] = (-(1))%f * '[a,b,c] /\
'[b,c,a] = '[a,b,c] /\
'[c,a,b] = '[a,b,c] /\
'[c,b,a] = (-(1))%f * '[a,b,c])%f.