Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: ArrowInvalid
Message: JSON parse error: Column(/tests/[]) changed from object to number in row 42
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 160, in _generate_tables
df = pandas_read_json(f)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 38, in pandas_read_json
return pd.read_json(path_or_buf, **kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 815, in read_json
return json_reader.read()
File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1025, in read
obj = self._get_object_parser(self.data)
File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1051, in _get_object_parser
obj = FrameParser(json, **kwargs).parse()
File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1187, in parse
self._parse()
File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1403, in _parse
ujson_loads(json, precise_float=self.precise_float), dtype=None
ValueError: Trailing data
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1855, in _prepare_split_single
for _, table in generator:
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 163, in _generate_tables
raise e
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 137, in _generate_tables
pa_table = paj.read_json(
File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: JSON parse error: Column(/tests/[]) changed from object to number in row 42
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1436, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1053, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 925, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1001, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1742, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1898, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
program string | specification string | file_path string | lemma_name string | context string | error null | short_description string | long_description string | tests list |
|---|---|---|---|---|---|---|---|---|
Section Factorization_for_Verification.
Variable A : Set.
Variable BASE : BT.
Let b := base BASE.
Let Num := num BASE.
Let Digit := digit BASE.
Let Val_bound := val_bound BASE.
Variable R : forall n : nat, A -> inf n -> inf n -> A -> Prop.
Definition Connection := connection A Digit Digit (R b).
Notation Factorizable :... | Theorem factorization_for_verification :
factorizable _ R ->
proper _ BASE R ->
forall (n : nat) (X Y : Num n) (a a' : A),
Connection n a X Y a' -> R (exp b n) a (Val_bound n X) (Val_bound n Y) a'. | coq-projects/coqgym/coq-projects/hardware/Factorization/Factorization_Verif.v | factorization_for_verification | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
BT = sig (fun b : nat => lt O b)
: Set
*** [b := base BASE : nat]
inf = fun n : nat => sig (fun x : nat => lt x n)
: forall _ : nat, Set
*** [Num := num B... | null | Factorization and Verification in Numeral Systems | Validates factorization and properties under numeral system base, ensuring proper connection implies specific relational properties between numeral expansions. | [
{
"coq_statement": "Compute exp 2 3.",
"expected_output": "8",
"comment": "Computes 2 raised to the power of 3 using the exp function, resulting in 2 * 2 * 2 = 8."
},
{
"coq_statement": "Compute base {exist _ 2 (Nat.lt_0_2)}.",
"expected_output": "2",
"comment": "The base function extrac... |
Section Three_inputs.
Variable FR : forall n : nat, A -> inf n -> inf n -> A.
Let R (n : nat) (a : A) (x y : inf n) (a' : A) : Prop := a' = FR n a x y. | Lemma prop_Rel :
proper R ->
forall (X Y : Num 0) (a : A), R 1 a (Val_bound 0 X) (Val_bound 0 Y) a. | coq-projects/coqgym/coq-projects/hardware/Factorization/Factorization.v | prop_Rel | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
BT = sig (fun b : nat => lt O b)
: Set
*** [b := base BASE : nat]
inf = fun n : nat => sig (fun x : nat => lt x n)
: forall _ : nat, Set
*** [Cons := cons... | null | Dependency on Proper Relation for Numeric Operation on Bound Values | Proving in Lemma prop_Rel that a relation holds for a given numeral transformation under certain proper conditions in Coq. | [
{
"coq_statement": "Compute exp 2 0.",
"expected_output": "1",
"comment": "(* exp 2 0 -> 1 because any number to the power of 0 is 1 *)"
},
{
"coq_statement": "Compute exp 2 3.",
"expected_output": "8",
"comment": "(* exp 2 3 -> 8 since 2^3 = 2 * 2 * 2 = 8 *)"
},
{
"coq_statement... |
Section Three_inputs.
Variable FR : forall n : nat, A -> inf n -> inf n -> A.
Let R (n : nat) (a : A) (x y : inf n) (a' : A) : Prop := a' = FR n a x y.
intros P X Y a.
replace X with (nil (digit BASE)); auto with arith.
replace Y with (nil (digit BASE)); auto with arith.
Qed. | Lemma fact_Rel :
factorizable R ->
forall (n : nat) (X Y : Num (S n)) (a a' : A),
R (exp b n) (FR b a (Hd Digit n X) (Hd Digit n Y))
(Val_bound n (Tl (S n) X)) (Val_bound n (Tl (S n) Y)) a' ->
R (exp b (S n)) a (Val_bound (S n) X) (Val_bound (S n) Y) a'. | coq-projects/coqgym/coq-projects/hardware/Factorization/Factorization.v | fact_Rel | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
inf = fun n : nat => sig (fun x : nat => lt x n)
: forall _ : nat, Set
Inductive list (A : Set) : forall _ : nat, Set :=
nil : list A O
| cons : forall (... | null | Relationship between recursive operations on numerical representations | Establishes conditions under which a recursive relation R holds for sequential expansions of numeral-based structures in Coq. | [
{
"coq_statement": "Compute Hd Digit 1 (cons 1 (digit BASE) (nil Digit)).",
"expected_output": "(* digit BASE *)",
"comment": "(* Extracts the head from a list of digits constructed using `cons` and `nil`. The list has one element, so the head is 'digit BASE'. *)"
},
{
"coq_statement": "Compute ... |
Section Comparator_Rel.
Variable BASE : BT.
Definition FR (n : nat) (o : order) (x y : inf n) : order :=
match o return order with
| L => L
| E => Compare_Nat.comparison (val_inf n x) (val_inf n y)
| G => G
end.
Definition R (n : nat) (o : order) (x y : inf n)
(o' : order) : Prop := o' = FR n o x y.
Notation Proper := ... | Lemma is_proper : proper _ BASE R. | coq-projects/coqgym/coq-projects/hardware/Factorization/Comparator/Comparator_Relation.v | is_proper | BT = sig (fun b : nat => lt O b)
: Set
R =
fun (n : nat) (o : order) (x y : inf n) (o' : order) => eq o' (FR n o x y)
: forall (n : nat) (_ : order) (_ : inf n) (_ : inf n) (_ : order), Prop
Inductive order : Set := L : order | E : order | G : order
proper =
fun (A : Set) (BASE : BT) =>
let Digit := digit ... | null | Proving properness of a relational comparator function | Properness of relational comparator R over elements in an order-structured set BASE ensures consistent comparison results in specific cases. | [
{
"coq_statement": "Compute FR 2 L (Build_inf 1) (Build_inf 2).",
"expected_output": "L",
"comment": "(* Since the order input is L, FR should directly return L regardless of the inf values. *)"
},
{
"coq_statement": "Compute FR 2 E (Build_inf 3) (Build_inf 3).",
"expected_output": "E",
... |
Section Comparator_Rel.
Variable BASE : BT.
Definition FR (n : nat) (o : order) (x y : inf n) : order :=
match o return order with
| L => L
| E => Compare_Nat.comparison (val_inf n x) (val_inf n y)
| G => G
end.
Definition R (n : nat) (o : order) (x y : inf n)
(o' : order) : Prop := o' = FR n o x y.
Notation Proper := ... | Lemma is_factorizable : factorizable _ R. | coq-projects/coqgym/coq-projects/hardware/Factorization/Comparator/Comparator_Relation.v | is_factorizable | BT = sig (fun b : nat => lt O b)
: Set
R =
fun (n : nat) (o : order) (x y : inf n) (o' : order) => eq o' (FR n o x y)
: forall (n : nat) (_ : order) (_ : inf n) (_ : inf n) (_ : order), Prop
factorizable =
fun (A : Set)
(R : forall (n : nat) (_ : A) (_ : inf n) (_ : inf n) (_ : A), Prop) =>
forall (m n : ... | null | Factorizability of Relation R over Ordered Structures | Demonstrates the relational property R is factorizable, scaling from components to full structures using multiplication and orders. | [
{
"coq_statement": "Compute FR 2 L (Some 1) (Some 2).",
"expected_output": "L",
"comment": "(* When the initial order is L (less than), the result should remain L regardless of comparison. *)"
},
{
"coq_statement": "Compute FR 2 E (Some 1) (Some 1).",
"expected_output": "E",
"comment": "... |
Require Export Factorization_Prog.
Require Export Comparator_Relation.
Parameter BASE : BT.
Definition b := base BASE.
Definition Num := num BASE.
Definition Val_bound := val_bound BASE.
Definition Digit := digit BASE.
Definition Tl := tl Digit. | Theorem Specif_Comp :
forall (n : nat) (o : order) (X Y : Num n),
{o' : order | R (exp b n) o (Val_bound n X) (Val_bound n Y) o'}. | coq-projects/coqgym/coq-projects/hardware/Factorization/Comparator/Comp_Prog.v | Specif_Comp | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
b = base BASE
: nat
R =
fun (n : nat) (o : order) (x y : inf n) (o' : order) => eq o' (FR n o x y)
: forall (n : nat) (_ : order) (_ : inf n) (_ : inf n)... | null | Comparison of Ordered Values with Exponential Base | Establishes the existence of an order when comparing values bounded by an exponential base using a given order criteria. | [
{
"coq_statement": "Compute (Specif_Comp 0 L (Num 0) (Num 0)).",
"expected_output": "existT _ L (* base case with zero exponent *)",
"comment": "(* Testing with n=0 and order L results in maintaining order L as there is no change expected due to zero exponent. *)"
},
{
"coq_statement": "Compute ... |
Parameter BASE : BT.
Definition b := base BASE.
Definition Digit := digit BASE.
Definition Num := num BASE.
Definition Val_bound := val_bound BASE.
Definition Value := Val BASE.
Definition Connection := connection order (inf b) (inf b) (R b). | Theorem general_correct :
forall (n : nat) (X Y : Num n) (o o' : order),
Connection n o X Y o' -> R (exp b n) o (Val_bound n X) (Val_bound n Y) o'. | coq-projects/coqgym/coq-projects/hardware/Factorization/Comparator/Comp_Verif.v | general_correct | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
b = base BASE
: nat
R =
fun (n : nat) (o : order) (x y : inf n) (o' : order) => eq o' (FR n o x y)
: forall (n : nat) (_ : order) (_ : inf n) (_ : inf n)... | null | Correctness of Number Comparison Based on Connection | Ensures that, given specific orders and numbers, a connection implies a valid comparison relation between their bounded values. | [
{
"coq_statement": "Compute Val_bound 0 (digit 0).",
"expected_output": "(* constant output due to base case instead of real computation *)",
"comment": "The edge case for the smallest number with zero digits. Expected to return a constant value due to the base definitions."
},
{
"coq_statement"... |
Parameter BASE : BT.
Definition b := base BASE.
Definition Digit := digit BASE.
Definition Num := num BASE.
Definition Val_bound := val_bound BASE.
Definition Value := Val BASE.
Definition Connection := connection order (inf b) (inf b) (R b).
intros n X Y o o' C.
unfold b in |- *.
apply factorization_for_verification w... | Theorem correctness :
forall (n : nat) (X Y : Num n) (o : order),
Connection n E X Y o -> o = Compare_Nat.comparison (Value n X) (Value n Y). | coq-projects/coqgym/coq-projects/hardware/Factorization/Comparator/Comp_Verif.v | correctness | Num = num BASE
: forall _ : nat, Set
Inductive order : Set := L : order | E : order | G : order
Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ :... | null | Correctness of Numerical Comparison Verification | Establishes that given a connection implying equality, derived orders match numerical comparison results based on their values. | [
{
"coq_statement": "Compute Compare_Nat.comparison (Value 0 (num BASE 0)) (Value 0 (num BASE 0)).",
"expected_output": "E",
"comment": "(* Comparison when both numbers are zero. Expected to return 'E' for equality. *)"
},
{
"coq_statement": "Compute Compare_Nat.comparison (Value 1 (num BASE 1)) ... |
Parameter BASE : BT.
Definition b := base BASE.
Definition Num := num BASE.
Definition Val_bound := val_bound BASE. | Lemma Comparator :
forall (n : nat) (o : order) (X Y : Num n),
{o' : order | R (exp b n) o (Val_bound n X) (Val_bound n Y) o'}. | coq-projects/coqgym/coq-projects/hardware/Factorization/Comparator/Comp_Synth.v | Comparator | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
b = base BASE
: nat
R =
fun (n : nat) (o : order) (x y : inf n) (o' : order) => eq o' (FR n o x y)
: forall (n : nat) (_ : order) (_ : inf n) (_ : inf n)... | null | Order Comparator for Numerical Values | Provides an order relation between two numerical values based on specific computational base and exponentiation logic. | [
{
"coq_statement": "Compute Comparator 0 L (Num 0) (Num 0).",
"expected_output": "(existT (fun o' : order => R (exp b 0) L (Val_bound 0 (Num 0)) (Val_bound 0 (Num 0)) o') E proof_0)",
"comment": "For n=0, the base case of exp function gives 1. Both X and Y are equivalent, so the resulting order is E (eq... |
Section compare_num.
Variable BASE : BT.
Let Digit := digit BASE.
Let valB := val BASE.
Let ValB := Val BASE.
Let Num := num BASE.
Let Val_bound := val_bound BASE.
Let Cons := cons Digit.
Let Nil := nil Digit. | Lemma Comp_dif :
forall (n : nat) (x y : Digit) (X Y : Num n),
valB x < valB y ->
Compare_Nat.comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y)) =
L. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Num.v | Comp_dif | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
BT = sig (fun b : nat => lt O b)
: Set
digit =
fun BASE : BT => sig (fun x : nat => lt x (base BASE))
: forall _ : BT, Set
inf = fun n : nat => sig (fun ... | null | Comparing Numbers Based on their Most Significant Digit | When the most significant digit of one number is smaller than another, comparing their numerical values yields a less-than result. | [
{
"coq_statement": "Compute comparison 2 3.",
"expected_output": "L",
"comment": "(* Since 2 < 3, according to the 'comparison' function using Lt_eq_Gt logic, the result is L indicating 'less than'. *)"
},
{
"coq_statement": "Compute comparison 5 5.",
"expected_output": "E",
"comment": "... |
Section compare_num.
Variable BASE : BT.
Let Digit := digit BASE.
Let valB := val BASE.
Let ValB := Val BASE.
Let Num := num BASE.
Let Val_bound := val_bound BASE.
Let Cons := cons Digit.
Let Nil := nil Digit.
intros n x y X Y l.
apply comparisonL.
unfold ValB in |- *.
unfold Cons in |- *.
unfold Digit in |- *.
apply c... | Lemma Comp_eq :
forall (n : nat) (x y : Digit) (X Y : Num n),
valB x = valB y ->
Compare_Nat.comparison (ValB (S n) (Cons n x X)) (ValB (S n) (Cons n y Y)) =
Compare_Nat.comparison (ValB n X) (ValB n Y). | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Num.v | Comp_eq | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
BT = sig (fun b : nat => lt O b)
: Set
digit =
fun BASE : BT => sig (fun x : nat => lt x (base BASE))
: forall _ : BT, Set
inf = fun n : nat => sig (fun ... | null | Comparison of Natural Number Representations in a Specific Base | Equivalence in digit values ensures that augmented representations remain equivalent when comparing their numeric values in the base. | [
{
"coq_statement": "Compute (Comp_eq 1 2 2 (cons Digit 0 1 (nil Digit)) (cons Digit 0 1 (nil Digit)) eq_refl).",
"expected_output": "E",
"comment": "(* Since both x and y have the same value (2), the comparison of valuations should yield equality (E) as expected according to 'Comp_eq'. *)"
},
{
... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third. | Lemma Lt_eq_Gt : forall n m : nat, Or3 (n < m) (n = m) (n > m). | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | Lt_eq_Gt | Inductive Or3 (A B C : Prop) : Set :=
First : forall _ : A, Or3 A B C
| Second : forall _ : B, Or3 A B C
| Third : forall _ : C, Or3 A B C | null | Ternary relation classification of natural numbers | For any two natural numbers, they relate by either being less than, equal to, or greater than each other. | [
{
"coq_statement": "Compute (match Lt_eq_Gt 2 3 with | First _ => \"First\" | Second _ => \"Second\" | Third _ => \"Third\" end).",
"expected_output": "\"First\"",
"comment": "In this case, 2 < 3 holds true, so the constructor 'First' is used to indicate the left predicate in Or3, which means n < m."
... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma comparisonL :
forall v1 v2 : nat, v1 < v2 -> Compare_Nat.comparison v1 v2 = L. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | comparisonL | Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order | null | Comparison of Natural Numbers Results in L for Less Than | Comparison of two natural numbers results in L when the first number is less than the second number, proving transitivity. | [
{
"coq_statement": "Compute comparison 2 5.",
"expected_output": "L",
"comment": "(* comparison 2 5 -> L because 2 < 5, which matches the 'L' case in the comparison function. *)"
},
{
"coq_statement": "Compute comparison 3 3.",
"expected_output": "E",
"comment": "(* comparison 3 3 -> E b... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma comparisonG :
forall v1 v2 : nat, v1 > v2 -> Compare_Nat.comparison v1 v2 = G. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | comparisonG | Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order | null | Comparison of natural numbers yields 'greater' under specific conditions. | For two natural numbers v1 and v2, if v1 is greater than v2, their comparison yields the 'greater than' result. | [
{
"coq_statement": "Compute Compare_Nat.comparison 5 3.",
"expected_output": "G",
"comment": "(* Compare_Nat.comparison 5 3 -> G because 5 > 3 *)"
},
{
"coq_statement": "Compute Compare_Nat.comparison 2 5.",
"expected_output": "L",
"comment": "(* Compare_Nat.comparison 2 5 -> L because 2... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma comparisonE :
forall v1 v2 : nat, v1 = v2 -> Compare_Nat.comparison v1 v2 = E. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | comparisonE | comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order
Inductive order : Set := L : order | E : order | G : order | null | Equality comparison of natural numbers results in equality order. | Given two natural numbers, when they are equal, their comparison using Compare_Nat results in the equality order 'E'. | [
{
"coq_statement": "Compute Compare_Nat.comparison 0 0.",
"expected_output": "E",
"comment": "(* Both numbers are equal (0 = 0), hence the result is E (Equal). *)"
},
{
"coq_statement": "Compute Compare_Nat.comparison 5 5.",
"expected_output": "E",
"comment": "(* Both numbers are equal (... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma inv_comparisonL :
forall v1 v2 : nat, Compare_Nat.comparison v1 v2 = L -> v1 < v2. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | inv_comparisonL | Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order | null | Comparison Lemma for Less-than Condition | Proves that if the comparison function returns L, then the first argument is indeed less than the second argument. | [
{
"coq_statement": "Compute Compare_Nat.comparison 3 5.",
"expected_output": "L",
"comment": "(* Compare_Nat.comparison 3 5 -> L because 3 < 5 *)"
},
{
"coq_statement": "Compute Compare_Nat.comparison 5 5.",
"expected_output": "E",
"comment": "(* Compare_Nat.comparison 5 5 -> E because 5... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma inv_comparisonE :
forall v1 v2 : nat, Compare_Nat.comparison v1 v2 = E -> v1 = v2. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | inv_comparisonE | comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order
Inductive order : Set := L : order | E : order | G : order | null | Equality from comparison result E. | Ensures that when comparing two natural numbers, if result is E, then both numbers must be equal. | [
{
"coq_statement": "Compute comparison 0 0.",
"expected_output": "E",
"comment": "(* comparison 0 0 -> E because both values are equal. *)"
},
{
"coq_statement": "Compute comparison 3 2.",
"expected_output": "G",
"comment": "(* comparison 3 2 -> G because v1 (3) is greater than v2 (2). *... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma inv_comparisonG :
forall v1 v2 : nat, Compare_Nat.comparison v1 v2 = G -> v1 > v2. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | inv_comparisonG | Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order | null | Lemma on comparison leading to 'Greater' condition | Provides that when comparison yields 'Greater', the first integer is confirmed to be greater than the second integer. | [
{
"coq_statement": "Compute comparison 5 3.",
"expected_output": "G",
"comment": "(* Since 5 > 3, comparison should return G indicating 'greater'. *)"
},
{
"coq_statement": "Compute comparison 3 5.",
"expected_output": "L",
"comment": "(* Since 3 < 5, comparison should return L indicatin... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma inv_comparison :
forall v1 v2 : nat,
match Compare_Nat.comparison v1 v2 return Prop with
| L => v1 < v2
| E => v1 = v2
| G => v1 > v2
end. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | inv_comparison | Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order
Inductive order : Set := L : order | E : order | G : order
Inductive order : Set := L :... | null | Invariant Properties of Natural Number Comparison | Demonstrates that comparing two natural numbers results in a logical correspondence: L for less, E for equal, G for greater. | [
{
"coq_statement": "Compute comparison 3 5.",
"expected_output": "L",
"comment": "(* When comparison 3 5 is evaluated, 3 < 5, so the expected result is L for Less. *)"
},
{
"coq_statement": "Compute comparison 5 5.",
"expected_output": "E",
"comment": "(* When comparison 5 5 is evaluated... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma comp_sym_LG :
forall v1 v2 : nat,
Compare_Nat.comparison v1 v2 = L -> Compare_Nat.comparison v2 v1 = G. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | comp_sym_LG | Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order
Inductive order : Set := L : order | E : order | G : order | null | Symmetry Property of Natural Number Comparison | For any natural numbers v1 and v2, if v1 is less than v2 (comparison yields L), then v2 is greater than v1 (comparison yields G). | [
{
"coq_statement": "Compute (Compare_Nat.comparison 3 5).",
"expected_output": "L",
"comment": "(* Compare_Nat.comparison 3 5 -> L because 3 is less than 5. *)"
},
{
"coq_statement": "Compute (Compare_Nat.comparison 5 3).",
"expected_output": "G",
"comment": "(* Compare_Nat.comparison 5 ... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma comp_sym_GL :
forall v1 v2 : nat,
Compare_Nat.comparison v1 v2 = G -> Compare_Nat.comparison v2 v1 = L. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | comp_sym_GL | Inductive order : Set := L : order | E : order | G : order
comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order
Inductive order : Set := L : order | E : order | G : order | null | Symmetry Property of Comparison Returning Greater | Given two natural numbers, if one compares as greater, then the reverse comparison results in less. This establishes symmetry. | [
{
"coq_statement": "Compute Compare_Nat.comparison 3 2.",
"expected_output": "G",
"comment": "(* Comparison of 3 and 2: 3 > 2, so the expected output is G (greater) *)"
},
{
"coq_statement": "Compute Compare_Nat.comparison 2 3.",
"expected_output": "L",
"comment": "(* Comparison of 2 and... |
Require Export Arith.
Global Set Asymmetric Patterns.
Inductive Or3 (A B C : Prop) : Set :=
| First : A -> Or3 A B C
| Second : B -> Or3 A B C
| Third : C -> Or3 A B C.
Hint Resolve First Second Third.
simple induction n; simple induction m.
apply Second; try trivial with arith.
intros; apply First; try trivial with ar... | Lemma comp_sym_E :
forall v1 v2 : nat,
Compare_Nat.comparison v1 v2 = E -> Compare_Nat.comparison v2 v1 = E. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Compare_Nat.v | comp_sym_E | comparison =
fun v1 v2 : nat =>
match Lt_eq_Gt v1 v2 with
| @First _ _ _ _ => L
| @Second _ _ _ _ => E
| @Third _ _ _ _ => G
end
: forall (_ : nat) (_ : nat), order
Inductive order : Set := L : order | E : order | G : order | null | Symmetry of Equality in Natural Number Comparison | Ensures equality symmetry in comparisons between two natural numbers using comparison function, confirming if v1 = E then v2 = E. | [
{
"coq_statement": "Compute Compare_Nat.comparison 0 0.",
"expected_output": "E",
"comment": "(* Compare_Nat.comparison 0 0 -> E because both values are equal. *)"
},
{
"coq_statement": "Compute Compare_Nat.comparison 5 3.",
"expected_output": "G",
"comment": "(* Compare_Nat.comparison 5... |
Section Numerals.
Definition BT := {b : nat | 0 < b}.
Variable BASE : BT.
Definition base := Inj nat (fun b : nat => 0 < b) BASE.
Definition digit := {x : nat | x < base}.
Definition val : digit -> nat := Inj nat (fun x : nat => x < base).
Definition num := list digit.
Definition inf (n : nat) := {x : nat | x < n}.
Def... | Lemma Val_val : forall x : digit, Val 1 (Cons 0 x Nil) = val x. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Numerals.v | Val_val | BT = sig (fun b : nat => lt O b)
: Set
digit = sig (fun x : nat => lt x base)
: Set
*** [Cons := cons digit :
forall (n : nat) (_ : digit) (_ : list digit n), list digit (S n)]
Inductive list (A : Set) : forall _ : nat, Set :=
nil : list A O
| cons : forall (n : nat) (_ : A) (_ : list A n), ... | null | Base Case of Val Function for Single Digit | Val function evaluates a single-digit numeral to its equivalent numeric value when constructed with Cons and Nil. | [
{
"coq_statement": "Eval compute in Val 1 (cons digit 0 (exist _ 1 Lt.none) (nil digit)).",
"expected_output": "(* 1 *)",
"comment": "(* Val 1 (Cons 0 x Nil) = val x for x = (exist _ 1 Lt.none) with base assumed > 1, thus Val 1 (Cons 0 (exist _ 1 Lt.none) Nil) results in 1. *)"
},
{
"coq_stateme... |
Section Numerals.
Definition BT := {b : nat | 0 < b}.
Variable BASE : BT.
Definition base := Inj nat (fun b : nat => 0 < b) BASE.
Definition digit := {x : nat | x < base}.
Definition val : digit -> nat := Inj nat (fun x : nat => x < base).
Definition num := list digit.
Definition inf (n : nat) := {x : nat | x < n}.
Def... | Lemma upper_bound : forall (n : nat) (X : num n), Val n X < exp base n. | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Numerals.v | upper_bound | exp =
fix exp (e x : nat) {struct x} : nat :=
match x with
| O => S O
| S p => Init.Nat.mul e (exp e p)
end
: forall (_ : nat) (_ : nat), nat
BT = sig (fun b : nat => lt O b)
: Set
digit = sig (fun x : nat => lt x base)
: Set
*** [Cons := cons digit :
forall (n : nat) (_ : digit) (_ ... | null | Upper Bound Lemma for Numeric Representation | For any natural number length and numeric sequence, Val is strictly less than exponential base raised to sequence length. | [
{
"coq_statement": "Compute Val 0 (nil digit).",
"expected_output": "0",
"comment": "(* The Val function evaluates the value of an empty numeral (nil). Since there are no digits, the expected result is 0. *)"
},
{
"coq_statement": "Compute Val 1 (cons 0 (exist _ 1 ltac:(lia)) (nil digit)).",
... |
Section Numerals.
Definition BT := {b : nat | 0 < b}.
Variable BASE : BT.
Definition base := Inj nat (fun b : nat => 0 < b) BASE.
Definition digit := {x : nat | x < base}.
Definition val : digit -> nat := Inj nat (fun x : nat => x < base).
Definition num := list digit.
Definition inf (n : nat) := {x : nat | x < n}.
Def... | Lemma comp_dif :
forall (n : nat) (x y : digit) (X Y : num n),
val x < val y -> Val (S n) (Cons n x X) < Val (S n) (Cons n y Y). | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Numerals.v | comp_dif | BT = sig (fun b : nat => lt O b)
: Set
digit = sig (fun x : nat => lt x base)
: Set
*** [Cons := cons digit :
forall (n : nat) (_ : digit) (_ : list digit n), list digit (S n)]
Inductive list (A : Set) : forall _ : nat, Set :=
nil : list A O
| cons : forall (n : nat) (_ : A) (_ : list A n), ... | null | Comparing numeral values with different head digits | Given numeral structures with digits x and y, if val x is less than val y, their numeral values maintain this order. | [
{
"coq_statement": "Compute Val 1 (cons 0 (exist _ 1 (Nat.lt_0_succ 1)) (nil digit)).",
"expected_output": "1",
"comment": "(* The number represented is a single digit '1'. Base must be greater than 1, so 1 is valid; hence Val evaluates to 1. *)"
},
{
"coq_statement": "Compute Val 2 (cons 1 (exi... |
Section Numerals.
Definition BT := {b : nat | 0 < b}.
Variable BASE : BT.
Definition base := Inj nat (fun b : nat => 0 < b) BASE.
Definition digit := {x : nat | x < base}.
Definition val : digit -> nat := Inj nat (fun x : nat => x < base).
Definition num := list digit.
Definition inf (n : nat) := {x : nat | x < n}.
Def... | Lemma comp_eq_most :
forall (n : nat) (x y : digit) (X Y : num n),
val x = val y ->
Val n X < Val n Y -> Val (S n) (Cons n x X) < Val (S n) (Cons n y Y). | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Numerals.v | comp_eq_most | BT = sig (fun b : nat => lt O b)
: Set
digit = sig (fun x : nat => lt x base)
: Set
*** [Cons := cons digit :
forall (n : nat) (_ : digit) (_ : list digit n), list digit (S n)]
Inductive list (A : Set) : forall _ : nat, Set :=
nil : list A O
| cons : forall (n : nat) (_ : A) (_ : list A n), ... | null | Comparison of values in numeral lists with equal leading digits | Compares numeral lists with equal leading digits, asserting the order of complete values based on subsequent elements. | [
{
"coq_statement": "Compute (Val 0 (Nil)).",
"expected_output": "0",
"comment": "(* Val base case: Val 0 (Nil) returns 0 because the list is empty, representing numeral 0. *)"
},
{
"coq_statement": "Compute (Val 1 (Cons 0 (exist _ 3 (lt_n_S 0 3 (lt_O_Sn 2))) Nil)).",
"expected_output": "3",
... |
Section Numerals.
Definition BT := {b : nat | 0 < b}.
Variable BASE : BT.
Definition base := Inj nat (fun b : nat => 0 < b) BASE.
Definition digit := {x : nat | x < base}.
Definition val : digit -> nat := Inj nat (fun x : nat => x < base).
Definition num := list digit.
Definition inf (n : nat) := {x : nat | x < n}.
Def... | Lemma com_eq :
forall (n : nat) (x y : digit) (X Y : num n),
val x = val y ->
Val n X = Val n Y -> Val (S n) (Cons n x X) = Val (S n) (Cons n y Y). | coq-projects/coqgym/coq-projects/hardware/Factorization/Lib_Numerals/Numerals.v | com_eq | BT = sig (fun b : nat => lt O b)
: Set
digit = sig (fun x : nat => lt x base)
: Set
*** [Cons := cons digit :
forall (n : nat) (_ : digit) (_ : list digit n), list digit (S n)]
Inductive list (A : Set) : forall _ : nat, Set :=
nil : list A O
| cons : forall (n : nat) (_ : A) (_ : list A n), ... | null | Commutes equality over numeral calculation | Commutes numeral equality by ensuring new numeral with equal digit pairs and numeral lists retains equivalent calculated value. | [
{
"coq_statement": "Compute Val 1 (Cons 0 (exist _ 1 ltac:(auto)) (Nil 0)).",
"expected_output": "1",
"comment": "(* Val 1 (Cons 0 (exist _ 1 ltac:(auto)) (Nil 0)) should compute to 1 because for a single digit x and no further digits, the value is simply the integer represented by x. *)"
},
{
"... |
Lemma pair_fst_snd : forall (A B : Set) (c : A * B), (fst c, snd c) = c. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Set_Products.v | pair_fst_snd | null | Projection properties of Cartesian products. | Pairing the first and second projections of a Cartesian pair reconstructs the original pair in a set context. | [
{
"coq_statement": "Compute fst (1, true).",
"expected_output": "1",
"comment": "(* The function 'fst' extracts the first element from the pair (1, true), which is 1. *)"
},
{
"coq_statement": "Compute snd (false, 'a').",
"expected_output": "'a'",
"comment": "(* The function 'snd' extrac... | ||
Section programming_3.
Variable A B C : Set. | Theorem fst_3 : prod_3 A B C -> A. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Set_Products.v | fst_3 | Inductive prod_3 (A B C : Set) : Set :=
triplet : forall (_ : A) (_ : B) (_ : C), prod_3 A B C | null | Extract first component from triple product. | Extracts the first element of a three-component product structure, allowing access to the element of type A. | [
{
"coq_statement": "Definition t1 : prod_3 unit unit unit := triplet tt tt tt.",
"expected_output": "unit",
"comment": "Creating a triplet with all unit types."
},
{
"coq_statement": "Compute (fst_3 _ _ _ (triplet 5 true \"hello\")).",
"expected_output": "5",
"comment": "Expecting the fi... |
Section programming_3.
Variable A B C : Set.
simple induction 1; try trivial.
Defined. | Theorem snd_3 : prod_3 A B C -> B. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Set_Products.v | snd_3 | Inductive prod_3 (A B C : Set) : Set :=
triplet : forall (_ : A) (_ : B) (_ : C), prod_3 A B C | null | Second Element Projection from 3-Product Tuple | Extracts the second element of type B from a given 3-element tuple structure in a dependent type context. | [
{
"coq_statement": "Compute (snd_3 (triplet 1 2 3)).",
"expected_output": "2",
"comment": "(* The prod_3 type is instantiated with integers. The triplet 1 2 3 is created, snd_3 should extract the second element 2. *)"
},
{
"coq_statement": "Compute (snd_3 (triplet true false true)).",
"expec... |
Section programming_3.
Variable A B C : Set.
simple induction 1; try trivial.
Defined.
simple induction 1; try trivial.
Defined. | Theorem thd_3 : prod_3 A B C -> C. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Set_Products.v | thd_3 | Inductive prod_3 (A B C : Set) : Set :=
triplet : forall (_ : A) (_ : B) (_ : C), prod_3 A B C | null | Retrieve third element from a triplet | Extracts the third component of a triplet structure in a product type, working with types A, B, and C in Coq. | [
{
"coq_statement": "Compute match triplet 1 2 3 with triplet _ _ c => c end.",
"expected_output": "3",
"comment": "(* The function extracts the third component, '3', from the triplet (1, 2, 3) of type prod_3 A B C. *)"
},
{
"coq_statement": "Compute match triplet true false true with triplet _ _... |
Section programming_3.
Variable A B C : Set.
simple induction 1; try trivial.
Defined.
simple induction 1; try trivial.
Defined.
simple induction 1; try trivial.
Defined.
End programming_3.
Notation Fst_3 := (fst_3 _ _ _) (only parsing).
Notation Snd_3 := (snd_3 _ _ _) (only parsing).
Notation Thd_3 := (thd_3 _ _ _) (o... | Lemma triplet_fst_snd_thd :
forall (A B C : Set) (c : prod_3 A B C),
triplet _ _ _ (fst_3 _ _ _ c) (snd_3 _ _ _ c) (thd_3 _ _ _ c) = c. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Set_Products.v | triplet_fst_snd_thd | snd_3 =
fun (A B C : Set) (H : prod_3 A B C) =>
prod_3_rec A B C (fun _ : prod_3 A B C => B)
(fun (_ : A) (b : B) (_ : C) => b) H
: forall (A B C : Set) (_ : prod_3 A B C), B
Inductive prod_3 (A B C : Set) : Set :=
triplet : forall (_ : A) (_ : B) (_ : C), prod_3 A B C
Inductive prod_3 (A B C : Set) : Set :... | null | Reconstruction of a 3-tuple using its components | Reconstructing a 3-tuple by extracting and recombining its components accurately returns the original tuple, preserving its structure. | [
{
"coq_statement": "Compute fst_3 _ _ _ (triplet nat bool unit 1 true tt).",
"expected_output": "1",
"comment": "(* Extracts the first component, 1, from the triplet (1, true, tt) of type prod_3 nat bool unit. *)"
},
{
"coq_statement": "Compute snd_3 _ _ _ (triplet nat bool unit 1 true tt).",
... |
Section programming_3.
Variable A B C : Set.
simple induction 1; try trivial.
Defined.
simple induction 1; try trivial.
Defined.
simple induction 1; try trivial.
Defined.
End programming_3.
Notation Fst_3 := (fst_3 _ _ _) (only parsing).
Notation Snd_3 := (snd_3 _ _ _) (only parsing).
Notation Thd_3 := (thd_3 _ _ _) (o... | Lemma ifProp_or : forall (b : bool) (P Q : Prop), ifProp Prop b P Q -> P \/ Q. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Set_Products.v | ifProp_or | ifProp =
fun (C : Type) (b : bool) (x y : C) => if b then x else y
: forall (C : Type) (_ : bool) (_ : C) (_ : C), C | null | Logical implication of ifProp leading to a disjunction | Using ifProp with a boolean condition on propositions P and Q results in a logical disjunction of P or Q. | [
{
"coq_statement": "Compute ifProp Prop true (True) (False).",
"expected_output": "True",
"comment": "(* ifProp Prop true True False returns True since the boolean condition is true *)"
},
{
"coq_statement": "Compute ifProp Prop false (True) (False).",
"expected_output": "False",
"commen... |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C. | Lemma sym_and : forall A B : Prop, A /\ B -> B /\ A. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | sym_and | null | Symmetry of Conjunction | Proves that if propositions A and B are both true together, then B and A are also true together. | [
{
"coq_statement": "Compute (sym_and nat nat (conj 1 2)).",
"expected_output": "2, 1",
"comment": "(* Given the conjunction 1 and 2, 'sym_and' swaps them, resulting in the pair (2, 1). *)"
},
{
"coq_statement": "Compute (sym_and bool bool (conj true false)).",
"expected_output": "false, true... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and. | Lemma sym_or : forall A B : Prop, A \/ B -> B \/ A. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | sym_or | null | Commutativity of Logical OR | Proves that the logical OR operation is commutative for propositions A and B, allowing reordering of disjunctions. | [
{
"coq_statement": "Compute (sym_or True False (or_introl I)).",
"expected_output": "or_intror I",
"comment": "(* sym_or True False (True -> True or False) results in (False -> True or False), aka or_intror I *)"
},
{
"coq_statement": "Compute (sym_or False True (or_intror I)).",
"expected_o... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_and_l : forall A B : Prop, ~ A -> ~ (A /\ B). | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_and_l | null | Negation of conjunction when left operand is false | Demonstrates that if proposition A is false, then the conjunction A and B is also false, regardless of B. | [
{
"coq_statement": "Compute (no_and_l False True not_false_is_true).",
"expected_output": "fun H : False => ex_falso_quodlibet H",
"comment": "(* If A is False, ~ A holds as False doesn't have any proof. Thus, ~ (A /\\ B) because conjunction requires both parts to be true. *)"
},
{
"coq_statemen... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_and_r : forall A B : Prop, ~ B -> ~ (A /\ B). | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_and_r | null | Negation of conjunction with false right component | Negation of 'B' implies negation of conjunction 'A and B'. The proof uses logical implication and elimination tactics. | [
{
"coq_statement": "Eval compute in (fun (A B : Prop) (f : A) (g : B) => let (x, y) := f in (g y)).",
"expected_output": "Error: Non-propositional pattern-matching on a non-propositional term",
"comment": "This statement attempts to destruct a proposition in a computational context, which leads to an er... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_or : forall A B : Prop, ~ A -> B \/ A -> B. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_or | null | Derivation of B from limit on disjunction with negation of A | For any propositions A and B, if A is false, then from the disjunction of B or A, B is true. | [
{
"coq_statement": "Compute (let H := no_or nat (or3 False True True) (fun _ => False_rect _ tt) (or_introl eq_refl : or3 False True True) in H).",
"expected_output": "or3_Middle _ _ _ eq_refl",
"comment": "(* Since 'A' is False, the given hypothesis '~ A' holds, and since 'B \\/ A' is true due to the p... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_or_inv : forall A B : Prop, ~ A -> A \/ B -> B. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_or_inv | null | Resolution of disjunction with negation | If proposition A is false and the disjunction A or B is true, proposition B must be true. | [
{
"coq_statement": "Compute (no_or_inv False True I (or_introl I)).",
"expected_output": "True",
"comment": "(* With False as ~A, A or B evaluates to B which is True in this case. So, the result is True. *)"
},
{
"coq_statement": "Compute (no_or_inv False False I (or_intror I)).",
"expected_... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_or_and : forall A B C D : Prop, ~ C -> A /\ B \/ C /\ D -> A /\ B. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_or_and | null | Disjunction with a forbidden conjunct results in a valid conjunction | Asserting the impossibility of C and given A and B or C and D, deduces A and B must hold. | [
{
"coq_statement": "Compute (let A := True in let B := False in (False, exist H: ~ B, eq_refl : A /\\ B \\/ B)).",
"expected_output": "absurd A : False -> A:True -> B:False doesn't hold.",
"comment": "In this case, A is True, and B is False, both exist in different conjunction which naturally leads to a... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_or_and_inv :
forall A B C D : Prop, ~ D -> C /\ D \/ A /\ B -> A /\ B. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_or_and_inv | null | Resolving disjunction of conjunctions with negation | Establishes A and B given a disjunction involving C and D, provided D is false and A and B are combined. | [
{
"coq_statement": "Compute (let A := False in let B := True in let C := False in let D := False in let proof := conj I I in let h1 := conj (conj I I) proof in let h2 := or_introl h1 : C /\\ D \\/ A /\\ B in no_or_and_inv A B C D proof h2).",
"expected_output": "conj I I",
"comment": "(* When ~D holds a... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_no_A : forall A : Prop, A -> ~ ~ A. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_no_A | null | Double negation elimination for proposition A | Proof demonstrates that if A is true, then not not A is also true, reinforcing the constructivist logic approach. | [
{
"coq_statement": "Compute (fun A : Prop => prove_no_no_A A (fun a : A => a)).",
"expected_output": "fun A : Prop => (fun a : A => a).",
"comment": "(* The function 'prove_no_no_A' is expected to demonstrate that if A is provable, then A is provable under double negation elimination *)"
},
{
"c... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma impl_no_no : forall A B : Prop, (A -> B) -> ~ B -> ~ A. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | impl_no_no | null | Contrapositive with Double Negation | Given propositions A and B, if A implies B and B is false, then A is also false. This exploits contraposition. | [
{
"coq_statement": "Compute impl_no_no (fun x : False => x) (fun n => I).",
"expected_output": "fun _ : False => False_ind False",
"comment": "(* Applying impl_no_no with A := False and B := True results in ~False. False can't be proven, hence the identity function for False is returned. *)"
},
{
... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_or_r : forall A B : Prop, ~ A -> A \/ B -> B. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_or_r | null | Disjunction Elimination on LHS with Negation | If a proposition A is false, and the disjunction A or B holds, then B must be true according to logic. | [
{
"coq_statement": "Compute (let A := False in let B := True in proj2 (no_or_r A B I (or_intror B I))).",
"expected_output": "true",
"comment": "(* Because A is False and B is True, ~A holds. Therefore, A \\/ B simplifies to True, validating that B holds. *)"
},
{
"coq_statement": "Compute (let ... | |
(* Lib_Prop.v *)
Inductive or3 (A B C : Prop) : Set :=
| or3_Left : A -> or3 A B C
| or3_Middle : B -> or3 A B C
| or3_Right : C -> or3 A B C.
intros A B H; elim H; split; auto.
Qed.
Hint Immediate sym_and.
simple induction 1; auto.
Qed.
Hint Immediate sym_o... | Lemma no_or_l : forall A B : Prop, ~ B -> A \/ B -> A. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Prop.v | no_or_l | null | Elimination of disjunctive hypothesis with negated right disjunct | Assumes B is false and given A or B holds, it concludes A must be true by eliminating the disjunction. | [
{
"coq_statement": "Compute (let A := True in let B := False in let H := (fun x : False => match x with end) in let A_or_B := or_introl (True := A) (False := B) I in no_or_l A B H (or_introl A B I)).",
"expected_output": "I",
"comment": "(* Since ~B is True and A is True, A is the resulting value, so th... | |
Section Dependent_lists.
Variable A : Set.
Inductive list : nat -> Set :=
| nil : list 0
| cons : forall n : nat, A -> list n -> list (S n).
Definition eq_list := eq_dep nat list.
Definition hd (n : nat) (l : list n) : Exc A :=
match l in (list m) return (Exc A) with
| nil => error
| cons p a l' => value a
end.
Definit... | Lemma empty_dep : forall (n : nat) (l : list n), n = 0 -> eq_list 0 nil n l. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Lists/Dependent_lists.v | empty_dep | Inductive list : forall _ : nat, Set :=
nil : list O | cons : forall (n : nat) (_ : A) (_ : list n), list (S n)
eq_list =
eq_dep nat list
: forall (p : nat) (_ : list p) (q : nat) (_ : list q), Prop
Inductive list : forall _ : nat, Set :=
nil : list O | cons : forall (n : nat) (_ : A) (_ : list n), list (... | null | Dependent Equality for Empty Lists | Asserts that any list with a length of zero is propositionally equal to an empty list using dependent equality. | [
{
"coq_statement": "Compute eq_list 0 nil 0 nil.",
"expected_output": "eq_list 0 nil 0 nil",
"comment": "(* eq_list 0 nil 0 nil holds true by definition, as both lists are empty, matching the specification *)"
},
{
"coq_statement": "Compute eq_list 0 nil 1 (cons 0 _ nil).",
"expected_output"... |
Section Dependent_lists.
Variable A : Set.
Inductive list : nat -> Set :=
| nil : list 0
| cons : forall n : nat, A -> list n -> list (S n).
Definition eq_list := eq_dep nat list.
Definition hd (n : nat) (l : list n) : Exc A :=
match l in (list m) return (Exc A) with
| nil => error
| cons p a l' => value a
end.
Definit... | Lemma split_list :
forall (n : nat) (l : list (S n)),
l = cons n (head (S n) l (lt_O_Sn n)) (tl (S n) l). | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Lists/Dependent_lists.v | split_list | tl =
fun (n : nat) (l : list n) =>
match l in (list m) return (list (Init.Nat.pred m)) with
| nil => nil
| cons _ _ l' => l'
end
: forall (n : nat) (_ : list n), list (Init.Nat.pred n)
Inductive list : forall _ : nat, Set :=
nil : list O | cons : forall (n : nat) (_ : A) (_ : list n), list (S n)
Inductive lis... | null | Splitting a dependent list into head and tail | Splits a list with at least one element into its head and tail, reconstructs it using list constructors and functions. | [
{
"coq_statement": "Compute split_list 0 (cons 0 5 nil).",
"expected_output": "eq_refl",
"comment": "(cons 0 (head 1 (cons 0 5 nil) (lt_O_Sn 0)) (tl 1 (cons 0 5 nil))) simplifies to (cons 0 5 nil), which shows that the head and tail functions are correctly reconstructing the list."
},
{
"coq_sta... |
Section Dependent_lists.
Variable A : Set.
Inductive list : nat -> Set :=
| nil : list 0
| cons : forall n : nat, A -> list n -> list (S n).
Definition eq_list := eq_dep nat list.
Definition hd (n : nat) (l : list n) : Exc A :=
match l in (list m) return (Exc A) with
| nil => error
| cons p a l' => value a
end.
Definit... | Lemma Non_empty_Hd :
forall (n : nat) (a : A) (l : list n), Hd n (cons n a l) = a. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Lists/Dependent_lists.v | Non_empty_Hd | Inductive list : forall _ : nat, Set :=
nil : list O | cons : forall (n : nat) (_ : A) (_ : list n), list (S n)
Hd =
fun (n : nat) (l : list (S n)) => let (a, _) := non_empty n l in a
: forall (n : nat) (_ : list (S n)), A
Inductive list : forall _ : nat, Set :=
nil : list O | cons : forall (n : nat) (_ :... | null | Assertion of head extraction from non-empty lists | For any natural number n, element a, and list l, Hd retrieves a when called on the list (cons n a l). | [
{
"coq_statement": "Compute Hd 2 (cons 2 a (cons 1 b (cons 0 c nil))).",
"expected_output": "a",
"comment": "(* Hd 2 (cons 2 a (cons 1 b (cons 0 c nil))) -> a; According to the specification, Hd extracts the head of a non-empty list. *)"
},
{
"coq_statement": "Compute Hd 1 (cons 1 a (cons 0 b ni... |
Require Export Bool.
Require Export IfProp.
Require Export Zerob. | Lemma bool_dec : forall b : bool, {b = true} + {b = false}. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | bool_dec | null | Boolean Dichotomy Lemma | Determines a boolean is precisely true or false, ensuring decidability between the two possible values of a boolean. | [
{
"coq_statement": "Compute (if (proj1_sig (bool_dec true)) then \"true\" else \"false\").",
"expected_output": "\"true\"",
"comment": "(* The bool_dec applied to true should resolve to {true = true} + {true = false}, selecting the first branch which results in \"true\". *)"
},
{
"coq_statement"... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec. | Lemma orb_sym : forall a b : bool, a || b = b || a. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | orb_sym | null | Commutativity of Boolean OR | Asserts the commutative property of the Boolean OR operation, showing that 'a OR b' equals 'b OR a' for all Boolean values. | [
{
"coq_statement": "Compute true || false.",
"expected_output": "true",
"comment": "(* true || false evaluates to true because '||' is logical OR, and true OR anything is true. *)"
},
{
"coq_statement": "Compute false || true.",
"expected_output": "true",
"comment": "(* false || true eva... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym. | Lemma orb_false : forall a b : bool, a || b = false -> a = false /\ b = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | orb_false | null | Boolean OR operation resulting in false condition | Given two boolean inputs, if their OR operation equals false, then each individual input must also be false. | [
{
"coq_statement": "Compute (true || true).",
"expected_output": "true",
"comment": "(* The '||' operator performs logical OR operation. true || true evaluates to true. *)"
},
{
"coq_statement": "Compute (false || true).",
"expected_output": "true",
"comment": "(* The '||' operator perfo... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false. | Lemma orb_false_l : forall a b : bool, a || b = false -> a = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | orb_false_l | null | Property of Boolean 'or' and falsity in Coq | Describes a condition where Boolean OR operation results in false, necessitating that the first operand must also be false. | [
{
"coq_statement": "Compute (orb false true).",
"expected_output": "true",
"comment": "(* orb false true -> true; since false || true is true *)"
},
{
"coq_statement": "Compute (orb false false).",
"expected_output": "false",
"comment": "(* orb false false -> false; since false || false ... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma orb_false_r : forall a b : bool, a || b = false -> b = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | orb_false_r | null | Check if the second boolean is false when the OR operation is false | Confirms when a boolean OR operation results false, the second operand must also be false, given the outcome. | [
{
"coq_statement": "Compute orb false false.",
"expected_output": "false",
"comment": "(* orb false false -> false, since both inputs are false, their disjunction is also false. *)"
},
{
"coq_statement": "Compute orb true false.",
"expected_output": "true",
"comment": "(* orb true false ... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma true_orb_intro :
forall b1 b2 : bool, b1 || b2 = true -> b1 = true \/ b2 = true. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | true_orb_intro | null | Boolean Disjunction Implies Evaluation to True | For boolean values b1 and b2, their disjunction evaluates to true implies either b1 or b2 is true. | [
{
"coq_statement": "Compute (true || false).",
"expected_output": "true",
"comment": "(* true || false evaluates to true because true in a disjunction with any boolean results in true. *)"
},
{
"coq_statement": "Compute (false || false).",
"expected_output": "false",
"comment": "(* false... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma and_sym : forall a b : bool, a && b = b && a. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | and_sym | null | Commutativity of Boolean and operation | For all booleans a and b, the logical 'and' operation && is commutative, meaning a && b equals b && a. | [
{
"coq_statement": "Compute andb true false.",
"expected_output": "false",
"comment": "(* true && false = false, based on the logical AND operation behavior. *)"
},
{
"coq_statement": "Compute andb false true.",
"expected_output": "false",
"comment": "(* false && true = false, a basic pr... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma andb_false :
forall a b : bool,
a && b = false ->
a = false /\ b = false \/ a = false /\ b = true \/ a = true /\ b = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | andb_false | null | Boolean conjunction resulting in false | For Boolean inputs a and b, if their conjunction is false, then at least one of them must be false. | [
{
"coq_statement": "Compute (andb false false).",
"expected_output": "false",
"comment": "(* andb false false evaluates to false because both inputs are false. This corresponds to the specification that a = false and b = false. *)"
},
{
"coq_statement": "Compute (andb false true).",
"expecte... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma andb_true : forall a b : bool, a && b = true -> a = true /\ b = true. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | andb_true | null | Boolean conjunction implies truth of operands | Given two booleans a and b, if their conjunction is true, then both a and b must individually be true. | [
{
"coq_statement": "Compute (true && true).",
"expected_output": "true",
"comment": "When both inputs are true, the result of andb is true, confirming a && b = true in the specification."
},
{
"coq_statement": "Compute (false && true).",
"expected_output": "false",
"comment": "When the f... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma andb_true_l : forall a b : bool, a && b = true -> a = true. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | andb_true_l | null | Left conjunction truth implies left operand truth | When the conjunction of two Booleans is true, the first Boolean in the expression must also be true. | [
{
"coq_statement": "Compute andb true true.",
"expected_output": "true",
"comment": "(* andb true true -> true because both operands are true. *)"
},
{
"coq_statement": "Compute (true && true).",
"expected_output": "true",
"comment": "(* true && true evaluates to true since both operand... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma andb_true_r : forall a b : bool, a && b = true -> b = true. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | andb_true_r | null | Truth of Conjunction Implies Right Operand is True | When conjunction of two boolean values results in true, it indicates that the second operand must be true. | [
{
"coq_statement": "Compute andb true true.",
"expected_output": "true",
"comment": "(* andb true true -> true: Both inputs are true, so the andb function returns true. *)"
},
{
"coq_statement": "Compute andb true false.",
"expected_output": "false",
"comment": "(* andb true false -> fal... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma andb_negb_true_r : forall a b : bool, a && negb b = true -> b = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | andb_negb_true_r | null | Negated second operand implies false in conjunction | Given two booleans, if their conjunction with negated second equals true, the second boolean must be false. | [
{
"coq_statement": "Compute (andb true (negb false)).",
"expected_output": "true",
"comment": "(* andb true (negb false) simplifies to true && true which results in true *)"
},
{
"coq_statement": "Compute (andb false (negb true)).",
"expected_output": "false",
"comment": "(* andb false (... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma andb_negb_true_l : forall a b : bool, negb a && b = true -> a = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | andb_negb_true_l | null | Negation and conjunction yielding true implies first operand is false | Negation of a boolean a logically 'anded' with b equaling true implies that the original boolean a must be false. | [
{
"coq_statement": "Compute (andb (negb true) true).",
"expected_output": "false",
"comment": "(* Since negb true is false, and andb false true is false, the result is false. *)"
},
{
"coq_statement": "Compute (andb (negb false) true).",
"expected_output": "true",
"comment": "(* negb fal... | |
Require Export Bool.
Require Export IfProp.
Require Export Zerob.
simple induction b; auto with bool.
Qed.
Hint Resolve bool_dec.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Immediate orb_sym.
simple induction a; simple induction b; auto with bool.
Qed.
Hint Resolve orb_false.
intros; elim (orb_f... | Lemma no_true_false : forall b : bool, b = false -> b <> true. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Bool.v | no_true_false | null | Non-equality of boolean values under condition | For any boolean 'b', if 'b' is 'false', then 'b' cannot be 'true', establishing exclusivity between the two values. | [
{
"coq_statement": "Compute (if false then true else false).",
"expected_output": "false",
"comment": "(if false then true else false) -> false, because the condition is false thus the else branch is taken."
},
{
"coq_statement": "Compute (if true then false else true).",
"expected_output": ... | |
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt. | Lemma zerob_If :
forall (b : bool) (x y : nat),
zerob (if_bool _ b x y) = true -> x <> 0 -> b = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Zerob.v | zerob_If | if_bool =
fun (C : Set) (b : bool) (x y : C) => if b then x else y
: forall (C : Set) (_ : bool) (_ : C) (_ : C), C | null | Conditional Boolean Check for Zero Mapping to False | Evaluates condition where the zero check of a conditional result is true, leading to the conclusion that the condition must be false if the first result is nonzero. | [
{
"coq_statement": "Compute if_bool nat true 0 1.",
"expected_output": "0",
"comment": "(* if_bool nat true 0 1 evaluates to 0 because when b is true, it selects the first option, 0. *)"
},
{
"coq_statement": "Compute if_bool nat false 2 3.",
"expected_output": "3",
"comment": "(* if_boo... |
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt.
simple induction b; simpl in |- *; intros; auto.
absurd (x <> 0).
apply no_no_A; apply zerob_true_elim; auto.
trivial.
Qed. | Lemma lt_no_zerob : forall n : nat, 0 < n -> zerob n <> true. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Zerob.v | lt_no_zerob | null | Proof that positive numbers are not zero | Demonstrates that for any natural number greater than zero, the function zerob returns false, indicating it is not zero. | [
{
"coq_statement": "Compute zerob 1.",
"expected_output": "false",
"comment": "(* For n = 1, since zerob is true iff n = 0, zerob 1 should be false. *)"
},
{
"coq_statement": "Compute zerob 2.",
"expected_output": "false",
"comment": "(* For n = 2, n is greater than zero, so zerob 2 shou... | |
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt.
simple induction b; simpl in |- *; intros; auto.
absurd (x <> 0).
apply no_no_A; apply zerob_true_elim; auto.
trivial.
Qed.
Qed.
Hint Resolve lt_no_zerob. | Lemma zerob_pred_no : forall n : nat, zerob (pred n) = false -> n <> 0. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Zerob.v | zerob_pred_no | null | Non-zero predecessor implies zerob false | For any natural number n, if zerob of its predecessor is false, then n cannot be zero, based on zerob. | [
{
"coq_statement": "Compute zerob (pred 1).",
"expected_output": "false",
"comment": "(* zerob (pred 1) -> false because the predecessor of 1 is 0, and zerob 0 is true. Since we need zerob (pred n) = false, n cannot be 0. *)"
},
{
"coq_statement": "Compute zerob (pred 3).",
"expected_output"... | |
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt.
simple induction b; simpl in |- *; intros; auto.
absurd (x <> 0).
apply no_no_A; apply zerob_true_elim; auto.
trivial.
Qed.
Qed.
Hint Resolve lt_no_zerob.
simple induction n; auto with bool.
Qed.
Hint Resolve zerob_pre... | Lemma zerob_lt : forall n : nat, zerob n = false -> 0 < n. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Zerob.v | zerob_lt | null | Non-zero Natural Numbers Are Greater Than Zero | Given a natural number n, if n's zero checker returns false, it implies n is strictly positive, i.e., greater than zero. | [
{
"coq_statement": "Compute zerob 3.",
"expected_output": "false",
"comment": "(* Since 3 is greater than 0, zerob 3 returns false indicating it is not zero. This aligns with conditions for zerob_lt to apply, confirming 0 < 3. *)"
},
{
"coq_statement": "Compute zerob 0.",
"expected_output": ... | |
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt.
simple induction b; simpl in |- *; intros; auto.
absurd (x <> 0).
apply no_no_A; apply zerob_true_elim; auto.
trivial.
Qed.
Qed.
Hint Resolve lt_no_zerob.
simple induction n; auto with bool.
Qed.
Hint Resolve zerob_pre... | Lemma no_zerob_true : forall n : nat, n <> 0 -> zerob n <> true. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Zerob.v | no_zerob_true | null | Non-zero natural numbers do not satisfy 'zerob' as true | For any natural number n, if n is not zero, then zerob applied to n results in false, not true. | [
{
"coq_statement": "Compute (zerob 1).",
"expected_output": "false",
"comment": "(* zerob 1 returns false because 1 is not zero. *)"
},
{
"coq_statement": "Compute (zerob 0).",
"expected_output": "true",
"comment": "(* zerob 0 returns true because 0 is zero. *)"
},
{
"coq_stateme... | |
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt.
simple induction b; simpl in |- *; intros; auto.
absurd (x <> 0).
apply no_no_A; apply zerob_true_elim; auto.
trivial.
Qed.
Qed.
Hint Resolve lt_no_zerob.
simple induction n; auto with bool.
Qed.
Hint Resolve zerob_pre... | Lemma x_1_or_y_0 :
forall x y : nat,
zerob (pred x) || zerob y = true -> x <> 0 -> x = 1 \/ y = 0. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Zerob.v | x_1_or_y_0 | null | Characterizing Zero Behavior for Predecessor and Disjunction | Given natural numbers x and y, if zerob of x's predecessor or y holds true, with x non-zero, then x equals 1 or y equals 0. | [
{
"coq_statement": "Compute (zerob (pred 2) || zerob 0).",
"expected_output": "true",
"comment": "(* With x = 2 and y = 0, zerob (pred x) = zerob 1 = false, zerob y = zerob 0 = true, hence their logical OR is true, fulfilling the condition for the lemma. *)"
},
{
"coq_statement": "Compute (zerob... | |
Require Export Lib_Bool.
Require Export Lib_Prop.
Require Export Lib_Set_Products.
Require Export Lt.
simple induction b; simpl in |- *; intros; auto.
absurd (x <> 0).
apply no_no_A; apply zerob_true_elim; auto.
trivial.
Qed.
Qed.
Hint Resolve lt_no_zerob.
simple induction n; auto with bool.
Qed.
Hint Resolve zerob_pre... | Lemma zerob_pred_false :
forall n : nat, zerob (pred n) = false -> zerob n = false. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Boolean/Lib_Zerob.v | zerob_pred_false | null | Relation between zerob of predecessor and zerob of a number | For any natural number n, if zerob of pred(n) is false, then zerob of n is also false. | [
{
"coq_statement": "Compute zerob (pred 0).",
"expected_output": "false",
"comment": "(* zerob (pred 0) evaluates to false because pred 0 is 0 and zerob 0 is true, thus the statement 'zerob (pred n) = false' is correct for n=0. *)"
},
{
"coq_statement": "Compute zerob (pred 1).",
"expected_o... | |
Require Export Lib_Exp.
Definition Square (n : nat) := n * n. | Lemma Square_exp_2 : forall n : nat, Square (exp_2 n) = exp_2 (2 * n). | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Arithmetic/Lib_Square.v | Square_exp_2 | Square = fun n : nat => Init.Nat.mul n n
: forall _ : nat, nat
exp_2 =
fix exp_2 (n : nat) : nat :=
match n with
| O => S O
| S p => Init.Nat.mul (S (S O)) (exp_2 p)
end
: forall _ : nat, nat | null | Quadratic Exponentiation Equivalence | Equates squaring the exponentiation of n with the exponentiation of twice n, demonstrating potential mathematical equivalence or transformation. | [
{
"coq_statement": "Compute Square (exp_2 O).",
"expected_output": "1",
"comment": "(* Square (exp_2 0) -> exp_2 O is 1 (2^0), Square of 1 is 1 *)"
},
{
"coq_statement": "Compute Square (exp_2 1).",
"expected_output": "4",
"comment": "(* Square (exp_2 1) -> exp_2 1 is 2 (2^1), Square of ... |
Require Export Lib_Exp.
Definition Square (n : nat) := n * n.
intro.
unfold Square in |- *.
elim exp_2_n_plus_m.
rewrite plus_mult; reflexivity.
Qed.
Hint Resolve Square_exp_2. | Lemma eq_Square_exp_n : forall n : nat, Square n = exp_n n 2. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Arithmetic/Lib_Square.v | eq_Square_exp_n | exp_n =
fix exp_n (n m : nat) {struct m} : nat :=
match m with
| O => S O
| S p => Init.Nat.mul n (exp_n n p)
end
: forall (_ : nat) (_ : nat), nat
Square = fun n : nat => Init.Nat.mul n n
: forall _ : nat, nat | null | Equality of Square and exp_n with exponent 2 | Square of a natural number is equal to raising the number to the power of 2 using recursive function exp_n. | [
{
"coq_statement": "Compute Square 0.",
"expected_output": "0",
"comment": "(* Square 0 = 0 * 0 = 0, which matches exp_n 0 2 because exp_n 0 2 executes 0 * 1 = 0 *)"
},
{
"coq_statement": "Compute Square 1.",
"expected_output": "1",
"comment": "(* Square 1 = 1 * 1 = 1, which matches exp_... |
Require Export Lib_Exp.
Definition Square (n : nat) := n * n.
intro.
unfold Square in |- *.
elim exp_2_n_plus_m.
rewrite plus_mult; reflexivity.
Qed.
Hint Resolve Square_exp_2.
unfold Square in |- *.
simpl in |- *.
intro; elim (mult_comm 1 n); simpl in |- *; auto with arith.
Qed.
Hint Resolve eq_Square_exp_n. | Lemma Square_inc : forall n m : nat, n <= m -> Square n <= Square m. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Arithmetic/Lib_Square.v | Square_inc | Square = fun n : nat => Init.Nat.mul n n
: forall _ : nat, nat | null | Monotonicity of the Square Function | Given natural numbers n and m, if n is less than or equal to m, then Square n is less than or equal to Square m. | [
{
"coq_statement": "Compute Square 0.",
"expected_output": "0",
"comment": "(* Square 0 = 0 * 0 = 0. The square of zero should return zero as expected. *)"
},
{
"coq_statement": "Compute Square 1.",
"expected_output": "1",
"comment": "(* Square 1 = 1 * 1 = 1. The square of one should yie... |
Require Export Lib_Exp.
Definition Square (n : nat) := n * n.
intro.
unfold Square in |- *.
elim exp_2_n_plus_m.
rewrite plus_mult; reflexivity.
Qed.
Hint Resolve Square_exp_2.
unfold Square in |- *.
simpl in |- *.
intro; elim (mult_comm 1 n); simpl in |- *; auto with arith.
Qed.
Hint Resolve eq_Square_exp_n.
intros.
u... | Lemma Square_strict_inc : forall n m : nat, n < m -> Square n < Square m. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Arithmetic/Lib_Square.v | Square_strict_inc | Square = fun n : nat => Init.Nat.mul n n
: forall _ : nat, nat | null | Strictly Increasing Property of Squaring Function | For natural numbers n and m, if n is less than m, then the square of n is less than the square of m. | [
{
"coq_statement": "Compute Square 0.",
"expected_output": "0",
"comment": "(* Square 0 -> 0 * 0 = 0: testing edge case with the smallest natural number. *)"
},
{
"coq_statement": "Compute Square 1.",
"expected_output": "1",
"comment": "(* Square 1 -> 1 * 1 = 1: another edge case with th... |
Require Export Lib_Exp.
Definition Square (n : nat) := n * n.
intro.
unfold Square in |- *.
elim exp_2_n_plus_m.
rewrite plus_mult; reflexivity.
Qed.
Hint Resolve Square_exp_2.
unfold Square in |- *.
simpl in |- *.
intro; elim (mult_comm 1 n); simpl in |- *; auto with arith.
Qed.
Hint Resolve eq_Square_exp_n.
intros.
u... | Lemma le_n_Square : forall n : nat, n <= Square n. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Arithmetic/Lib_Square.v | le_n_Square | Square = fun n : nat => Init.Nat.mul n n
: forall _ : nat, nat | null | Inequality relation between a natural number and its square. | For any natural number n, it holds that n is less than or equal to the result of n squared. | [
{
"coq_statement": "Compute Square 0.",
"expected_output": "0",
"comment": "(* Square 0 -> 0 because 0 * 0 = 0 *)"
},
{
"coq_statement": "Compute Square 1.",
"expected_output": "1",
"comment": "(* Square 1 -> 1 because 1 * 1 = 1 *)"
},
{
"coq_statement": "Compute Square 2.",
... |
Require Export Lib_Eq_Le_Lt.
Require Export Lib_Prop. | Lemma pred_diff_O : forall n : nat, n <> 0 -> n <> 1 -> pred n <> 0. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Arithmetic/Lib_Pred.v | pred_diff_O | null | Non-zero predecessor of a natural number given conditions | Establishes that for any natural number greater than one, its predecessor is non-zero under certain non-zero conditions. | [
{
"coq_statement": "Compute pred 2.",
"expected_output": "1",
"comment": "(* pred of 2 is 1; since 2 > 1, pred 2 is not 0, which aligns with pred_diff_O. *)"
},
{
"coq_statement": "Compute pred 3.",
"expected_output": "2",
"comment": "(* pred of 3 is 2; since 3 > 1, pred 3 is not 0, sati... | |
Require Export Lib_Eq_Le_Lt.
Require Export Lib_Prop.
simple induction n; auto with arith.
Qed.
Hint Resolve pred_diff_O. | Lemma S_pred_n : forall n : nat, 1 <= n -> S (pred n) = n. | coq-projects/coqgym/coq-projects/hardware/Libraries/Lib_Arithmetic/Lib_Pred.v | S_pred_n | null | Relationship between number and successor of its predecessor | For any natural number n greater than or equal to 1, the successor of its predecessor equals the original number. | [
{
"coq_statement": "Compute S (pred 1).",
"expected_output": "1",
"comment": "(* S (pred 1) should be 1 because pred 1 is 0 and S 0 is 1. This respects the condition 1 <= n. *)"
},
{
"coq_statement": "Compute S (pred 2).",
"expected_output": "2",
"comment": "(* S (pred 2) should be 2 bec... |
End of preview.
README.md exists but content is empty.
- Downloads last month
- 23