Section transpose.
Definition transpose :
forall (F : field) (m n : Nat), matrix F m n -> matrix F n m.
intros.
red in |- *.
red in |- *.
red in X; red in X.
destruct X.
apply (Build_Map2 (Ap2:=fun i j => Ap2 j i)); auto with algebra.
red in Ap2_comp_proof; red in |- *.
intros.
auto with algebra.
Defined.
Definition transpose_map :
forall (F : field) (m n : Nat), MAP (matrix F m n) (matrix F n m).
intros.
apply (Build_Map (Ap:=transpose (F:=F) (m:=m) (n:=n))).
red in |- *.
unfold transpose in |- *.
intros; destruct x; destruct y.
simpl in |- *.
auto with algebra.
Defined.
intros.
unfold transpose in |- *; destruct M; simpl in |- *.
apply Refl.
Qed.
End transpose.
Hint Resolve transpose_defprop: algebra.
Definition zero_matrix : forall (F : field) (n m : Nat), matrix F n m.
intros.
apply (Build_Map2 (Ap2:=fun (i : fin n) (j : fin m) => zero F)).
red in |- *.
auto with algebra.
Defined.
Definition is_square (F : field) (n m : Nat) (M : matrix F n m) :=
n =' m in _.
Definition is_diagonal (F : field) (n : Nat) (M : matrix F n n) :=
forall i j : fin n, index i <> index j -> M i j =' (zero F) in _.
Definition identity_matrix : forall (F : field) (n : Nat), matrix F n n.
intros.
apply
(Build_Map2
(Ap2:=fun i j : fin n => Kronecker one (zero F) (index i) (index j))).
red in |- *.
unfold Kronecker in |- *.
intros; destruct x; destruct x'; destruct y; destruct y'.
simpl in |- *.
simpl in H, H0.
rewrite H.
rewrite H0.
auto with algebra.
Defined.

Lemma id_is_square :
forall (F : field) (n : Nat), is_square (identity_matrix F n).