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.
Questions tagged [proof]
828 questions
0
votes
1 answer
Hoare logic proof
Give a proof that the following is correct.
{n != 0}
if n<0 then
n= -n
{n>0}
The following inference rule should help
{B and P} S {Q}, (not B) and P=>Q
---------------------------------
{P}if B then S{Q}
I have been looking all over the…

Java Newbie
- 11
- 2
0
votes
1 answer
Proof of custom binary strings
Fibonacci is defined recursively for this question as: F~0 = 1 F~1 = 1 F~n = F~n-1 + F~n-2 for n >= 2
So a custom binary string always begins with 1 and never has two consecutive ones. If s = s~Ls~L-1...s~1 is such a string of length L where s~i is…

kindofastudent
- 35
- 1
- 6
0
votes
2 answers
proving that huffman's algorithm can produce a codeword of length 1 when frequency greater than 0.40
If I have a set of symbols and frequencies:
A - 0.1
B - 0.40
C - 0.2
D - 0.23
E - 0.15
F - 0.17
The Huffman algorithm will produce codewords that are only greater than length 1.
But when I change a frequency to be greater than 0.40, it will…

Catherine Pierce
- 53
- 2
- 7
0
votes
1 answer
Proving efficiency class for a time complexity function
Below is the solution but I have trouble understanding 1 part of the proof by induction part. Why can you just add + 2 to one side and +4 to the other?
We're dealing with the function T(n) = 2n + 2
We want to find a c such that T(n) <= c * f(n) for…

Andrew Tsay
- 1,893
- 6
- 23
- 35
0
votes
1 answer
Prove ¬(¬a = a)
This looks like such an easy problem but still can't figure it out. How do I prove ¬(¬a = a)?
No given premises.
I got this so far (in Fitch):
This is a subproof where I assume the negation of my goal and then try to reach the absurd/contradiction…

Yaeger
- 253
- 4
- 15
0
votes
1 answer
Prolog Program Out of Global Stack Error
I am trying a theorem proving program. But Rule 4 seems to be badly implemented.
% delete
del(X, [X | Tail], Tail).
del(X, [Y | Tail], [Y | Tail1]) :-
del(X, Tail, Tail1).
% remove
remove(X, Y, L1, L2) :-
del(X, L1, L3),
del(Y, L3,…

Yue Yu
- 1
0
votes
0 answers
Merge sorted sequences with split and concat
I am struggling with following assignment:
Given sorted sequences of numbers and operations and , find an optimal sequence of those operations (the shortest one), which creates one sorted sequence.
I've devised following algorithm:
1. Sort…

ciechowoj
- 914
- 6
- 26
0
votes
2 answers
Proof of Paper, Scissor, Rock as Monoid Instance in Coq
So while learning Coq I did a simple example with the game paper, scissor, rock. I defined a data type.
Inductive PSR : Set := paper | scissor | rock.
And three functions:
Definition me (elem: PSR) : PSR := elem.
Definition beats (elem: PSR) : PSR…

Cristian Garcia
- 9,630
- 6
- 54
- 75
0
votes
0 answers
Prolog - How do I represent my code in a proof/derivation/binary tree?
After searching extensively online, the information provided regarding proof/derivation/binary trees felt somewhat over my head. Here is my SWI-Prolog code:
number_book(111, brave_new_world).
number_book(222, lord_of_the_flies).
number_book(333,…

fleggle
- 61
- 5
0
votes
1 answer
What is the right direction of using "*.isInstance"?
I am confused every time I read the Java Documentation again to that.
So please try to help me in your own words.
List list = new ArrayList();
//Child extends Parent...
list.add(new Child());
...
...
for(Parent p: list){
…

Oekel
- 43
- 9
0
votes
0 answers
A (sane) extruded convex 3D hull algorithm?
So I'll try to describe the problem in detail, and I'd like some critique on the validity and performance of the process I use to solve it. My main concern is the validity, which I cannot seem to prove.
The idea is that we have a 2D polygon in 3D…

user3472774
- 201
- 2
- 6
0
votes
1 answer
Any documents for practice Rule Induction in Type System?
As you know, to define a new type system, one way is that we need:
Language syntax
Typing rules
And then we need to prove some theorems we believe that it is provable by using above typing rules. To prove these theorems, one way is that we can use…

Marco Dinh
- 332
- 2
- 15
0
votes
1 answer
Elim a double negation hypothesis in Coq Proof Assistant?
Could anyone explain to me why do we have to prove ~A after elim Ha.?
Before "elim Ha"
1 subgoals
A : Prop
Ha : ~ ~ A
______________________________________(1/1)
A
After
1 subgoals
A : Prop
Ha : ~ ~…

Marco Dinh
- 332
- 2
- 15
0
votes
2 answers
Proving breadth-first traversal on graphs
I am trying to prove the following algorithm to see if a there exists a path from u to v in a graph G = (V,E).
I know that to finish up the proof, I need to prove termination, the invariants, and correctness but I have no idea how. I think I need…

user3335040
- 649
- 1
- 7
- 17
0
votes
2 answers
How to prove that every sub-section, the strategy is most optimal in minimax algorithm?
The question is as the title suggest.
I know that minimax algorithm does this for 2-people game (assume we want to maximize A's profit): when it is A’s turn, we take the max of the child values because we are maximizing A's profit, and when it is…

LarsChung
- 703
- 5
- 10
- 24