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
6
votes
1 answer
Is there a way to prove a program has no bug?
I was thinking about the fact that we can prove a program has bugs. We can test it to assess that it is more or less bug resistant.
But is there a way (even theoretically) to prove that a program has no bug ?
For simple programs, such as a "Hello…

Xaltar
- 1,688
- 14
- 22
6
votes
4 answers
How do I display a proof tree with HTML,CSS and/or Javascript?
I want to display a proof tree in the style of a natural deduction within a web page.
I will get the data from a JSON file.
Whats the best way to display something like this?
Is it possible only with css?
Or is there a library that can do…

schlicht
- 4,735
- 1
- 13
- 23
6
votes
4 answers
Apply a method if and only if it solves the current goal
Sometimes, when I’m writing apply-style proofs, I have wanted a way to modify a proof method foo to
Try foo on the first goal. If it solves the goal, good; if it does
not solve it, revert to the original state and fail.
This came up in the…

Joachim Breitner
- 25,395
- 6
- 78
- 139
6
votes
1 answer
Finding inaccessible points on a 2D plane
I have been working on JavaScript / JQuery code which allows arrow key movement between input boxes (yes, I am aware this breaks standard UI).
It works by by looping through each element and finding the closest in each direction (left, right, up and…

threenplusone
- 2,112
- 19
- 28
6
votes
2 answers
General proof of equivalence of two FSMs in finite time?
Does a general proof exist for the equivalence of two (deterministic) finite state machines that always takes finite time? That is, given two FSMs, can you prove that given the same inputs they will always produce the same outputs without actually…

sgibbons
- 3,620
- 11
- 36
- 31
6
votes
1 answer
Theorem Proof Using Prolog
How can I write theorem proofs using Prolog?
I have tried to write it like this:
parallel(X,Y) :-
perpendicular(X,Z),
perpendicular(Y,Z),
X \== Y,
!.
perpendicular(X,Y) :-
perpendicular(X,Z),
parallel(Z,Y),
!.
Can you…

Aman
- 71
- 1
- 2
5
votes
1 answer
Congruence for heterogenous equality
I'm trying to use heterogenous equality to prove statements involving this indexed datatype:
data Counter : ℕ → Set where
cut : (i j : ℕ) → Counter (suc i + j)
I was able to write my proofs using Relation.Binary.HeterogenousEquality.≅-Reasoning,…

Cactus
- 27,075
- 9
- 69
- 149
5
votes
1 answer
Cases tactic in Lean does not create hypothesis
When using the cases-tactic on an inductive data type, lean produces multiple cases, but does not create a hypothesis stating the assumption of the current case. For example:
inductive color | blue | red
theorem exmpl (c : color) : true :=
begin
…

502E532E
- 431
- 2
- 11
5
votes
1 answer
How do I prove type-level list properties in haskell?
I have these type families:
type family xs ++ ys where
'[] ++ ys = ys
(x : xs) ++ ys = x : (xs ++ ys)
type family Drop n xs where
Drop O xs = xs
Drop (S n) (_ : xs) = Drop n xs
type family Length xs where
Length '[] = O
…

Heimdell
- 617
- 5
- 11
5
votes
1 answer
CoNat : proving that 0 is neutral to the left
I am experimenting with the definition of CoNat taken from this paper by Jesper Cockx and Andreas Abel:
open import Data.Bool
open import Relation.Binary.PropositionalEquality
record CoNat : Set where
coinductive
field iszero : Bool
…

Dave
- 147
- 5
5
votes
2 answers
Coq simpl / unfold only once. (Replace part of goal with the result of one iteration of a function.)
I am an instructor at university for a class titled Type Systems of Languages and the professor used the following example for inductive proofs in Type Theory on the board last lecture:
Suppose, that there are natural numbers defined inductively…

Isti115
- 2,418
- 3
- 29
- 35
5
votes
1 answer
How to prove integer division inequality in Coq
I need to prove: 256 * (x / 256) <= 256 * x / 256, or more generally forall a b c : N, c > 0 -> a * (b / c) <= a * b / c. This is true since either b is divisible by c and they are equal or it's not and multiplying first can inflate the number and…

Joald
- 1,114
- 10
- 32
5
votes
2 answers
How to prove the principle of explosion (ex falso sequitur quodlibet) in Scala?
How do I show that anything follows from a value of a type with no constructors in Scala? I would like to do a pattern match on the value and have Scala tell me that no patterns can match, but I am open for other suggestions. Here is a short example…

DrPhil
- 377
- 1
- 12
5
votes
1 answer
Understanding COQ proof on Show Proof.
Im new in COQ and Im trying to proof the counterexample theorem.
Variable A B:Prop.
Hypothesis R1: ~A->B.
Hypothesis R2: ~B.
Theorem ej: A.
When we studied logics, we learn the RAA thechnic but in COQ this doesn't add a new Hypothesis, and now we…

Germán Faller
- 546
- 7
- 15
5
votes
2 answers
Proving the fusion law for unfold
I was reading Jeremy Gibbons' article on origami programming and I got stuck on exercise 3.7, which asks the reader to prove the fusion law for list unfolds:
unfoldL p f g . h = unfoldL p' f' g'
if
p . h = p'
f . h = f'
g . h = h . g'
The…

Dan Oneață
- 968
- 7
- 14