Proof Assistant Projects
Collection
Digesting proof assistant libraries for AI ingestion. • 103 items • Updated • 3
fact stringlengths 12 7.97k | statement stringlengths 2 362 | proof stringlengths 0 7.94k | type stringclasses 13
values | symbolic_name stringlengths 2 34 | library stringclasses 6
values | filename stringclasses 26
values | imports listlengths 0 21 | deps listlengths 0 15 | docstring stringclasses 33
values | line_start int64 4 1.62k | line_end int64 4 1.63k | has_proof bool 2
classes | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
euclidean_division :
forall x y:R,
y <> 0 ->
exists k : Z, (exists r : R, x = IZR k * y + r /\ 0 <= r < Rabs y).
Proof.
unfold not; intros x y H.
assert (H0: y > 0 \/ y <= 0).
{ hecrush use: @Rtotal_order unfold: Rle. }
destruct H0 as [H0|H0].
- pose (k := (up (x / y) - 1)%Z).
exists k.
exis... | euclidean_division :
forall x y:R,
y <> 0 ->
exists k : Z, (exists r : R, x = IZR k * y + r /\ 0 <= r < Rabs y). | Proof.
unfold not; intros x y H.
assert (H0: y > 0 \/ y <= 0).
{ hecrush use: @Rtotal_order unfold: Rle. }
destruct H0 as [H0|H0].
- pose (k := (up (x / y) - 1)%Z).
exists k.
exists (x - IZR k * y).
assert (HH: IZR k = IZR (up (x / y)) - 1).
{ assert (IZR k = IZR (up (x / y)) - IZR 1%Z).
... | Lemma | euclidean_division | examples | examples/euclidean_division.v | [
"Reals",
"Lra"
] | [
"hcrush",
"not",
"sauto",
"sintuition",
"split"
] | null | 14 | 118 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_1 : le 1 2.
hammer. Restart.
scongruence use: Nat.lt_0_2 unfold: lt.
Qed. | lem_1 : le 1 2. | hammer. Restart.
scongruence use: Nat.lt_0_2 unfold: lt.
Qed. | Lemma | lem_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 35 | 38 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_2 : forall n : nat, Nat.Odd n \/ Nat.Odd (n + 1).
hammer. Restart.
hauto lq: on use: Nat.Even_or_Odd, Nat.add_1_r, Nat.Odd_succ.
Qed. | lem_2 : forall n : nat, Nat.Odd n \/ Nat.Odd (n + 1). | hammer. Restart.
hauto lq: on use: Nat.Even_or_Odd, Nat.add_1_r, Nat.Odd_succ.
Qed. | Lemma | lem_2 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 40 | 43 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_2_1 : forall n : nat, Nat.Even n \/ Nat.Even (n + 1).
hammer. Restart.
hauto lq: on use: Nat.add_1_r, Nat.Even_or_Odd, Nat.Even_succ.
Qed. | lem_2_1 : forall n : nat, Nat.Even n \/ Nat.Even (n + 1). | hammer. Restart.
hauto lq: on use: Nat.add_1_r, Nat.Even_or_Odd, Nat.Even_succ.
Qed. | Lemma | lem_2_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 45 | 48 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_3 : le 2 3.
hammer. Restart.
srun eauto use: Nat.le_succ_diag_r unfold: Init.Nat.two.
Qed. | lem_3 : le 2 3. | hammer. Restart.
srun eauto use: Nat.le_succ_diag_r unfold: Init.Nat.two.
Qed. | Lemma | lem_3 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 50 | 53 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_4 : le 3 10.
hammer. Restart.
sfirstorder use: Nat.nle_succ_0, Nat.le_gt_cases, Nat.lt_succ_r, Nat.succ_le_mono, Nat.log2_up_2 unfold: Init.Nat.two.
Qed. | lem_4 : le 3 10. | hammer. Restart.
sfirstorder use: Nat.nle_succ_0, Nat.le_gt_cases, Nat.lt_succ_r, Nat.succ_le_mono, Nat.log2_up_2 unfold: Init.Nat.two.
Qed. | Lemma | lem_4 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 55 | 58 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
mult_1 : forall m n k : nat, m * n + k = k + n * m.
Proof.
hammer. Restart.
scongruence use: Nat.mul_comm, Nat.add_comm.
Qed. | mult_1 : forall m n k : nat, m * n + k = k + n * m. | Proof.
hammer. Restart.
scongruence use: Nat.mul_comm, Nat.add_comm.
Qed. | Lemma | mult_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 60 | 64 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_rew : forall m n : nat, 1 + n + m + 1 = m + 2 + n.
Proof.
hammer. Restart.
strivial use: Nat.add_comm, Nat.add_1_r, Nat.add_shuffle1, Nat.add_assoc.
Qed. | lem_rew : forall m n : nat, 1 + n + m + 1 = m + 2 + n. | Proof.
hammer. Restart.
strivial use: Nat.add_comm, Nat.add_1_r, Nat.add_shuffle1, Nat.add_assoc.
Qed. | Lemma | lem_rew | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 66 | 70 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_pow : forall n : nat, 3 * 3 ^ n = 3 ^ (n + 1).
Proof.
hammer. Restart.
qauto use: Nat.pow_succ_r, Nat.le_0_l, Nat.add_1_r.
Qed. | lem_pow : forall n : nat, 3 * 3 ^ n = 3 ^ (n + 1). | Proof.
hammer. Restart.
qauto use: Nat.pow_succ_r, Nat.le_0_l, Nat.add_1_r.
Qed. | Lemma | lem_pow | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 72 | 76 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
cos_decreasing_1 :
forall y x : Rdefinitions.R,
Rdefinitions.Rlt x y ->
Rdefinitions.Rle x Rtrigo1.PI ->
Rdefinitions.Rge y Rdefinitions.R0 ->
Rdefinitions.Rle y Rtrigo1.PI ->
Rdefinitions.Rge x Rdefinitions.R0 ->
Rdefinitions.Rlt (Rtrigo_def.cos y) (Rtrigo_def.cos x).
Proof.
(* hammer. Rest... | cos_decreasing_1 :
forall y x : Rdefinitions.R,
Rdefinitions.Rlt x y ->
Rdefinitions.Rle x Rtrigo1.PI ->
Rdefinitions.Rge y Rdefinitions.R0 ->
Rdefinitions.Rle y Rtrigo1.PI ->
Rdefinitions.Rge x Rdefinitions.R0 ->
Rdefinitions.Rlt (Rtrigo_def.cos y) (Rtrigo_def.cos x). | Proof.
(* hammer. Restart. *)
hauto using (@Reals.Rtrigo1.cos_decreasing_1, @Reals.RIneq.Rge_le).
Qed. | Lemma | cos_decreasing_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 82 | 93 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
max_lub : forall m p k n : BinNums.Z,
BinInt.Z.ge p m -> BinInt.Z.le n p -> BinInt.Z.le (BinInt.Z.max n m) p.
Proof.
hammer. Restart.
srun eauto use: BinInt.Z.max_lub, BinInt.Z.ge_le.
Qed. | max_lub : forall m p k n : BinNums.Z,
BinInt.Z.ge p m -> BinInt.Z.le n p -> BinInt.Z.le (BinInt.Z.max n m) p. | Proof.
hammer. Restart.
srun eauto use: BinInt.Z.max_lub, BinInt.Z.ge_le.
Qed. | Lemma | max_lub | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 97 | 102 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_iso : forall x1 y1 x2 y2 theta : Rdefinitions.R,
Rgeom.dist_euc x1 y1 x2 y2 =
Rgeom.dist_euc (Rgeom.xr x1 y1 theta) (Rgeom.yr x1 y1 theta) (Rgeom.xr x2 y2 theta)
(Rgeom.yr x2 y2 theta).
Proof.
hammer. Restart.
scongruence use: Rgeom.isometric_rotation.
Qed. | lem_iso : forall x1 y1 x2 y2 theta : Rdefinitions.R,
Rgeom.dist_euc x1 y1 x2 y2 =
Rgeom.dist_euc (Rgeom.xr x1 y1 theta) (Rgeom.yr x1 y1 theta) (Rgeom.xr x2 y2 theta)
(Rgeom.yr x2 y2 theta). | Proof.
hammer. Restart.
scongruence use: Rgeom.isometric_rotation.
Qed. | Lemma | lem_iso | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 106 | 113 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_lst :
forall {A} (x : A) l1 l2 (P : A -> Prop),
In x (l1 ++ l2) -> (forall y, In y l1 -> P y) -> (forall y, In y l2 -> P y) ->
P x.
Proof.
hammer. Restart.
qauto use: in_app_iff.
(* `firstorder with datatypes' does not work *)
Qed. | lem_lst :
forall {A} (x : A) l1 l2 (P : A -> Prop),
In x (l1 ++ l2) -> (forall y, In y l1 -> P y) -> (forall y, In y l2 -> P y) ->
P x. | Proof.
hammer. Restart.
qauto use: in_app_iff.
(* `firstorder with datatypes' does not work *)
Qed. | Lemma | lem_lst | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 117 | 125 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_lst2 : forall {A} (y1 y2 y3 : A) l l' z, In z l \/ In z l' ->
In z (y1 :: y2 :: l ++ y3 :: l').
Proof.
hammer. Restart.
hauto lq: on use: in_app_iff, in_or_app, not_in_cons, in_cons, Add_in unfold: app.
(* `firstorder with datatypes' does not work *)
Qed. | lem_lst2 : forall {A} (y1 y2 y3 : A) l l' z, In z l \/ In z l' ->
In z (y1 :: y2 :: l ++ y3 :: l'). | Proof.
hammer. Restart.
hauto lq: on use: in_app_iff, in_or_app, not_in_cons, in_cons, Add_in unfold: app.
(* `firstorder with datatypes' does not work *)
Qed. | Lemma | lem_lst2 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 127 | 133 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_lst3 : forall {A} (l : list A), length (tl l) <= length l.
Proof.
hammer. Restart.
qauto use: le_S, Nat.le_0_l, le_n unfold: tl, length.
Qed. | lem_lst3 : forall {A} (l : list A), length (tl l) <= length l. | Proof.
hammer. Restart.
qauto use: le_S, Nat.le_0_l, le_n unfold: tl, length.
Qed. | Lemma | lem_lst3 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 135 | 139 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
Nleb_alt :
forall b a c : BinNums.N, Ndec.Nleb b c = BinNat.N.leb b c /\ Ndec.Nleb a b = BinNat.N.leb a b.
Proof.
hammer. Restart.
srun eauto use: Ndec.Nleb_alt.
Qed. | Nleb_alt :
forall b a c : BinNums.N, Ndec.Nleb b c = BinNat.N.leb b c /\ Ndec.Nleb a b = BinNat.N.leb a b. | Proof.
hammer. Restart.
srun eauto use: Ndec.Nleb_alt.
Qed. | Lemma | Nleb_alt | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 143 | 148 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
setbit_iff : forall m a n : BinNums.N,
n = m \/ true = BinNat.N.testbit a m <->
BinNat.N.testbit (BinNat.N.setbit a n) m = true.
Proof.
hammer. Restart.
hfcrush use: BinNat.N.setbit_iff.
Qed. | setbit_iff : forall m a n : BinNums.N,
n = m \/ true = BinNat.N.testbit a m <->
BinNat.N.testbit (BinNat.N.setbit a n) m = true. | Proof.
hammer. Restart.
hfcrush use: BinNat.N.setbit_iff.
Qed. | Lemma | setbit_iff | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 152 | 158 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
in_int_p_Sq : forall r p q a : nat, a >= 0 ->
Between.in_int p (S q) r -> Between.in_int p q r \/ r = q \/ a = 0.
Proof.
hammer. Restart.
hauto lq: on use: in_int_p_Sq.
Qed. | in_int_p_Sq : forall r p q a : nat, a >= 0 ->
Between.in_int p (S q) r -> Between.in_int p q r \/ r = q \/ a = 0. | Proof.
hammer. Restart.
hauto lq: on use: in_int_p_Sq.
Qed. | Lemma | in_int_p_Sq | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 160 | 165 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
min_spec_1 : forall n m : Rdefinitions.R,
(Rdefinitions.Rle m n /\ Rbasic_fun.Rmin m m = m) \/
(Rdefinitions.Rlt n m /\ Rbasic_fun.Rmin m n = n).
Proof.
hammer. Restart.
hauto use: RIneq.Rnot_le_lt unfold: Rbasic_fun.Rmin.
Qed. | min_spec_1 : forall n m : Rdefinitions.R,
(Rdefinitions.Rle m n /\ Rbasic_fun.Rmin m m = m) \/
(Rdefinitions.Rlt n m /\ Rbasic_fun.Rmin m n = n). | Proof.
hammer. Restart.
hauto use: RIneq.Rnot_le_lt unfold: Rbasic_fun.Rmin.
Qed. | Lemma | min_spec_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 169 | 175 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
min_spec_2 : forall n m : Rdefinitions.R,
(Rdefinitions.Rle m n /\ Rbasic_fun.Rmin m n = m) \/
(Rdefinitions.Rlt n m /\ Rbasic_fun.Rmin m n = n).
Proof.
hammer. Restart.
hauto use: RIneq.Rnot_le_lt unfold: Rbasic_fun.Rmin.
Qed. | min_spec_2 : forall n m : Rdefinitions.R,
(Rdefinitions.Rle m n /\ Rbasic_fun.Rmin m n = m) \/
(Rdefinitions.Rlt n m /\ Rbasic_fun.Rmin m n = n). | Proof.
hammer. Restart.
hauto use: RIneq.Rnot_le_lt unfold: Rbasic_fun.Rmin.
Qed. | Lemma | min_spec_2 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 177 | 183 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
incl_app : forall (A : Type) (n l m : list A),
List.incl l n /\ List.incl m n -> List.incl (l ++ m) n.
Proof.
hammer. Restart.
strivial use: incl_app.
Qed. | incl_app : forall (A : Type) (n l m : list A),
List.incl l n /\ List.incl m n -> List.incl (l ++ m) n. | Proof.
hammer. Restart.
strivial use: incl_app.
Qed. | Lemma | incl_app | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 185 | 190 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
exp_Ropp
: forall x y : Rdefinitions.R,
Rdefinitions.Rinv (Rtrigo_def.exp x) = Rtrigo_def.exp (Rdefinitions.Ropp x).
Proof.
hammer. Restart.
srun eauto use: Rpower.exp_Ropp.
Qed. | exp_Ropp
: forall x y : Rdefinitions.R,
Rdefinitions.Rinv (Rtrigo_def.exp x) = Rtrigo_def.exp (Rdefinitions.Ropp x). | Proof.
hammer. Restart.
srun eauto use: Rpower.exp_Ropp.
Qed. | Lemma | exp_Ropp | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 194 | 200 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_lst_1 : forall (A : Type) (l l' : list A), List.NoDup (l ++ l') -> List.NoDup l.
Proof.
(* The hammer can't do induction. If induction is necessary to carry out the
proof, then one needs to start the induction manually. *)
induction l'.
- hammer. Undo.
scongruence use: app_nil_end.
- hammer. Undo.
... | lem_lst_1 : forall (A : Type) (l l' : list A), List.NoDup (l ++ l') -> List.NoDup l. | Proof.
(* The hammer can't do induction. If induction is necessary to carry out the
proof, then one needs to start the induction manually. *)
induction l'.
- hammer. Undo.
scongruence use: app_nil_end.
- hammer. Undo.
srun eauto use: NoDup_remove_1.
Qed. | Lemma | lem_lst_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [
"NoDup_remove_1"
] | null | 202 | 211 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
NoDup_remove_2
: forall (A : Type) (a : A) (l' l : list A),
List.NoDup (l ++ a :: l') ->
~ List.In a (l ++ l') /\ List.NoDup (l ++ l') /\ List.NoDup l.
Proof.
hammer. Restart.
strivial use: lem_lst_1, NoDup_remove.
Qed. | NoDup_remove_2
: forall (A : Type) (a : A) (l' l : list A),
List.NoDup (l ++ a :: l') ->
~ List.In a (l ++ l') /\ List.NoDup (l ++ l') /\ List.NoDup l. | Proof.
hammer. Restart.
strivial use: lem_lst_1, NoDup_remove.
Qed. | Lemma | NoDup_remove_2 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [
"lem_lst_1"
] | null | 213 | 220 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
leb_compare2 : forall m n : nat,
PeanoNat.Nat.leb n m = true <->
(PeanoNat.Nat.compare n m = Lt \/ PeanoNat.Nat.compare n m = Eq).
Proof.
(* hammer. Restart. *)
(* Sometimes the tactics cannot reconstruct the goal, but the
returned dependencies may still be used to crea... | leb_compare2 : forall m n : nat,
PeanoNat.Nat.leb n m = true <->
(PeanoNat.Nat.compare n m = Lt \/ PeanoNat.Nat.compare n m = Eq). | Proof.
(* hammer. Restart. *)
(* Sometimes the tactics cannot reconstruct the goal, but the
returned dependencies may still be used to create the proof
semi-manually. *)
assert (forall c : Datatypes.comparison, c = Eq \/ c = Lt \/ c = Gt) by sauto inv: Datatypes.comparison.
hauto erew: off use: Compare_dec.... | Lemma | leb_compare2 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [
"sauto"
] | null | 222 | 232 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
leb_1 : forall m n : nat, PeanoNat.Nat.leb m n = true <-> m <= n.
Proof.
hammer. Restart.
srun eauto use: Nat.leb_le, Nat.leb_nle, leb_correct, leb_complete.
Qed. | leb_1 : forall m n : nat, PeanoNat.Nat.leb m n = true <-> m <= n. | Proof.
hammer. Restart.
srun eauto use: Nat.leb_le, Nat.leb_nle, leb_correct, leb_complete.
Qed. | Lemma | leb_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 234 | 238 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
leb_2 : forall m n : nat, PeanoNat.Nat.leb m n = false <-> m > n.
Proof.
hammer. Restart.
srun eauto use: leb_iff_conv, leb_correct_conv unfold: gt.
Qed. | leb_2 : forall m n : nat, PeanoNat.Nat.leb m n = false <-> m > n. | Proof.
hammer. Restart.
srun eauto use: leb_iff_conv, leb_correct_conv unfold: gt.
Qed. | Lemma | leb_2 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 240 | 244 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
incl_appl_1
: forall (A : Type) (l m n : list A),
List.incl l n -> List.incl l (n ++ m) /\ List.incl l (m ++ n) /\ List.incl l (l ++ l).
Proof.
hammer. Restart.
strivial use: incl_appl, incl_refl, incl_appr.
Qed. | incl_appl_1
: forall (A : Type) (l m n : list A),
List.incl l n -> List.incl l (n ++ m) /\ List.incl l (m ++ n) /\ List.incl l (l ++ l). | Proof.
hammer. Restart.
strivial use: incl_appl, incl_refl, incl_appr.
Qed. | Lemma | incl_appl_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [
"incl_appl"
] | null | 246 | 252 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
in_int_lt2 : forall p q r : nat, Between.in_int p q r -> q >= p /\ r >= p /\ r <= q.
Proof.
hammer. Restart.
sfirstorder use: Nat.lt_le_incl, in_int_lt unfold: ge, in_int.
Qed. | in_int_lt2 : forall p q r : nat, Between.in_int p q r -> q >= p /\ r >= p /\ r <= q. | Proof.
hammer. Restart.
sfirstorder use: Nat.lt_le_incl, in_int_lt unfold: ge, in_int.
Qed. | Lemma | in_int_lt2 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 254 | 258 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
nat_compare_eq : forall n m : nat, PeanoNat.Nat.compare n m = Eq <-> n = m.
Proof.
hammer. Restart.
srun eauto use: Nat.compare_eq_iff.
Qed. | nat_compare_eq : forall n m : nat, PeanoNat.Nat.compare n m = Eq <-> n = m. | Proof.
hammer. Restart.
srun eauto use: Nat.compare_eq_iff.
Qed. | Lemma | nat_compare_eq | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 260 | 264 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
Forall_1
: forall (A : Type) (P : A -> Prop) (a : A),
forall (l l' : list A), List.Forall P l /\ List.Forall P l' /\ P a -> List.Forall P (l ++ a :: l').
Proof.
induction l.
- hammer. Undo.
strivial use: app_nil_l, Forall_cons.
- (* hammer. Undo. *)
sauto use: Forall_cons.
Restart.
inducti... | Forall_1
: forall (A : Type) (P : A -> Prop) (a : A),
forall (l l' : list A), List.Forall P l /\ List.Forall P l' /\ P a -> List.Forall P (l ++ a :: l'). | Proof.
induction l.
- hammer. Undo.
strivial use: app_nil_l, Forall_cons.
- (* hammer. Undo. *)
sauto use: Forall_cons.
Restart.
induction l; qsimpl.
Qed. | Lemma | Forall_1 | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [
"sauto"
] | null | 266 | 277 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
Forall_impl
: forall (A : Type) (P : A -> Prop),
forall l : list A, List.Forall P l -> List.Forall P (l ++ l).
Proof.
induction l.
- hammer. Undo.
srun eauto use: app_nil_end.
- hammer. Undo.
qauto use: Forall_inv, Forall_inv_tail, Forall_1.
Qed. | Forall_impl
: forall (A : Type) (P : A -> Prop),
forall l : list A, List.Forall P l -> List.Forall P (l ++ l). | Proof.
induction l.
- hammer. Undo.
srun eauto use: app_nil_end.
- hammer. Undo.
qauto use: Forall_inv, Forall_inv_tail, Forall_1.
Qed. | Lemma | Forall_impl | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [
"Forall_1"
] | Neither the base case nor the inductive step may be solved using 'firstorder with datatypes'. | 280 | 289 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
minus_neq_O : forall n i:nat, (i < n) -> (n - i) <> 0.
Proof.
hammer. Undo.
srun eauto use: Nat.sub_gt.
Qed. | minus_neq_O : forall n i:nat, (i < n) -> (n - i) <> 0. | Proof.
hammer. Undo.
srun eauto use: Nat.sub_gt.
Qed. | Lemma | minus_neq_O | examples | examples/hammer_tests.v | [
"Coq.Reals.RIneq",
"Coq.Reals.Raxioms",
"Coq.Reals.Rtrigo1",
"ZArith.BinInt",
"Reals",
"List",
"NArith.Ndec",
"NArith.BinNat",
"Reals.Rminmax",
"Reals.Rpower"
] | [] | null | 291 | 295 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_0 : forall n m, n <> 0 -> m * m = 2 * n * n -> m < 2 * n.
Proof.
intros n m H H0.
destruct (lt_dec m (2 * n)) as [|H1]; try strivial.
exfalso.
assert (m >= 2 * n) by lia.
clear H1.
assert (m * m >= 2 * n * (2 * n)).
{ assert (m * m >= 2 * n * m).
{ hauto use: @Nat.le_0_l, @Nat.mul_le_mono_nonneg_r... | lem_0 : forall n m, n <> 0 -> m * m = 2 * n * n -> m < 2 * n. | Proof.
intros n m H H0.
destruct (lt_dec m (2 * n)) as [|H1]; try strivial.
exfalso.
assert (m >= 2 * n) by lia.
clear H1.
assert (m * m >= 2 * n * (2 * n)).
{ assert (m * m >= 2 * n * m).
{ hauto use: @Nat.le_0_l, @Nat.mul_le_mono_nonneg_r unfold: ge. }
assert (2 * n * m >= 2 * n * (2 * n)).
... | Lemma | lem_0 | examples | examples/sqrt2_irrational.v | [
"Reals",
"Arith",
"Wf_nat",
"Even",
"Lia"
] | [
"sauto"
] | null | 13 | 27 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_main : forall n m, n * n = 2 * m * m -> m = 0.
Proof.
intro n; pattern n; apply lt_wf_ind; clear n.
intros n H m H0.
destruct (Nat.eq_dec n 0) as [H1|H1]; subst.
- sauto.
- destruct (even_odd_cor n) as [k HH].
destruct HH as [H2|H2]; subst.
+ assert (2 * k * k = m * m) by lia.
assert (m < 2 ... | lem_main : forall n m, n * n = 2 * m * m -> m = 0. | Proof.
intro n; pattern n; apply lt_wf_ind; clear n.
intros n H m H0.
destruct (Nat.eq_dec n 0) as [H1|H1]; subst.
- sauto.
- destruct (even_odd_cor n) as [k HH].
destruct HH as [H2|H2]; subst.
+ assert (2 * k * k = m * m) by lia.
assert (m < 2 * k).
{ qauto use: @Nat.mul_0_r, @lem_0. }
... | Lemma | lem_main | examples | examples/sqrt2_irrational.v | [
"Reals",
"Arith",
"Wf_nat",
"Even",
"Lia"
] | [
"eq_dec",
"lem_0",
"sauto"
] | null | 29 | 42 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
thm_irrational :
forall (p q : nat), q <> 0 -> sqrt 2 <> (INR p / INR q)%R.
Proof.
unfold not.
intros p q H H0.
assert (2 * q * q = p * p).
{ assert (((sqrt 2) ^ 2)%R = 2%R).
{ hauto use: @Rsqr_sqrt, @Rlt_R0_R2, @Rsqr_pow2 unfold: Rle. }
assert (((INR p / INR q) ^ 2)%R = ((INR p / INR q) * (INR p / IN... | thm_irrational :
forall (p q : nat), q <> 0 -> sqrt 2 <> (INR p / INR q)%R. | Proof.
unfold not.
intros p q H H0.
assert (2 * q * q = p * p).
{ assert (((sqrt 2) ^ 2)%R = 2%R).
{ hauto use: @Rsqr_sqrt, @Rlt_R0_R2, @Rsqr_pow2 unfold: Rle. }
assert (((INR p / INR q) ^ 2)%R = ((INR p / INR q) * (INR p / INR q))%R).
{ qauto use: @Rsqr_pow2 unfold: Rsqr. }
assert (((INR p / IN... | Theorem | thm_irrational | examples | examples/sqrt2_irrational.v | [
"Reals",
"Arith",
"Wf_nat",
"Even",
"Lia"
] | [
"lem_main",
"not",
"sauto"
] | null | 44 | 75 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_odd : forall n : nat, Nat.Odd n \/ Nat.Odd (n + 1).
Proof.
(* hammer. *)
hauto lq: on use: Nat.Odd_succ, Nat.Even_or_Odd, Nat.add_1_r.
Qed. | lem_odd : forall n : nat, Nat.Odd n \/ Nat.Odd (n + 1). | Proof.
(* hammer. *)
hauto lq: on use: Nat.Odd_succ, Nat.Even_or_Odd, Nat.add_1_r.
Qed. | Lemma | lem_odd | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [] | null | 37 | 41 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_even : forall n : nat, Nat.Even n \/ Nat.Even (n + 1).
Proof.
(* predict 16. *)
(* hammer. *)
hauto lq: on use: Nat.add_1_r, Nat.Even_or_Odd, Nat.Even_succ.
Qed. | lem_even : forall n : nat, Nat.Even n \/ Nat.Even (n + 1). | Proof.
(* predict 16. *)
(* hammer. *)
hauto lq: on use: Nat.add_1_r, Nat.Even_or_Odd, Nat.Even_succ.
Qed. | Lemma | lem_even | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [] | null | 43 | 48 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_pow : forall n : nat, 3 * 3 ^ n = 3 ^ (n + 1).
Proof.
Fail sauto.
(* hammer. *)
hauto lq: on use: Nat.pow_succ_r, Nat.le_0_l, Nat.add_1_r.
Qed. | lem_pow : forall n : nat, 3 * 3 ^ n = 3 ^ (n + 1). | Proof.
Fail sauto.
(* hammer. *)
hauto lq: on use: Nat.pow_succ_r, Nat.le_0_l, Nat.add_1_r.
Qed. | Lemma | lem_pow | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [
"sauto"
] | null | 50 | 55 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_incl_concat
: forall (A : Type) (l m n : list A),
List.incl l n ->
List.incl l (n ++ m) /\ List.incl l (m ++ n) /\ List.incl l (l ++ l).
Proof.
(* hammer. *)
strivial use: List.incl_appr, List.incl_refl, List.incl_appl.
Qed. | lem_incl_concat
: forall (A : Type) (l m n : list A),
List.incl l n ->
List.incl l (n ++ m) /\ List.incl l (m ++ n) /\ List.incl l (l ++ l). | Proof.
(* hammer. *)
strivial use: List.incl_appr, List.incl_refl, List.incl_appl.
Qed. | Lemma | lem_incl_concat | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [
"incl_appl"
] | null | 61 | 68 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_lst_1 : forall (A : Type) (l l' : list A),
List.NoDup (l ++ l') -> List.NoDup l.
Proof.
(* The "hammer" tactic can't do induction. If induction is necessary
to carry out the proof, then one needs to start the induction
manually. *)
induction l'.
- (* hammer. *)
scongruence use: List.app_nil_end.
-... | lem_lst_1 : forall (A : Type) (l l' : list A),
List.NoDup (l ++ l') -> List.NoDup l. | Proof.
(* The "hammer" tactic can't do induction. If induction is necessary
to carry out the proof, then one needs to start the induction
manually. *)
induction l'.
- (* hammer. *)
scongruence use: List.app_nil_end.
- (* hammer. *)
srun eauto use: List.NoDup_remove_1.
Qed. | Lemma | lem_lst_1 | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [
"NoDup_remove_1"
] | null | 70 | 81 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_perm_0 {A} : forall (x y : A) l1 l2 l3,
Permutation l1 (y :: l2) ->
Permutation (x :: l1 ++ l3) (x :: y :: l2 ++ l3).
Proof.
(* hammer. *)
hauto lq: on drew: off
use: Permutation_app, List.app_comm_cons, Permutation_refl, perm_skip.
Qed. | lem_perm_0 {A} : forall (x y : A) l1 l2 l3,
Permutation l1 (y :: l2) ->
Permutation (x :: l1 ++ l3) (x :: y :: l2 ++ l3). | Proof.
(* hammer. *)
hauto lq: on drew: off
use: Permutation_app, List.app_comm_cons, Permutation_refl, perm_skip.
Qed. | Lemma | lem_perm_0 | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [] | Lemma lem_perm_1 {A} : forall (x y : A) l1 l2 l3,
Permutation l1 (y :: l2) ->
Permutation (x :: l1 ++ l3) (y :: x :: l2 ++ l3).
Proof.
hammer. | 92 | 99 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_perm_1 {A} : forall (x y : A) l1 l2 l3,
Permutation l1 (y :: l2) ->
Permutation (x :: l1 ++ l3) (y :: x :: l2 ++ l3).
Proof.
(* hammer. *)
srun eauto use: @lem_perm_0, perm_skip, Permutation_Add,
Permutation_trans, Permutation_sym, perm_swap unfold: app.
Undo.
(* Occasionally, some of the return... | lem_perm_1 {A} : forall (x y : A) l1 l2 l3,
Permutation l1 (y :: l2) ->
Permutation (x :: l1 ++ l3) (y :: x :: l2 ++ l3). | Proof.
(* hammer. *)
srun eauto use: @lem_perm_0, perm_skip, Permutation_Add,
Permutation_trans, Permutation_sym, perm_swap unfold: app.
Undo.
(* Occasionally, some of the returned dependencies are not necessary. *)
srun eauto use: @lem_perm_0, Permutation_trans, perm_swap.
(*
Undo.
Set Hammer Minim... | Lemma | lem_perm_1 | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [
"lem_perm_0"
] | null | 101 | 115 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_perm_2 : forall (x : nat) l1 l2 l3,
Permutation (x :: l1) l2 -> Permutation (x :: l3 ++ l1) (l3 ++ l2).
Proof.
(* hammer. *)
(* If an ATP returns at least 8 dependencies, then "hammer" tries to
automatically minimize the number of dependencies by repeatedly
running the ATPs with the returned depen... | lem_perm_2 : forall (x : nat) l1 l2 l3,
Permutation (x :: l1) l2 -> Permutation (x :: l3 ++ l1) (l3 ++ l2). | Proof.
(* hammer. *)
(* If an ATP returns at least 8 dependencies, then "hammer" tries to
automatically minimize the number of dependencies by repeatedly
running the ATPs with the returned dependencies as long as some
ATP returns fewer dependencies. *)
srun eauto use: Permutation_app_head, Permutat... | Lemma | lem_perm_2 | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [] | A general advice: use "hammer" to prove entire lemmas which are
stated separately. Using "hammer" to prove subgoals in a larger
proof is less effective. One reason is that the machine-learning
premise selection can get confused by the presence of unnecessary
hypotheses in the context. | 123 | 133 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_perm_3 : forall (x y : nat) l1 l2 l3,
Permutation (x :: l1) l2 ->
Permutation (x :: y :: l1 ++ l3) (y :: l2 ++ l3).
Proof.
(* hammer. *)
srun eauto use: @lem_perm_1, Permutation_sym.
Qed. | lem_perm_3 : forall (x y : nat) l1 l2 l3,
Permutation (x :: l1) l2 ->
Permutation (x :: y :: l1 ++ l3) (y :: l2 ++ l3). | Proof.
(* hammer. *)
srun eauto use: @lem_perm_1, Permutation_sym.
Qed. | Lemma | lem_perm_3 | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [
"lem_perm_1"
] | null | 135 | 141 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_perm_4 : forall (x y : nat) l1 l2 l3,
Permutation (x :: l1) l2 ->
Permutation (x :: y :: l3 ++ l1) (y :: l3 ++ l2).
Proof.
(* hammer. *)
intros.
rewrite List.app_comm_cons.
pattern (y :: l3 ++ l2).
rewrite List.app_comm_cons.
apply lem_perm_2; assumption.
Qed. | lem_perm_4 : forall (x y : nat) l1 l2 l3,
Permutation (x :: l1) l2 ->
Permutation (x :: y :: l3 ++ l1) (y :: l3 ++ l2). | Proof.
(* hammer. *)
intros.
rewrite List.app_comm_cons.
pattern (y :: l3 ++ l2).
rewrite List.app_comm_cons.
apply lem_perm_2; assumption.
Qed. | Lemma | lem_perm_4 | examples.tutorial.hammer | examples/tutorial/hammer/demo.v | [
"Arith",
"List",
"List.ListNotations",
"Sorting.Permutation"
] | [
"lem_perm_2"
] | null | 143 | 153 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
is_cd d a b :=
a mod d = 0 /\ b mod d = 0. | is_cd d a b | :=
a mod d = 0 /\ b mod d = 0. | Definition | is_cd | examples.tutorial.hammer | examples/tutorial/hammer/gcd.v | [
"Hammer",
"Tactics",
"Program",
"Arith",
"Lia"
] | [] | Is "d" a common divisor of "a" and "b"? | 8 | 9 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
is_gcd d a b :=
is_cd d a b /\ forall d', is_cd d' a b -> d' <= d. | is_gcd d a b | :=
is_cd d a b /\ forall d', is_cd d' a b -> d' <= d. | Definition | is_gcd | examples.tutorial.hammer | examples/tutorial/hammer/gcd.v | [
"Hammer",
"Tactics",
"Program",
"Arith",
"Lia"
] | [
"is_cd"
] | Is "d" the greatest common divisor of "a" and "b"? | 11 | 12 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_gcd_step : forall a b d,
b <> 0 -> is_gcd d b (a mod b) -> is_gcd d a b.
Proof.
unfold is_gcd, is_cd.
intros a b d Hb.
sintuition.
- destruct (Nat.eq_dec d 0) as [Hd|Hd].
+ subst; reflexivity.
+ assert (Hc1: exists c1, b = d * c1).
{ (* hammer. *) strivial use: Nat.mod_divides. }
ass... | lem_gcd_step : forall a b d,
b <> 0 -> is_gcd d b (a mod b) -> is_gcd d a b. | Proof.
unfold is_gcd, is_cd.
intros a b d Hb.
sintuition.
- destruct (Nat.eq_dec d 0) as [Hd|Hd].
+ subst; reflexivity.
+ assert (Hc1: exists c1, b = d * c1).
{ (* hammer. *) strivial use: Nat.mod_divides. }
assert (Hc2: exists c2, a mod b = d * c2).
{ (* hammer. *) strivial use: Nat.m... | Lemma | lem_gcd_step | examples.tutorial.hammer | examples/tutorial/hammer/gcd.v | [
"Hammer",
"Tactics",
"Program",
"Arith",
"Lia"
] | [
"eq_dec",
"is_cd",
"is_gcd",
"sintuition"
] | null | 14 | 58 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
gcd (a b : nat) {measure b} :
{d : nat | a + b > 0 -> is_gcd d a b} :=
match b with
| 0 => a
| _ => gcd b (a mod b)
end.
Next Obligation.
unfold is_gcd, is_cd.
sintuition.
- (* hammer. *)
sfirstorder use: Nat.mod_same.
- (* hammer. *)
(* time sauto. *)
(* Set Hammer SAutoLimit 0.
hamme... | gcd (a b : nat) {measure b} :
{d : nat | a + b > 0 -> is_gcd d a b} :=
match b with
| 0 => a
| _ => gcd b (a mod b)
end. | Next Obligation.
unfold is_gcd, is_cd.
sintuition.
- (* hammer. *)
sfirstorder use: Nat.mod_same.
- (* hammer. *)
(* time sauto. *)
(* Set Hammer SAutoLimit 0.
hammer. *)
sfirstorder use: Nat.mod_0_l.
- (* hammer. *)
qauto use: Nat.add_pos_cases, Nat.le_gt_cases,
Nat.mod... | Fixpoint | gcd | examples.tutorial.hammer | examples/tutorial/hammer/gcd.v | [
"Hammer",
"Tactics",
"Program",
"Arith",
"Lia"
] | [
"is_cd",
"is_gcd",
"sintuition"
] | null | 60 | 79 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
type := Nat | Bool | Prod (ty1 ty2 : type). | type | := Nat | Bool | Prod (ty1 ty2 : type). | Inductive | type | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [] | null | 9 | 9 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
tyeval (ty : type) : Type :=
match ty with
| Nat => nat
| Bool => bool
| Prod ty1 ty2 => tyeval ty1 * tyeval ty2
end. | tyeval (ty : type) : Type | :=
match ty with
| Nat => nat
| Bool => bool
| Prod ty1 ty2 => tyeval ty1 * tyeval ty2
end. | Fixpoint | tyeval | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"type"
] | null | 11 | 16 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
expr : type -> Type :=
| Var : string -> expr Nat
| Plus : expr Nat -> expr Nat -> expr Nat
| Equal : expr Nat -> expr Nat -> expr Bool
| Pair : forall {A B}, expr A -> expr B -> expr (Prod A B)
| Fst : forall {A B}, expr (Prod A B) -> expr A
| Snd : forall {A B}, expr (Prod A B) -> expr B
| Const : forall A, tyeval A ... | expr : type -> Type | :=
| Var : string -> expr Nat
| Plus : expr Nat -> expr Nat -> expr Nat
| Equal : expr Nat -> expr Nat -> expr Bool
| Pair : forall {A B}, expr A -> expr B -> expr (Prod A B)
| Fst : forall {A B}, expr (Prod A B) -> expr A
| Snd : forall {A B}, expr (Prod A B) -> expr B
| Const : forall A, tyeval A -> expr A
| Ite : fo... | Inductive | expr | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"tyeval",
"type"
] | null | 18 | 26 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
store := string -> nat. | store | := string -> nat. | Definition | store | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [] | null | 28 | 28 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
eval {A} (s : store) (e : expr A) : tyeval A :=
match e with
| Var n => s n
| Plus e1 e2 => eval s e1 + eval s e2
| Equal e1 e2 => eval s e1 =? eval s e2
| Pair e1 e2 => (eval s e1, eval s e2)
| Fst e => fst (eval s e)
| Snd e => snd (eval s e)
| Const _ c => c
| Ite b e1 e2 => if eval s b then eval s... | eval {A} (s : store) (e : expr A) : tyeval A | :=
match e with
| Var n => s n
| Plus e1 e2 => eval s e1 + eval s e2
| Equal e1 e2 => eval s e1 =? eval s e2
| Pair e1 e2 => (eval s e1, eval s e2)
| Fst e => fst (eval s e)
| Snd e => snd (eval s e)
| Const _ c => c
| Ite b e1 e2 => if eval s b then eval s e1 else eval s e2
end. | Fixpoint | eval | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr",
"store",
"tyeval"
] | null | 30 | 40 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
simp_plus (e1 e2 : expr Nat) :=
match e1, e2 with
| Const Nat n1, Const Nat n2 => Const Nat (n1 + n2)
| _, Const Nat 0 => e1
| Const Nat 0, _ => e2
| _, _ => Plus e1 e2
end. | simp_plus (e1 e2 : expr Nat) | :=
match e1, e2 with
| Const Nat n1, Const Nat n2 => Const Nat (n1 + n2)
| _, Const Nat 0 => e1
| Const Nat 0, _ => e2
| _, _ => Plus e1 e2
end. | Definition | simp_plus | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr"
] | null | 42 | 48 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_plus : forall s e1 e2,
eval s (simp_plus e1 e2) = eval s e1 + eval s e2.
Proof.
time (depind e1; depelim e2; sauto).
(* Undo.
time (depind e1; depelim e2; sauto l: on). *)
Qed. | lem_plus : forall s e1 e2,
eval s (simp_plus e1 e2) = eval s e1 + eval s e2. | Proof.
time (depind e1; depelim e2; sauto).
(* Undo.
time (depind e1; depelim e2; sauto l: on). *)
Qed. | Lemma | lem_plus | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"eval",
"sauto",
"simp_plus"
] | null | 50 | 56 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_plus' : forall s e1 e2,
eval s (simp_plus e1 e2) = eval s e1 + eval s e2.
Proof.
Fail depind e1; sauto.
time (depind e1; sauto dep: on).
(* "dep: on" instructs "sauto" to use the "depelim" tactic for
inversion. This may be slower and it will make your proof depend
on axioms (equivalent to Uniquene... | lem_plus' : forall s e1 e2,
eval s (simp_plus e1 e2) = eval s e1 + eval s e2. | Proof.
Fail depind e1; sauto.
time (depind e1; sauto dep: on).
(* "dep: on" instructs "sauto" to use the "depelim" tactic for
inversion. This may be slower and it will make your proof depend
on axioms (equivalent to Uniqueness of Identity Proofs). *)
Qed. | Lemma | lem_plus' | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"eval",
"sauto",
"simp_plus"
] | null | 58 | 66 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
simp_equal (e1 e2 : expr Nat) :=
match e1, e2 with
| Const Nat n1, Const Nat n2 => Const Bool (n1 =? n2)
| _, _ => Equal e1 e2
end. | simp_equal (e1 e2 : expr Nat) | :=
match e1, e2 with
| Const Nat n1, Const Nat n2 => Const Bool (n1 =? n2)
| _, _ => Equal e1 e2
end. | Definition | simp_equal | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr"
] | null | 70 | 74 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_equal : forall s e1 e2,
eval s (simp_equal e1 e2) = (eval s e1 =? eval s e2).
Proof.
Fail depind e1; sauto.
time (depind e1; sauto dep: on).
Undo.
time (depind e1; depelim e2; sauto).
Qed. | lem_equal : forall s e1 e2,
eval s (simp_equal e1 e2) = (eval s e1 =? eval s e2). | Proof.
Fail depind e1; sauto.
time (depind e1; sauto dep: on).
Undo.
time (depind e1; depelim e2; sauto).
Qed. | Lemma | lem_equal | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"eval",
"sauto",
"simp_equal"
] | null | 76 | 83 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
unpair_type (T : type) :=
option (match T with Prod A B => expr A * expr B | _ => unit end). | unpair_type (T : type) | :=
option (match T with Prod A B => expr A * expr B | _ => unit end). | Definition | unpair_type | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr",
"type"
] | null | 87 | 88 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
unpair {A B : type} (e : expr (Prod A B)) :
option (expr A * expr B) :=
match e in expr T return unpair_type T with
| Pair e1 e2 => Some (e1, e2)
| _ => None
end. | unpair {A B : type} (e : expr (Prod A B)) :
option (expr A * expr B) | :=
match e in expr T return unpair_type T with
| Pair e1 e2 => Some (e1, e2)
| _ => None
end. | Definition | unpair | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr",
"type",
"unpair_type"
] | null | 90 | 95 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
simp_fst {A B : type} (e : expr (Prod A B)) : expr A :=
match unpair e with
| Some (e1, e2) => e1
| None => Fst e
end. | simp_fst {A B : type} (e : expr (Prod A B)) : expr A | :=
match unpair e with
| Some (e1, e2) => e1
| None => Fst e
end. | Definition | simp_fst | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr",
"type",
"unpair"
] | null | 97 | 101 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_fst {A B} : forall s (e : expr (Prod A B)),
eval s (simp_fst e) = fst (eval s e).
Proof.
depind e; sauto.
Qed. | lem_fst {A B} : forall s (e : expr (Prod A B)),
eval s (simp_fst e) = fst (eval s e). | Proof.
depind e; sauto.
Qed. | Lemma | lem_fst | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"eval",
"expr",
"sauto",
"simp_fst"
] | null | 103 | 107 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
simp_snd {A B : type} (e : expr (Prod A B)) : expr B :=
match unpair e with
| Some (e1, e2) => e2
| None => Snd e
end. | simp_snd {A B : type} (e : expr (Prod A B)) : expr B | :=
match unpair e with
| Some (e1, e2) => e2
| None => Snd e
end. | Definition | simp_snd | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr",
"type",
"unpair"
] | null | 111 | 115 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_snd {A B} : forall s (e : expr (Prod A B)),
eval s (simp_snd e) = snd (eval s e).
Proof.
depind e; sauto.
Qed. | lem_snd {A B} : forall s (e : expr (Prod A B)),
eval s (simp_snd e) = snd (eval s e). | Proof.
depind e; sauto.
Qed. | Lemma | lem_snd | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"eval",
"expr",
"sauto",
"simp_snd"
] | null | 117 | 121 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
simp_ite {A} (e : expr Bool) (e1 e2 : expr A) : expr A :=
match e with
| Const Bool true => e1
| Const Bool false => e2
| _ => Ite e e1 e2
end. | simp_ite {A} (e : expr Bool) (e1 e2 : expr A) : expr A | :=
match e with
| Const Bool true => e1
| Const Bool false => e2
| _ => Ite e e1 e2
end. | Definition | simp_ite | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr"
] | null | 125 | 130 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_ite {A} : forall s e (e1 e2 : expr A),
eval s (simp_ite e e1 e2) =
if eval s e then eval s e1 else eval s e2.
Proof.
depind e; sauto.
Qed. | lem_ite {A} : forall s e (e1 e2 : expr A),
eval s (simp_ite e e1 e2) =
if eval s e then eval s e1 else eval s e2. | Proof.
depind e; sauto.
Qed. | Lemma | lem_ite | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"eval",
"expr",
"sauto",
"simp_ite"
] | null | 132 | 137 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
simp {A} (e : expr A) : expr A :=
match e with
| Var n => Var n
| Plus e1 e2 => simp_plus (simp e1) (simp e2)
| Equal e1 e2 => simp_equal (simp e1) (simp e2)
| Pair e1 e2 => Pair (simp e1) (simp e2)
| Fst e => simp_fst (simp e)
| Snd e => simp_snd (simp e)
| Const t c => Const t c
| Ite e e1 e2 => sim... | simp {A} (e : expr A) : expr A | :=
match e with
| Var n => Var n
| Plus e1 e2 => simp_plus (simp e1) (simp e2)
| Equal e1 e2 => simp_equal (simp e1) (simp e2)
| Pair e1 e2 => Pair (simp e1) (simp e2)
| Fst e => simp_fst (simp e)
| Snd e => simp_snd (simp e)
| Const t c => Const t c
| Ite e e1 e2 => simp_ite (simp e) (simp e1) (simp ... | Fixpoint | simp | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"expr",
"simp_equal",
"simp_fst",
"simp_ite",
"simp_plus",
"simp_snd"
] | null | 141 | 151 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_simp {A} : forall s (e : expr A),
eval s (simp e) = eval s e.
Proof.
time (depind e; sauto use: lem_plus, lem_equal, @lem_fst,
@lem_snd, @lem_ite).
Undo.
time (depind e; sauto db: simp_db).
Undo.
time (depind e; simpl; autorewrite with simp_db; sauto).
Qed. | lem_simp {A} : forall s (e : expr A),
eval s (simp e) = eval s e. | Proof.
time (depind e; sauto use: lem_plus, lem_equal, @lem_fst,
@lem_snd, @lem_ite).
Undo.
time (depind e; sauto db: simp_db).
Undo.
time (depind e; simpl; autorewrite with simp_db; sauto).
Qed. | Lemma | lem_simp | examples.tutorial.sauto | examples/tutorial/sauto/exp.v | [
"Program.Equality",
"Arith",
"String"
] | [
"eval",
"expr",
"lem_equal",
"lem_fst",
"lem_ite",
"lem_plus",
"lem_snd",
"sauto",
"simp"
] | null | 153 | 162 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
aexpr :=
| Aval : nat -> aexpr
| Avar : string -> aexpr
| Aplus : aexpr -> aexpr -> aexpr
| Aminus : aexpr -> aexpr -> aexpr. | aexpr | :=
| Aval : nat -> aexpr
| Avar : string -> aexpr
| Aplus : aexpr -> aexpr -> aexpr
| Aminus : aexpr -> aexpr -> aexpr. | Inductive | aexpr | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"Aval"
] | null | 18 | 22 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
Aval : nat >-> aexpr. | Aval : nat >-> aexpr. | Coercion | Aval | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"aexpr"
] | null | 24 | 24 | false | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 | |
"A +! B" := (Aplus A B) (at level 50). | "A +! B" | := (Aplus A B) (at level 50). | Notation | A +! B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 25 | 25 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"A -! B" := (Aminus A B) (at level 50). | "A -! B" | := (Aminus A B) (at level 50). | Notation | A -! B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 26 | 26 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"^ A" := (Avar A) (at level 40). | "^ A" | := (Avar A) (at level 40). | Notation | ^ A | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 27 | 27 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
state := string -> nat. | state | := string -> nat. | Definition | state | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 29 | 29 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
aval (s : state) (e : aexpr) :=
match e with
| Aval n => n
| Avar x => s x
| Aplus x y => aval s x + aval s y
| Aminus x y => aval s x - aval s y
end. | aval (s : state) (e : aexpr) | :=
match e with
| Aval n => n
| Avar x => s x
| Aplus x y => aval s x + aval s y
| Aminus x y => aval s x - aval s y
end. | Fixpoint | aval | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"Aval",
"aexpr",
"state"
] | null | 31 | 37 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
bexpr :=
| Bval : bool -> bexpr
| Bnot : bexpr -> bexpr
| Band : bexpr -> bexpr -> bexpr
| Bless : aexpr -> aexpr -> bexpr. | bexpr | :=
| Bval : bool -> bexpr
| Bnot : bexpr -> bexpr
| Band : bexpr -> bexpr -> bexpr
| Bless : aexpr -> aexpr -> bexpr. | Inductive | bexpr | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"Bval",
"aexpr"
] | null | 39 | 43 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
Bval : bool >-> bexpr. | Bval : bool >-> bexpr. | Coercion | Bval | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"bexpr"
] | null | 45 | 45 | false | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 | |
"~! A" := (Bnot A) (at level 55). | "~! A" | := (Bnot A) (at level 55). | Notation | ~! A | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 46 | 46 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"A &! B" := (Band A B) (at level 55). | "A &! B" | := (Band A B) (at level 55). | Notation | A &! B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 47 | 47 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"A <! B" := (Bless A B) (at level 54). | "A <! B" | := (Bless A B) (at level 54). | Notation | A <! B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 48 | 48 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
bval (s : state) (e : bexpr) :=
match e with
| Bval b => b
| Bnot e1 => negb (bval s e1)
| Band e1 e2 => bval s e1 && bval s e2
| Bless a1 a2 => aval s a1 <? aval s a2
end. | bval (s : state) (e : bexpr) | :=
match e with
| Bval b => b
| Bnot e1 => negb (bval s e1)
| Band e1 e2 => bval s e1 && bval s e2
| Bless a1 a2 => aval s a1 <? aval s a2
end. | Fixpoint | bval | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"Bval",
"aval",
"bexpr",
"state"
] | null | 50 | 56 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
cmd :=
| Nop : cmd
| Assign : string -> aexpr -> cmd
| Seq : cmd -> cmd -> cmd
| If : bexpr -> cmd -> cmd -> cmd
| While : bexpr -> cmd -> cmd. | cmd | :=
| Nop : cmd
| Assign : string -> aexpr -> cmd
| Seq : cmd -> cmd -> cmd
| If : bexpr -> cmd -> cmd -> cmd
| While : bexpr -> cmd -> cmd. | Inductive | cmd | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"aexpr",
"bexpr"
] | null | 58 | 63 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"A <- B" := (Assign A B) (at level 60). | "A <- B" | := (Assign A B) (at level 60). | Notation | A <- B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 65 | 65 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"A ;; B" := (Seq A B) (at level 70). | "A ;; B" | := (Seq A B) (at level 70). | Notation | A ;; B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 66 | 66 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"'If' A 'Then' B 'Else' C" := (If A B C) (at level 65). | "'If' A 'Then' B 'Else' C" | := (If A B C) (at level 65). | Notation | 'If' A 'Then' B 'Else' C | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 67 | 67 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"'While' A 'Do' B" := (While A B) (at level 65). | "'While' A 'Do' B" | := (While A B) (at level 65). | Notation | 'While' A 'Do' B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [] | null | 68 | 68 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
update (s : state) x v y :=
if string_dec x y then v else s y. | update (s : state) x v y | :=
if string_dec x y then v else s y. | Definition | update | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"state"
] | null | 70 | 71 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
state_subst (s : state) (x : string) (a : aexpr) : state :=
(update s x (aval s a)). | state_subst (s : state) (x : string) (a : aexpr) : state | :=
(update s x (aval s a)). | Definition | state_subst | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"aexpr",
"aval",
"state",
"update"
] | null | 73 | 74 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"s [ x := a ]" := (state_subst s x a) (at level 5). | "s [ x := a ]" | := (state_subst s x a) (at level 5). | Notation | s [ x := a ] | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"state_subst"
] | null | 76 | 76 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
BigStep : cmd -> state -> state -> Prop :=
| NopSem : forall s, BigStep Nop s s
| AssignSem : forall s x a, BigStep (x <- a) s s[x := a]
| SeqSem : forall c1 c2 s1 s2 s3, BigStep c1 s1 s2 -> BigStep c2 s2 s3 ->
BigStep (c1 ;; c2) s1 s3
| IfTrue : forall b c1 c2 s s', bval s b -> BigSte... | BigStep : cmd -> state -> state -> Prop | :=
| NopSem : forall s, BigStep Nop s s
| AssignSem : forall s x a, BigStep (x <- a) s s[x := a]
| SeqSem : forall c1 c2 s1 s2 s3, BigStep c1 s1 s2 -> BigStep c2 s2 s3 ->
BigStep (c1 ;; c2) s1 s3
| IfTrue : forall b c1 c2 s s', bval s b -> BigStep c1 s s' ->
... | Inductive | BigStep | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"bval",
"cmd",
"state"
] | Big-step operational semantics | 80 | 92 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"A >> B ==> C" :=
(BigStep A B C) (at level 80, no associativity). | "A >> B ==> C" | :=
(BigStep A B C) (at level 80, no associativity). | Notation | A >> B ==> C | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"BigStep"
] | null | 94 | 95 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_big_step_deterministic :
forall c s s1, c >> s ==> s1 -> forall s2, c >> s ==> s2 -> s1 = s2.
Proof.
time (induction 1; sauto brefl: on).
Undo.
time (induction 1; sauto lazy: on brefl: on).
Undo.
time (induction 1; sauto lazy: on quick: on brefl: on).
Qed. | lem_big_step_deterministic :
forall c s s1, c >> s ==> s1 -> forall s2, c >> s ==> s2 -> s1 = s2. | Proof.
time (induction 1; sauto brefl: on).
Undo.
time (induction 1; sauto lazy: on brefl: on).
Undo.
time (induction 1; sauto lazy: on quick: on brefl: on).
Qed. | Lemma | lem_big_step_deterministic | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"sauto"
] | null | 97 | 105 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
equiv_cmd (c1 c2 : cmd) :=
forall s s', c1 >> s ==> s' <-> c2 >> s ==> s'. | equiv_cmd (c1 c2 : cmd) | :=
forall s s', c1 >> s ==> s' <-> c2 >> s ==> s'. | Definition | equiv_cmd | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"cmd"
] | Program equivalence | 109 | 110 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
"A ~~ B" := (equiv_cmd A B) (at level 75, no associativity). | "A ~~ B" | := (equiv_cmd A B) (at level 75, no associativity). | Notation | A ~~ B | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"equiv_cmd"
] | null | 112 | 112 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_sim_refl : forall c, c ~~ c.
Proof.
sauto.
Qed. | lem_sim_refl : forall c, c ~~ c. | Proof.
sauto.
Qed. | Lemma | lem_sim_refl | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"sauto"
] | null | 114 | 117 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_sim_sym : forall c c', c ~~ c' -> c' ~~ c.
Proof.
sauto unfold: equiv_cmd.
Qed. | lem_sim_sym : forall c c', c ~~ c' -> c' ~~ c. | Proof.
sauto unfold: equiv_cmd.
Qed. | Lemma | lem_sim_sym | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"equiv_cmd",
"sauto"
] | null | 119 | 122 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_sim_trans : forall c1 c2 c3, c1 ~~ c2 -> c2 ~~ c3 -> c1 ~~ c3.
Proof.
sauto unfold: equiv_cmd.
Qed. | lem_sim_trans : forall c1 c2 c3, c1 ~~ c2 -> c2 ~~ c3 -> c1 ~~ c3. | Proof.
sauto unfold: equiv_cmd.
Qed. | Lemma | lem_sim_trans | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"equiv_cmd",
"sauto"
] | null | 124 | 127 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
lem_seq_assoc : forall c1 c2 c3, c1;; (c2;; c3) ~~ (c1;; c2);; c3.
Proof.
time sauto unfold: equiv_cmd.
Undo.
time sauto lazy: on unfold: equiv_cmd.
(* "lazy: on" turns off all eager heuristics *)
(* This may sometimes speed up "sauto" noticeably, but sometimes it
may prevent "sauto" from solving the goa... | lem_seq_assoc : forall c1 c2 c3, c1;; (c2;; c3) ~~ (c1;; c2);; c3. | Proof.
time sauto unfold: equiv_cmd.
Undo.
time sauto lazy: on unfold: equiv_cmd.
(* "lazy: on" turns off all eager heuristics *)
(* This may sometimes speed up "sauto" noticeably, but sometimes it
may prevent "sauto" from solving the goal. *)
(* To increase the performance of "sauto" you may need to f... | Lemma | lem_seq_assoc | examples.tutorial.sauto | examples/tutorial/sauto/imp.v | [
"String",
"Arith",
"Lia",
"Relations"
] | [
"equiv_cmd",
"sauto"
] | null | 129 | 154 | true | https://github.com/lukaszcz/coqhammer | 9e081180c6b00ca3925cf84b08d8621f562f8285 |
Structured dataset from CoqHammer — Automation for dependent type theory via ATPs.
9e081180c6b00ca3925cf84b08d8621f562f8285| Column | Type | Description |
|---|---|---|
| fact | string | Verbatim declaration with the leading keyword removed: signature and body/proof joined |
| statement | string | Signature with the leading keyword removed (verbatim slice) |
| proof | string | Verbatim proof/body, empty if none |
| type | string | Declaration keyword |
| symbolic_name | string | Declaration identifier |
| library | string | Sub-library |
| filename | string | Repository-relative source path |
| imports | list[string] | File-level Require/Import modules |
| deps | list[string] | Intra-corpus identifiers referenced |
| docstring | string | Preceding documentation comment, null if absent |
| line_start | int | First source line |
| line_end | int | Last source line |
| has_proof | bool | Whether a proof block was captured |
| source_url | string | Upstream repository |
| commit | string | Upstream commit extracted |
| Type | Count |
|---|---|
| Lemma | 368 |
| Ltac | 307 |
| Definition | 50 |
| Fixpoint | 47 |
| Notation | 38 |
| Inductive | 34 |
| Instance | 6 |
| Theorem | 5 |
| Class | 4 |
| Coercion | 3 |
| Corollary | 2 |
| Function | 2 |
| Axiom | 2 |
lem_2 : forall n : nat, Nat.Odd n \/ Nat.Odd (n + 1).
hammer. Restart.
hauto lq: on use: Nat.Even_or_Odd, Nat.add_1_r, Nat.Odd_succ.
Qed.
lem_2 | examples/hammer_tests.v:40Statement and proof are available both joined (fact) and split (statement, proof) for
proof-term modeling, autoformalization, retrieval, and dependency analysis via deps.
@misc{coq_hammer_dataset,
title = {Coq-Hammer},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/lukaszcz/coqhammer, commit 9e081180c6b0},
url = {https://huggingface.co/datasets/phanerozoic/Coq-Hammer}
}