Questions tagged [proof]

A mathematical proof is any mathematical argument which demonstrates the truth of a mathematical statement. Informal proofs are typically rendered in natural language and are held true by consensus; formal proofs are typically rendered symbolically and can be checked mechanically. "Proofs" can be valid or invalid; only the former kind constitutes actual proof, whereas the latter kind usually refers to a flawed attempt at proof.

828 questions
0
votes
1 answer

How to prove something obviously logical - list_get problem in Prop

The problem is that I cannot apply induction on H without skipping a step. I was supposed to get Some instr0 to apply the standard lemma : Lemma get_Some {A} (l:list A) n x : list_get l n = Some x -> n < length l. Proof. revert n. induction l;…
0
votes
1 answer

Coq doesn't recognize equality of dependent list

I made a question before, but i think that question was bad formalized so... I am facing some problems with this specific definition to prove their properties: I have a definition of a list : Inductive list (A : Type) (f : A -> A -> A) : A -> Type…
0
votes
1 answer

Coq: How to produce a strong polymorphic dependent type hypothesis

I have been having some problems with dependent induction because a "weak hypothesis". For example : I have a dependent complete foldable list : Inductive list (A : Type) (f : A -> A -> A) : A -> Type := |Acons : forall {x x'' : A} (y' : A) (cons'…
Tiago Campos
  • 503
  • 3
  • 14
0
votes
1 answer

(Broad Question) How can you be certain a piece of code works correctly?

An interviewer asked me how I can be sure that a piece of code works as intended to. I said to test the code through all the possible test cases. Are there any other ways you can be certain a piece of code would work? I was also thinking of writing…
AJ Goudel
  • 339
  • 5
  • 14
0
votes
1 answer

3-way and 2-way merge sort without loss of generality?

So, I am studying 3-way merge sort and I am wondering about the without loss of generality. lets assume that we have array A' with power of 3 elements and A with power of any constant. Here is my question. Why having an assumption that n(number of…
0
votes
1 answer

Optimal pairing of bike with person - seeking proof of algorithm

So this is an algorithm question. The problem statement is the following: given two lists of coordinates (or length n each) of bikes and people on a 2D grid (or a 2D grid that show the positions of each bike and person), calculate the optimal…
Kevin He
  • 1,210
  • 8
  • 19
0
votes
1 answer

Is this proof with the pumping lemma (no regular language) ok?

I need to proof that a given language is not regular, could this work? The language is M={a^m a^l c b^(m+l)|m,l in N} with the alphabet = {a,b,c}. Proof: Be n in N arbitrary but firm. We choose the word w=a^(2n)cb^(2n) with w in M and |w|>=n. Be…
0
votes
1 answer

I need a proof for a function postcondition

this is a homework but I just cannot get my head around this whole business with writing formal prooves. Could anyone crack this and write formal proof for postcondition of this fnc: string REPLACE_BY (string s,char c,char d) postcondition The…
There is nothing we can do
  • 23,727
  • 30
  • 106
  • 194
0
votes
1 answer

Where to find resources/information about proof control in Prolog

As part of an assignment I've been asked to check if proofs in natural deduction are either correct or incorrect, using Prolog. An example text file called "valid.txt" containing a proof looks like this: [imp(p, q), p]. q. [ [1, imp(p,q),…
wesslo
  • 38
  • 1
  • 3
0
votes
1 answer

Where are are the errors in my inductive proof?

I was asked the following question on an exam and it was only marked wrong with no other marks on it. I went to see the TA who marked it and he could only tell me that it was wrong. I suspect that he did not have the time to explain it to me. This…
0
votes
3 answers

Tokens in a bag

We have n tokens. Every token is either red, blue, or green. These n tokens are in a bag Repeat the following until the bag is empty: 1) If there are more than two tokens in the bag. take two random tokens out of the bag. Otherwise, empty the…
stebben
  • 11
  • 1
0
votes
2 answers

How to prove decidability of a relation swaping its parameters?

I have a situation where I defined an inductive datatype t and a partial order le over it (c.f. le_refl, le_trans, and le_antisym). The order has this particularity in the le_C case, that the order of the arguments are swapped in the inductive…
authchir
  • 1,605
  • 14
  • 26
0
votes
2 answers

Prove that different definitions of big-Oh with n>=1 or n>N are equivalent

I am coming across two slightly different definitions of big-oh and need to prove that they are equivalent to each other: Definition 1: f(n) = O(g(n)) if there exists constants c and N such that f(n) ≤ c g(n) for all n > N. Definition 2: f(n) =…
aky
  • 83
  • 8
0
votes
2 answers

Basic Isabelle/Isar style (exercise 4.6)

I'm interested in using Isabelle/Isar for writing proofs which are both human-readable and machine checked, and I am looking to improve my style and streamline my proofs. prog-prove has the following exercise: Exercise 4.6. Define a recursive…
Nick Hu
  • 43
  • 3
0
votes
1 answer

Prove that n < m + n or that 0 < m in COQ

I'm trying to use a lemma for a bigger proof, but I can't find a way to prove one of those two things. Can somebody help me? Here is the proof so far: Lemma less_r : (forall m n p : nat, n + m < p + n + m). Proof. intros. apply…
Rafael Santos
  • 39
  • 1
  • 6