Skip to content

Commit 4713df8

Browse files
pi8027thery
andcommitted
Add a new example: zagier.v
Co-authored-by: Laurent Théry <[email protected]>
1 parent 6bb61a3 commit 4713df8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Make.test-suite

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
examples/boolean.v
22
examples/divmod.v
3+
examples/zagier.v
34

45
-I .

examples/zagier.v

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
From mathcomp Require Import all_ssreflect zify.
2+
3+
Set Implicit Arguments.
4+
Unset Strict Implicit.
5+
Unset Printing Implicit Defensive.
6+
7+
Lemma zagierK x y z : 0 < x -> 0 < z ->
8+
let zagier t :=
9+
let: (x, y, z) := t in
10+
if x < y - z then (x + z.*2, z, y - z - x)
11+
else if x < y.*2 then (y.*2 - x, y, x + z - y)
12+
else (x - y.*2, x + z - y, y) in
13+
zagier (zagier (x, y, z)) = (x, y, z).
14+
Proof.
15+
move=> xP zP /=.
16+
repeat case: leqP => *; congr (_,_,_); lia.
17+
Qed.

0 commit comments

Comments
 (0)