Questions tagged [gallina]
5 questions
2
votes
1 answer
Understanding the intros keyword work in Coq
Theorem law_of_contradiction : forall (P Q : Prop),
P /\ ~P -> Q.
Proof.
intros P Q P_and_not_P.
destruct P_and_not_P as [P_holds not_P].
I'm trying to reaaaally understand the intros keyword. Let's say that we want to prove P /\ ~P -> Q. Ok,…

Paprika
- 402
- 5
- 18
1
vote
1 answer
Does Gallina have an equivalent of Haskell's `$` or Ocaml's `@@`
Does the Gallina language in Coq have a predefined operator that helps avoid parentheses like Haskell's $ or OCaml's @@?
If not, is there a conventional one that people define using Notation?

Max Heiber
- 14,346
- 12
- 59
- 97
0
votes
3 answers
Proving S (n + m) = n + (S m), how to rewrite n+1 = S(n)?
Theorem add_0_r : forall n:nat, n + 0 = n.
Proof.
intros n. induction n as [| n' IHn'].
- (* n = 0 *) reflexivity.
- (* n = S n' *) simpl. rewrite -> IHn'. reflexivity. Qed.
Theorem plus_n_Sm : forall n m : nat,
S (n + m) = n + (S…

Paprika
- 402
- 5
- 18
0
votes
2 answers
How does one produce types (or theorems) from proof terms (programs or objects) in Coq?
I was curious to learn about type inference in Coq. I wanted a concrete way in Coq to generate types (theorems) given a proof term/object/program. So given a proof term (perhaps with a hole, perhaps with not holes or perhaps a proof sub term) can I…

Charlie Parker
- 5,884
- 57
- 198
- 323
0
votes
2 answers
Why Coq doesn't allow a theorem with admits to end with QED in Linux and Windows?
I am using Coq 8.10.0. Following proof script seems to work in Mac (ignoring warning):
Lemma plus_comm : forall (n m : nat), n + m = m + n.
Proof.
intros.
- admit.
Qed.
But the same proof script isn't accepted in Linux (Ubuntu) and Windows. It…

Baber
- 301
- 2
- 6
- 17