Skip to content

Commit

Permalink
Add a new example: zagier.v
Browse files Browse the repository at this point in the history
Co-authored-by: Laurent Théry <[email protected]>
  • Loading branch information
pi8027 and thery committed Sep 27, 2021
1 parent 6bb61a3 commit 4713df8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions Make.test-suite
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
examples/boolean.v
examples/divmod.v
examples/zagier.v

-I .
17 changes: 17 additions & 0 deletions examples/zagier.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
From mathcomp Require Import all_ssreflect zify.

Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.

Lemma zagierK x y z : 0 < x -> 0 < z ->
let zagier t :=
let: (x, y, z) := t in
if x < y - z then (x + z.*2, z, y - z - x)
else if x < y.*2 then (y.*2 - x, y, x + z - y)
else (x - y.*2, x + z - y, y) in
zagier (zagier (x, y, z)) = (x, y, z).
Proof.
move=> xP zP /=.
repeat case: leqP => *; congr (_,_,_); lia.
Qed.

0 comments on commit 4713df8

Please sign in to comment.