Dataset Viewer
Auto-converted to Parquet Duplicate
statement
stringlengths
1
4.15k
proof
stringlengths
0
26.3k
type
stringclasses
26 values
symbolic_name
stringlengths
1
75
library
stringclasses
44 values
filename
stringclasses
463 values
imports
listlengths
0
23
deps
listlengths
0
64
docstring
stringlengths
0
2.4k
source_url
stringclasses
1 value
commit
stringclasses
1 value
le_n_0_eq_stt
:= fun n Hle => eq_sym (proj1 (Nat.le_0_r n) Hle).
Definition
le_n_0_eq_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "eq_sym", "le_0_r" ]
Le.le_n_S Le.le_n_Sn Le.le_Sn_n
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_le_S_stt
:= fun n m => (proj2 (Nat.le_succ_l n m)).
Definition
lt_le_S_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_succ_l" ]
Lt.lt_irrefl
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_n_Sm_le_stt
:= fun n m => (proj1 (Nat.lt_succ_r n m)).
Definition
lt_n_Sm_le_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_succ_r" ]
Lt.lt_le_S
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_lt_n_Sm_stt
:= fun n m => (proj2 (Nat.lt_succ_r n m)).
Definition
le_lt_n_Sm_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_succ_r" ]
Lt.lt_n_Sm_le
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_not_lt_stt
:= fun n m => (proj1 (Nat.le_ngt n m)).
Definition
le_not_lt_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_ngt" ]
Lt.le_lt_n_Sm
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_not_le_stt
:= fun n m => (proj1 (Nat.lt_nge n m)).
Definition
lt_not_le_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_nge" ]
Lt.le_not_lt
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
neq_0_lt_stt
:= fun n Hn => proj1 (Nat.neq_0_lt_0 n) (Nat.neq_sym 0 n Hn).
Definition
neq_0_lt_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "neq_0_lt_0", "neq_sym" ]
Lt.lt_0_Sn Lt.lt_n_0
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_0_neq_stt
:= fun n Hlt => Nat.neq_sym n 0 (proj2 (Nat.neq_0_lt_0 n) Hlt).
Definition
lt_0_neq_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "neq_0_lt_0", "neq_sym" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_n_S_stt
:= fun n m => (proj1 (Nat.succ_lt_mono n m)).
Definition
lt_n_S_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "succ_lt_mono" ]
Lt.lt_n_Sn Lt.lt_S
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_S_n_stt
:= fun n m => (proj2 (Nat.succ_lt_mono n m)).
Definition
lt_S_n_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "succ_lt_mono" ]
Lt.lt_n_S
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_pred_stt
:= fun n m => proj1 (Nat.lt_succ_lt_pred n m).
Definition
lt_pred_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_succ_lt_pred" ]
Lt.lt_S_n
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_pred_n_n_stt
:= fun n Hlt => Nat.lt_pred_l n (proj2 (Nat.neq_0_lt_0 n) Hlt).
Definition
lt_pred_n_n_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_pred_l", "neq_0_lt_0" ]
Lt.lt_pred
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_Sn_O_stt : forall n, S n > 0
:= Nat.lt_0_succ.
Definition
gt_Sn_O_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_0_succ" ]
Lt.lt_le_weak
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_Sn_n_stt : forall n, S n > n
:= Nat.lt_succ_diag_r.
Definition
gt_Sn_n_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_succ_diag_r" ]
Gt.gt_Sn_O
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_n_S_stt : forall n m, n > m -> S n > S m
:= fun n m Hgt => proj1 (Nat.succ_lt_mono m n) Hgt.
Definition
gt_n_S_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "succ_lt_mono" ]
Gt.gt_Sn_n
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_S_n_stt : forall n m, S m > S n -> m > n
:= fun n m Hgt => proj2 (Nat.succ_lt_mono n m) Hgt.
Definition
gt_S_n_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "succ_lt_mono" ]
Gt.gt_n_S
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_pred_stt : forall n m, m > S n -> pred m > n
:= fun n m Hgt => proj1 (Nat.lt_succ_lt_pred n m) Hgt.
Definition
gt_pred_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_succ_lt_pred", "pred" ]
Gt.gt_S_n
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_irrefl_stt : forall n, ~ n > n
:= Nat.lt_irrefl.
Definition
gt_irrefl_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_irrefl" ]
Gt.gt_pred
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_asym_stt : forall n m, n > m -> ~ m > n
:= fun n m => Nat.lt_asymm m n.
Definition
gt_asym_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_asymm" ]
Gt.gt_irrefl
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_not_gt_stt : forall n m, n <= m -> ~ n > m
:= fun n m => proj1 (Nat.le_ngt n m).
Definition
le_not_gt_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_ngt" ]
Gt.gt_asym
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_not_le_stt: forall n m, n > m -> ~ n <= m
:= fun n m => proj1 (Nat.lt_nge m n).
Definition
gt_not_le_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_nge" ]
Gt.le_not_gt
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_S_gt_stt: forall n m, S n <= m -> m > n
:= fun n m => proj1 (Nat.le_succ_l n m).
Definition
le_S_gt_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_succ_l" ]
Gt.gt_not_le
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_S_le_stt : forall n m, S m > n -> n <= m
:= fun n m => proj2 (Nat.succ_le_mono n m).
Definition
gt_S_le_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "succ_le_mono" ]
Gt.le_S_gt
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_le_S_stt : forall n m, m > n -> S n <= m
:= fun n m => proj2 (Nat.le_succ_l n m).
Definition
gt_le_S_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_succ_l" ]
Gt.gt_S_le
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_gt_S_stt : forall n m, n <= m -> S m > n
:= fun n m => proj1 (Nat.succ_le_mono n m).
Definition
le_gt_S_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "succ_le_mono" ]
Gt.gt_le_S
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_trans_S_stt : forall n m p, S n > m -> m > p -> n > p
:= fun n m p Hgt1 Hgt2 => Nat.lt_le_trans p m n Hgt2 (proj2 (Nat.succ_le_mono _ _) Hgt1).
Definition
gt_trans_S_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_le_trans", "succ_le_mono" ]
Gt.le_gt_S
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_gt_trans_stt : forall n m p, m <= n -> m > p -> n > p
:= fun n m p Hle Hgt => Nat.lt_le_trans p m n Hgt Hle.
Definition
le_gt_trans_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_le_trans" ]
Gt.gt_trans_S
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_le_trans_stt : forall n m p, n > m -> p <= m -> n > p
:= fun n m p Hgt Hle => Nat.le_lt_trans p m n Hle Hgt.
Definition
gt_le_trans_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_lt_trans" ]
Gt.le_gt_trans
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
plus_gt_compat_l_stt : forall n m p, n > m -> p + n > p + m
:= fun n m p Hgt => proj1 (Nat.add_lt_mono_l m n p) Hgt.
Definition
plus_gt_compat_l_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "add_lt_mono_l" ]
Gt.gt_le_trans
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
plus_assoc_reverse_stt
:= fun n m p => eq_sym (Nat.add_assoc n m p).
Definition
plus_assoc_reverse_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "add_assoc", "eq_sym" ]
Plus.plus_assoc
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_plus_r_stt
:= (fun n m => Nat.le_add_l m n).
Definition
le_plus_r_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_add_l" ]
Plus.plus_le_compat_r
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_plus_trans_stt
:= (fun n m p Hle => Nat.le_trans n _ _ Hle (Nat.le_add_r m p)).
Definition
le_plus_trans_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_add_r", "le_trans" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_plus_trans_stt
:= (fun n m p Hlt => Nat.lt_le_trans n _ _ Hlt (Nat.le_add_r m p)).
Definition
lt_plus_trans_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_add_r", "lt_le_trans" ]
Plus.le_plus_l Plus.le_plus_r_stt Plus.le_plus_trans_stt
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
minus_n_O_stt
:= fun n => eq_sym (Nat.sub_0_r n).
Definition
minus_n_O_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "eq_sym", "sub_0_r" ]
** [sub]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
minus_Sn_m_stt
:= fun n m Hle => eq_sym (Nat.sub_succ_l m n Hle).
Definition
minus_Sn_m_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "eq_sym", "sub_succ_l" ]
Minus.minus_n_O
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
minus_diag_reverse_stt
:= fun n => eq_sym (Nat.sub_diag n).
Definition
minus_diag_reverse_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "eq_sym", "sub_diag" ]
Minus.minus_Sn_m
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
minus_plus_simpl_l_reverse_stt n m p : n - m = p + n - (p + m).
Proof. now rewrite Nat.sub_add_distr, Nat.add_comm, Nat.add_sub. Qed.
Lemma
minus_plus_simpl_l_reverse_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "add_comm", "add_sub", "sub_add_distr" ]
Minus.minus_diag_reverse
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
plus_minus_stt
:= fun n m p Heq => eq_sym (Nat.add_sub_eq_l n m p (eq_sym Heq)).
Definition
plus_minus_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "add_sub_eq_l", "eq_sym" ]
Minus.minus_plus_simpl_l_reverse
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
minus_plus_stt
:= (fun n m => eq_ind _ (fun x => x - n = m) (Nat.add_sub m n) _ (Nat.add_comm _ _)).
Definition
minus_plus_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "add_comm", "add_sub" ]
Minus.plus_minus
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_plus_minus_stt
:= fun n m Hle => eq_sym (eq_trans (Nat.add_comm _ _) (Nat.sub_add n m Hle)).
Definition
le_plus_minus_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "add_comm", "eq_sym", "eq_trans", "sub_add" ]
Minus.minus_plus
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_plus_minus_r_stt
:= fun n m Hle => eq_trans (Nat.add_comm _ _) (Nat.sub_add n m Hle).
Definition
le_plus_minus_r_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "add_comm", "eq_trans", "sub_add" ]
Minus.le_plus_minus
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_O_minus_lt_stt : forall n m, 0 < n - m -> m < n
:= fun n m => proj2 (Nat.lt_add_lt_sub_r 0 n m).
Definition
lt_O_minus_lt_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_add_lt_sub_r" ]
Minus.lt_minus
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
mult_assoc_reverse_stt
:= fun n m p => eq_sym (Nat.mul_assoc n m p).
Definition
mult_assoc_reverse_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "eq_sym", "mul_assoc" ]
Mult.mult_minus_distr_l
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
mult_O_le_stt n m : m = 0 \/ n <= m * n.
Proof. destruct m; [left|right]; simpl; trivial using Nat.le_add_r. Qed.
Lemma
mult_O_le_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "le_add_r", "left", "right" ]
Mult.mult_assoc_reverse Mult.mult_assoc
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
mult_S_lt_compat_l_stt
:= (fun n m p Hlt => proj1 (Nat.mul_lt_mono_pos_l (S n) m p (Nat.lt_0_succ n)) Hlt).
Definition
mult_S_lt_compat_l_stt
Arith
theories/Arith/Arith_base.v
[ "Stdlib", "PeanoNat", "Factorial", "Between", "Peano_dec", "Compare_dec", "EqNat", "Wf_nat" ]
[ "lt_0_succ", "mul_lt_mono_pos_l" ]
Mult.mult_le_compat_l
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
between k : nat -> Prop
:= | bet_emp : between k k | bet_S : forall l, between k l -> P l -> between k (S l).
Inductive
between
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[]
The [between] type expresses the concept [forall i: nat, k <= i < l -> P i.].
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
bet_eq : forall k l, l = k -> between k l.
Proof. intros * ->; constructor. Qed.
Lemma
bet_eq
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
between_le : forall k l, between k l -> k <= l.
Proof. induction 1; auto. Qed.
Lemma
between_le
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "induction" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
between_Sk_l : forall k l, between k l -> S k <= l -> between (S k) l.
Proof. induction 1 as [|* [|]]; auto. - intros Hle; exfalso; apply (Nat.nle_succ_diag_l _ Hle). - intros Hle; inversion Hle; constructor; auto. Qed.
Lemma
between_Sk_l
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "induction", "nle_succ_diag_l" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
between_restr : forall k l (m:nat), k <= l -> l <= m -> between k m -> between l m.
Proof. induction 1; auto. intros; auto. apply between_Sk_l; auto. apply IHle; auto. transitivity (S m0); auto. Qed.
Lemma
between_restr
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "between_Sk_l", "induction" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
exists_between k : nat -> Prop
:= | exists_S : forall l, exists_between k l -> exists_between k (S l) | exists_le : forall l, k <= l -> Q l -> exists_between k (S l).
Inductive
exists_between
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[]
The [exists_between] type expresses the concept [exists i: nat, k <= i < l /\ Q i].
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
exists_le_S : forall k l, exists_between k l -> S k <= l.
Proof. induction 1; auto. apply -> Nat.succ_le_mono; assumption. Qed.
Lemma
exists_le_S
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "exists_between", "induction", "succ_le_mono" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
exists_lt : forall k l, exists_between k l -> k < l.
Proof. exact exists_le_S. Qed.
Lemma
exists_lt
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "exists_between", "exists_le_S" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
exists_S_le : forall k l, exists_between k (S l) -> k <= l.
Proof. intros; apply le_S_n; auto. Qed.
Lemma
exists_S_le
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "exists_between" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int p q r
:= p <= r /\ r < q.
Definition
in_int
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int_intro : forall p q r, p <= r -> r < q -> in_int p q r.
Proof. split; assumption. Qed.
Lemma
in_int_intro
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "in_int", "split" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int_lt : forall p q r, in_int p q r -> p < q.
Proof. intros * []. eapply Nat.le_lt_trans; eassumption. Qed.
Lemma
in_int_lt
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "in_int", "le_lt_trans" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int_p_Sq : forall p q r, in_int p (S q) r -> in_int p q r \/ r = q.
Proof. intros p q r []. destruct (proj1 (Nat.lt_eq_cases r q)); auto. apply Nat.lt_succ_r; assumption. Qed.
Lemma
in_int_p_Sq
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "in_int", "lt_eq_cases", "lt_succ_r" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int_S : forall p q r, in_int p q r -> in_int p (S q) r.
Proof. intros * []; auto. Qed.
Lemma
in_int_S
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "in_int" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int_Sp_q : forall p q r, in_int (S p) q r -> in_int p q r.
Proof. intros * []; auto. apply in_int_intro; auto. transitivity (S p); auto. Qed.
Lemma
in_int_Sp_q
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "in_int", "in_int_intro" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
between_in_int : forall k l, between k l -> forall r, in_int k l r -> P r.
Proof. intro k; induction 1 as [|l]; intros r ?. - absurd (k < k). { apply Nat.lt_irrefl. } eapply in_int_lt; eassumption. - destruct (in_int_p_Sq k l r) as [| ->]; auto. Qed.
Lemma
between_in_int
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "in_int", "in_int_lt", "in_int_p_Sq", "induction", "lt_irrefl" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int_between : forall k l, k <= l -> (forall r, in_int k l r -> P r) -> between k l.
Proof. induction 1; auto. Qed.
Lemma
in_int_between
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "in_int", "induction" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
exists_in_int : forall k l, exists_between k l -> exists2 m : nat, in_int k l m & Q m.
Proof. induction 1 as [* ? (p, ?, ?)|l]. - exists p; auto. - exists l; auto. Qed.
Lemma
exists_in_int
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "exists_between", "in_int", "induction" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
in_int_exists : forall k l r, in_int k l r -> Q r -> exists_between k l.
Proof. intros * (?, lt_r_l) ?. induction lt_r_l; auto. Qed.
Lemma
in_int_exists
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "exists_between", "in_int", "induction" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
between_or_exists : forall k l, k <= l -> (forall n:nat, in_int k l n -> P n \/ Q n) -> between k l \/ exists_between k l.
Proof. induction 1 as [|m ? IHle]. - auto. - intros P_or_Q. destruct IHle; auto. destruct (P_or_Q m); auto. Qed.
Lemma
between_or_exists
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "exists_between", "in_int", "induction" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
between_not_exists : forall k l, between k l -> (forall n:nat, in_int k l n -> P n -> ~ Q n) -> ~ exists_between k l.
Proof. intro k; induction 1 as [|l]; red; intros. - absurd (k < k). { apply Nat.lt_irrefl. } auto. - absurd (Q l). { auto. } destruct (exists_in_int k (S l)) as (l',[],?). + auto. + replace l with l'. { trivial. } destruct (proj1 (Nat.lt_eq_cases l' l)); auto. * apply Nat.l...
Lemma
between_not_exists
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "exists_between", "exists_in_int", "in_int", "in_int_exists", "induction", "lt_eq_cases", "lt_irrefl", "lt_succ_r", "replace" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
P_nth (init:nat) : nat -> nat -> Prop
:= | nth_O : P_nth init init 0 | nth_S : forall k l (n:nat), P_nth init k n -> between (S k) l -> Q l -> P_nth init l (S n).
Inductive
P_nth
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "between", "init" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
nth_le : forall (init:nat) l (n:nat), P_nth init l n -> init <= l.
Proof. induction 1 as [|a b c H0 H1 H2 H3]. - auto. - eapply Nat.le_trans; eauto. apply between_le in H2. transitivity (S a); auto. Qed.
Lemma
nth_le
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "P_nth", "between_le", "induction", "init", "le_trans" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
eventually (n:nat)
:= exists2 k : nat, k <= n & Q k.
Definition
eventually
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
event_O : eventually 0 -> Q 0.
Proof. intros (x, ?, ?). replace 0 with x; auto. apply Nat.le_0_r; assumption. Qed.
Lemma
event_O
Arith
theories/Arith/Between.v
[ "Stdlib", "PeanoNat" ]
[ "eventually", "le_0_r", "replace" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
notzerop n
:= sumbool_not _ _ (zerop n).
Definition
notzerop
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "zerop" ]
The decidability of equality and order relations over type [nat] give some boolean functions with the adequate specification.
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_ge_dec : forall x y, {x < y} + {x >= y}
:= fun n m => sumbool_not _ _ (le_lt_dec m n).
Definition
lt_ge_dec
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "le_lt_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
nat_lt_ge_bool x y
:= bool_of_sumbool (lt_ge_dec x y).
Definition
nat_lt_ge_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "lt_ge_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
nat_ge_lt_bool x y
:= bool_of_sumbool (sumbool_not _ _ (lt_ge_dec x y)).
Definition
nat_ge_lt_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "lt_ge_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
nat_le_gt_bool x y
:= bool_of_sumbool (le_gt_dec x y).
Definition
nat_le_gt_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "le_gt_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
nat_gt_le_bool x y
:= bool_of_sumbool (sumbool_not _ _ (le_gt_dec x y)).
Definition
nat_gt_le_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "le_gt_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
nat_eq_bool x y
:= bool_of_sumbool (eq_nat_dec x y).
Definition
nat_eq_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "eq_nat_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
nat_noteq_bool x y
:= bool_of_sumbool (sumbool_not _ _ (eq_nat_dec x y)).
Definition
nat_noteq_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "eq_nat_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
zerop_bool x
:= bool_of_sumbool (zerop x).
Definition
zerop_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "zerop" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
notzerop_bool x
:= bool_of_sumbool (notzerop x).
Definition
notzerop_bool
Arith
theories/Arith/Bool_nat.v
[ "Stdlib", "Compare_dec", "Peano_dec", "Sumbool" ]
[ "notzerop" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
to_nat '(x, y) : nat
:= y + (nat_rec _ 0 (fun i m => (S i) + m) (y + x)).
Definition
to_nat
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[]
Cantor pairing [to_nat]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
of_nat (n : nat) : nat * nat
:= nat_rec _ (0, 0) (fun _ '(x, y) => match x with | S x => (x, S y) | _ => (S y, 0) end) n.
Definition
of_nat
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[]
Cantor pairing inverse [of_nat]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
cancel_of_to p : of_nat (to_nat p) = p.
Proof. enough (H : forall n p, to_nat p = n -> of_nat n = p) by now apply H. intro n. induction n as [|n IHn]. - now intros [[|?] [|?]]. - intros [x [|y]]. + destruct x as [|x]; [discriminate|]. intros [=H]. cbn. fold (of_nat n). rewrite (IHn (0, x)); [reflexivity|]. rewrite <- H. cbn. now...
Lemma
cancel_of_to
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[ "add_0_r", "add_succ_r", "fold", "induction", "of_nat", "to_nat" ]
[of_nat] is the left inverse for [to_nat]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
to_nat_inj p q : to_nat p = to_nat q -> p = q.
Proof. intros H %(f_equal of_nat). now rewrite ?cancel_of_to in H. Qed.
Corollary
to_nat_inj
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[ "cancel_of_to", "of_nat", "to_nat" ]
[to_nat] is injective
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
cancel_to_of n : to_nat (of_nat n) = n.
Proof. induction n as [|n IHn]; [reflexivity|]. cbn. fold (of_nat n). destruct (of_nat n) as [[|x] y]. - rewrite <- IHn. cbn. now rewrite PeanoNat.Nat.add_0_r. - rewrite <- IHn. cbn. now rewrite (Nat.add_succ_r y x). Qed.
Lemma
cancel_to_of
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[ "add_0_r", "add_succ_r", "fold", "induction", "of_nat", "to_nat" ]
[to_nat] is the left inverse for [of_nat]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
of_nat_inj n m : of_nat n = of_nat m -> n = m.
Proof. intros H %(f_equal to_nat). now rewrite ?cancel_to_of in H. Qed.
Corollary
of_nat_inj
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[ "cancel_to_of", "of_nat", "to_nat" ]
[of_nat] is injective
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
to_nat_spec x y : to_nat (x, y) * 2 = y * 2 + (y + x) * S (y + x).
Proof. cbn; induction (y + x) as [|n IHn]; cbn; [now rewrite !Nat.add_0_r|]. rewrite <-plus_Sn_m, Nat.add_assoc, (Nat.add_comm y), <-Nat.add_assoc. rewrite Nat.mul_add_distr_r, IHn, Nat.add_comm, <-Nat.add_assoc. apply f_equal2; [reflexivity|]. rewrite Nat.mul_comm, <-Nat.mul_add_distr_l. rewrite <-!plus_Sn...
Lemma
to_nat_spec
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[ "add_0_r", "add_1_r", "add_assoc", "add_comm", "induction", "mul_1_l", "mul_add_distr_l", "mul_add_distr_r", "mul_comm", "to_nat" ]
Polynomial specifications of [to_nat]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
to_nat_spec2 x y : to_nat (x, y) = y + (y + x) * S (y + x) / 2.
Proof. now rewrite <- Nat.div_add_l, <- to_nat_spec, Nat.div_mul. Qed.
Lemma
to_nat_spec2
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[ "div_add_l", "div_mul", "to_nat", "to_nat_spec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
to_nat_non_decreasing x y : y + x <= to_nat (x, y).
Proof. pose proof (to_nat_spec x y). rewrite (Nat.mul_le_mono_pos_r _ _ 2 Nat.lt_0_2), H. rewrite Nat.mul_add_distr_r, <-Nat.add_le_mono_l. case x as [|x]; [now rewrite Nat.mul_0_l; apply le_0_n|]. rewrite Nat.mul_add_distr_r, <-(Nat.add_0_l (S x * 2)); apply Nat.add_le_mono. now apply le_0_n. apply Nat...
Lemma
to_nat_non_decreasing
Arith
theories/Arith/Cantor.v
[ "Stdlib", "PeanoNat" ]
[ "add_0_l", "add_1_r", "add_assoc", "add_le_mono", "add_le_mono_l", "le_add_l", "lt_0_2", "mul_0_l", "mul_add_distr_r", "mul_le_mono_l", "mul_le_mono_pos_r", "proof", "to_nat", "to_nat_spec" ]
[to_nat] is non-decreasing in (the sum of) pair components
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
not_eq_sym
:= not_eq_sym (only parsing).
Notation
not_eq_sym
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_or_le_S
:= le_le_S_dec.
Definition
le_or_le_S
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[ "le_le_S_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
Pcompare
:= gt_eq_gt_dec.
Definition
Pcompare
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[ "gt_eq_gt_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_dec : forall n m, {n <= m} + {m <= n}.
Proof. exact le_ge_dec. Qed.
Lemma
le_dec
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[ "le_ge_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_or_eq n m
:= {m > n} + {n = m}.
Definition
lt_or_eq
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_decide : forall n m, n <= m -> lt_or_eq n m.
Proof. exact le_lt_eq_dec. Qed.
Lemma
le_decide
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[ "le_lt_eq_dec", "lt_or_eq" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
le_le_S_eq : forall n m, n <= m -> S n <= m \/ n = m.
Proof. exact (fun n m Hle => proj1 (Nat.lt_eq_cases n m) Hle). Qed.
Lemma
le_le_S_eq
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[ "lt_eq_cases" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
discrete_nat : forall n m, n < m -> S n = m \/ (exists r : nat, m = S (S (n + r))).
Proof. intros m n H. lapply (proj1 (Nat.le_succ_l m n)); auto. intro H'; lapply (proj1 (Nat.lt_eq_cases (S m) n)); auto. induction 1; auto. right; exists (n - S (S m)); simpl. rewrite (Nat.add_comm m (n - S (S m))). rewrite (plus_n_Sm (n - S (S m)) m). rewrite (plus_n_Sm (n - S (S m)) (S m)). rewrite ...
Lemma
discrete_nat
Arith
theories/Arith/Compare.v
[ "Stdlib", "PeanoNat", "Compare_dec", "Wf_nat" ]
[ "add_0_r", "add_comm", "add_sub_assoc", "induction", "le_succ_l", "lt_eq_cases", "right", "sub_diag" ]
By special request of G. Kahn - Used in Group Theory
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
zerop n : {n = 0} + {0 < n}.
Proof. destruct n; [left|right]; auto. apply Nat.lt_0_succ. Defined.
Definition
zerop
Arith
theories/Arith/Compare_dec.v
[ "Stdlib", "PeanoNat", "Decidable" ]
[ "left", "lt_0_succ", "right" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
lt_eq_lt_dec n m : {n < m} + {n = m} + {m < n}.
Proof. induction n as [|n IHn] in m |- *; destruct m as [|m]; auto. - left; left; apply Nat.lt_0_succ. - right; apply Nat.lt_0_succ. - destruct (IHn m) as [[H|H]|H]; auto. + left; left; now apply Nat.succ_lt_mono in H. + right; now apply Nat.succ_lt_mono in H. Defined.
Definition
lt_eq_lt_dec
Arith
theories/Arith/Compare_dec.v
[ "Stdlib", "PeanoNat", "Decidable" ]
[ "induction", "left", "lt_0_succ", "right", "succ_lt_mono" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
gt_eq_gt_dec n m : {m > n} + {n = m} + {n > m}.
Proof. now apply lt_eq_lt_dec. Defined.
Definition
gt_eq_gt_dec
Arith
theories/Arith/Compare_dec.v
[ "Stdlib", "PeanoNat", "Decidable" ]
[ "lt_eq_lt_dec" ]
https://github.com/rocq-prover/stdlib
f76a666b0b2c28c671d4fdf6dd25bcab865b9c36
End of preview. Expand in Data Studio

Coq-Stdlib

Structured dataset of definitions and theorems from the Coq standard library.

Source

Schema

Column Type Description
statement string Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof
proof string Verbatim proof/body, empty if the declaration has 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, empty if absent
source_url string Upstream repository
commit string Upstream commit extracted

Statistics

  • Entries: 18,419
  • With proof: 17,842 (96.9%)
  • With docstring: 2,948 (16.0%)
  • Libraries: 44

By type

Type Count
Lemma 10,045
Definition 2,527
Notation 1,550
Theorem 1,386
Instance 736
Ltac 597
Fixpoint 512
Parameter 305
Inductive 182
Axiom 127
Hypothesis 107
Let 105
Record 60
Class 45
Example 42
Corollary 24
Fact 17
Coercion 12
Remark 11
Scheme 10
Parameters 6
CoFixpoint 5
Variant 3
CoInductive 3
Proposition 1
Structure 1

Example

gt_pred_stt : forall n m, m > S n -> pred m > n
:= fun n m Hgt => proj1 (Nat.lt_succ_lt_pred n m) Hgt.
  • type: Definition | symbolic_name: gt_pred_stt | theories/Arith/Arith_base.v

Use

Each declaration is split into a statement (signature/claim) and a proof (body) that are disjoint and together form the complete declaration, for proof modeling, autoformalization, retrieval, and dependency analysis via deps.

Citation

@misc{coq_stdlib_dataset,
  title  = {Coq-Stdlib},
  author = {Norton, Charles},
  year   = {2026},
  note   = {Extracted from https://github.com/rocq-prover/stdlib, commit f76a666b0b2c},
  url    = {https://huggingface.co/datasets/phanerozoic/Coq-Stdlib}
}
Downloads last month
87

Collection including phanerozoic/Coq-Stdlib