Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style ssreflect #9

Open
vblot opened this issue Jul 26, 2019 · 0 comments
Open

style ssreflect #9

vblot opened this issue Jul 26, 2019 · 0 comments

Comments

@vblot
Copy link

vblot commented Jul 26, 2019

Dans le style ssreflect on n'utilise pas destruct, mais case.
D'autre part on n'utilise pas non plus fold ou unfold, mais plutôt rewrite -/cste et rewrite /cste
Par exemple :

internship2019/src/arith.v

Lines 105 to 112 in 17e55db

Lemma lognn : forall n, logn n n = prime n.
Proof.
move=> n.
destruct (prime n)eqn:n_prime ; unfold logn ; rewrite n_prime //.
destruct n as [|n] ; first inversion n_prime.
rewrite /= edivn_def /= divnn modnn /=.
by destruct n as [|n] ; first inversion n_prime.
Qed.

s'écrit plutôt :

Lemma lognn : forall n, logn n n = prime n.
Proof.
  move=> n.
  case n_prime: (prime n) ; rewrite /logn n_prime //.
  case: n n_prime=> [|n] n_prime ; first inversion n_prime.
  rewrite /= edivn_def /= divnn modnn /=.
  by case: n n_prime=> [|n] n_prime ; first inversion n_prime.
Qed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant