Structure Inner := mkI { is :> Type }.
Structure Outer := mkO { os :> Inner }.
Canonical Structure natInner := mkI nat.
Canonical Structure natOuter := mkO natInner.
Definition hidden_nat := nat.
Admitted.
Structure Pnat := mkP { getp : nat }.
Definition my_getp := getp.
(* Fix *)
Canonical Structure add1Pnat n := mkP (plus n 1).
Definition test_fix n := (refl_equal _ : W (my_getp _)  = W (n + 1)).
(* Case *)
Definition pred n := match n with 0 => 0 | S m => m end.
Canonical Structure predSS n := mkP (pred n).
Definition test_case x := (refl_equal _ : W (my_getp _)  = W (pred x)).
Fail Definition test_case' := (refl_equal _ : W (my_getp _)  = W (pred 0)).
Canonical Structure letPnat' := mkP 0.
Definition letin := (let n := 0 in n).
Definition test4 := (refl_equal _ : W (getp _)  = W letin).
Definition test41 := (refl_equal _ : W (my_getp _)  = W letin).
Definition letin2 (x : nat) := (let n := x in n).
Canonical Structure letPnat'' x := mkP (letin2 x).
Definition test42 x := (refl_equal _ : W (my_getp _)  = W (letin2 x)).
Fail Definition test42' x := (refl_equal _ : W (my_getp _)  = W x).
Structure Morph := mkM { f :> nat -> nat }.
Definition my_f := f.
(* Lambda *)
Canonical Structure addMorh x := mkM (plus x).
Definition test_lam x := (refl_equal _ : Q (my_f _) = Q (plus x)).
Definition test_lam' := (refl_equal _ : Q (my_f _) = Q (plus 0)).
(* Simple tests to justify Sort and Prod as "named". They are already normal, so they cannot loose their names, but still... *)
Structure Sot := mkS { T : Type }.

Axiom R : Type -> Prop.