Skip to content

Commit

Permalink
Fix comments and example
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenCyril committed Jan 16, 2024
1 parent 44efa82 commit 95f083a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 0 additions & 4 deletions examples/int_to_Zp.v
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ Definition eqmodp (x y : int) := modp x = modp y.
Definition eq_Zmodp (x y : Zmodp) := (x = y).
Arguments eq_Zmodp /.

(* Axiom (eqp_refl : Reflexive eqmodp). *)
(* Axiom (eqp_sym : Symmetric eqmodp). *)
(* Axiom (eqp_trans : Transitive eqmodp). *)

Notation "0" := zero : int_scope.
Notation "0" := zerop : Zmodp_scope.
Notation "x == y" := (eqmodp x%int y%int)
Expand Down
7 changes: 4 additions & 3 deletions examples/nat_ind.v
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ Variables (to_nat : I -> nat) (of_nat : nat -> I).

Hypothesis to_natK : forall x, of_nat (to_nat x) = x.
Hypothesis of_nat0 : of_nat O = I0.
Hypothesis of_natS : forall x n, of_nat n = x -> of_nat (S n) = IS x.
Hypothesis of_natS : forall n, of_nat (S n) = IS (of_nat n).

(* We only need/ (2a,3) which is morally that Nmap is a split injection *)
(* We only need (2a,3), so it suffices that to_nat is a retraction *)
Definition RI : Param2a3.Rel I nat :=
SplitSurj.toParamSym (SplitSurj.Build to_natK).

Definition RI0 : RI I0 O. Proof. exact of_nat0. Qed.
Definition RIS m n : RI m n -> RI (IS m) (S n). Proof. exact: of_natS. Qed.
Definition RIS m n : RI m n -> RI (IS m) (S n).
Proof. by move=> <-; apply: of_natS. Qed.

Trocq Use RI RI0 RIS.

Expand Down
2 changes: 1 addition & 1 deletion examples/peano_bin_nat.v
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ From Trocq_examples Require Import N.
Set Universe Polymorphism.

(* the best we can do to link these types is (4,4), but
we only need (2a,3) which is morally that Nmap is a split injection *)
we only need (2a,3) si ut suffices that N.to_nat is a retraction *)
Definition RN : Param2a3.Rel N nat :=
SplitSurj.toParamSym (SplitSurj.Build N.to_natK).

Expand Down

0 comments on commit 95f083a

Please sign in to comment.