There is an old branch of Bruno Barras' fork of Coq that allows syntax roughly like that. See, for example, in the example file hit-hoh.v:
Inductive circle : U :=
base
// loop : base=base.
Alas, this version of Coq has not been updated since late 2015, and there is no such native support in the current version of Coq.
The way the HoTT library codes higher inductive types is with the extension of private inductives. For example, in an older version of the circle file (which has since been replaced with a definition via coequaliziers), we can see:
Module Export Circle.
Private Inductive S1 : Type1 :=
| base : S1.
Axiom loop : base = base.
Definition S1_ind (P : S1 -> Type) (b : P base) (l : loop # b = b)
: forall (x:S1), P x
:= fun x => match x with base => fun _ => b end l.
Axiom S1_ind_beta_loop
: forall (P : S1 -> Type) (b : P base) (l : loop # b = b),
apD (S1_ind P b l) loop = l.
End Circle.
The Private Inductive
keyword tells Coq to disable pattern matching outside the current module; this allows us to force users to use only elimination/induction principles defined in the given module. We then axiomatize the path constructors, axiomatize their computation rules, and define the eliminator. Note that the eliminator must make use of the path argument (l : loop # b = b
) in its body, or else Coq will assume that what you pass as that argument doesn't matter.
~~~~~
Where can I find a tutorial to start ?
I am not aware of any such tutorial at present, but I might suggest looking at contrib/HoTTBook.v
and contrib/HoTTBookExercises.v
which contain many links between the HoTT book / exercises and the HoTT/HoTT library. Looking at how these theorems and exercises are stated and proven might be useful (and feel free to contribute your own solutions/proofs to problems/theorems that are not linked to anything yet!).