playground/coq/mathcomp/hello.v

40 lines
1.1 KiB
Coq

From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq choice.
From mathcomp Require Import fintype div tuple bigop prime finset fingroup.
From mathcomp Require Import ssralg poly polydiv morphism action finalg zmodp.
From mathcomp Require Import cyclic center pgroup abelian matrix mxpoly vector.
From mathcomp Require Import falgebra fieldext separable galois.
From mathcomp Require ssrnum ssrint algC cyclotomic.
(* Identity of a group *)
Check 1%g.
Check 1%R.
Check ringType.
Check fieldType.
(* Got +1,+2,+3,+4 and -1,-2 *)
Compute 3.+4.
(* = 7 : nat *)
Print injective.
(*
injective =
fun (rT aT : Type) (f : aT -> rT) =>
forall x1 x2 : aT, f x1 = f x2 -> x1 = x2
: forall rT aT : Type, (aT -> rT) -> Prop
*)
(* Check fieldExtType. *)
Locate "0".
Check 0%g.
(* Check R. *)
(* Factorial *)
Compute 0`!. (* = 1 : nat *)
Compute 1`!. (* = 1 : nat *)
Compute 2`!. (* = 2 : nat *)
Compute 3`!. (* = 6 : nat *)
Compute 4`!. (* = 24 : nat *)
(* Summation. ie, Σ *)
Compute \sum_ (1 <= i < 5) i. (* 1+2+3+4+5 *)
Compute \sum_ (1 <= i < 3) (2*i). (* 2*(1+2+3) *)