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
7
votes
1 answer
Coq rewriting using lambda arguments
We have a function that inserts an element into a specific index of a list.
Fixpoint inject_into {A} (x : A) (l : list A) (n : nat) : option (list A) :=
match n, l with
| 0, _ => Some (x :: l)
| S k, [] => None
| S k, h :: t…

ScarletAmaranth
- 5,065
- 2
- 23
- 34
7
votes
1 answer
If Idris thinks things may be total that are not, can Idris be used for proofs?
http://docs.idris-lang.org/en/v0.99/tutorial/theorems.html#totality-checking-issues states that:
Secondly, the current implementation has had limited effort put into it so far, so there may still be cases where it believes a function is total which…

redfish64
- 565
- 3
- 10
7
votes
4 answers
prove n = Big-O(1) using induction
I know that the relation n = Big-O(1) is false. But if we use induction involving Big-O it can be proved. But the fallacy is we cannot induct Big-O. But my question is how we can disprove the relation by using the constants.
The false proof is here,…

Kartik
- 81
- 1
- 2
7
votes
1 answer
Universal Quantification in Isabelle/HOL
It has come to my attention that there are several ways to deal with universal quantification when working with Isabelle/HOL Isar. I am trying to write some proofs in a style that is suitable for undergraduate students to understand and reproduce…

Martin Copes
- 931
- 1
- 7
- 14
7
votes
1 answer
Proof assistant for mathematics only
Most proof assistants are functional programming languages with dependent types. They can proof programs/algorithms. I'm interested, instead, in proof assistant suitable best for mathematics and only (calculus for instance). Can you recommend one? I…

Yury
- 1,169
- 2
- 16
- 29
7
votes
2 answers
Using Ogden’s Lemma versus regular Pumping Lemma for Context-Free Grammars
I'm learning the difference between the lemmata in the question. Every reference I can find uses the example:
{(a^i)(b^j)(c^k)(d^l) : i = 0 or j = k = l}
to show the difference between the two. I can find an example using the regular lemma to…

XML Slayer
- 1,530
- 14
- 31
7
votes
2 answers
How to solve goals with invalid type equalities in Coq?
My proof scripts are giving me stupid type equalities like nat = bool or
nat = list unit which I need to use to solve contradictory goals.
In normal math, this would be trivial. Given sets bool := { true, false } and
nat := { 0, 1, 2, ... } I know…

nobody
- 4,074
- 1
- 23
- 33
6
votes
3 answers
Big Oh Notation O((log n)^k) = O(log n)?
In big-O notation is O((log n)^k) = O(log n), where k is some constant (e.g. the number of logarithmic for loops), true?
I was told by my professor that this statement was true, however he said it will be proved later in the course. I was wondering…

user1084113
- 932
- 3
- 15
- 31
6
votes
2 answers
Is it possible to disambiguate instances with an intermediate step?
Suppose a scenario where you have an application config, the structure of which has changed a few times. To provide ease of use for users, you wish to allow automatic migration from each version to the next.
The code below shows such a scenario,…

notquiteamonad
- 1,159
- 2
- 12
- 28
6
votes
3 answers
Minimize Sum of Absolute Difference of Two Arrays
I have two arrays of integers A and B both of size n. The cost of a pair is |A(i) - B(i)|.
I want to pair the n elements of A and B such that the sum of all costs across all A(i)s and B(i)s are minimized.
I understand that I can get O(n log n) by…

Jeric
- 315
- 1
- 3
- 9
6
votes
1 answer
Finite multisets as a HIT in Cubical Agda
In the standard library of Cubical Agda, there are finite multisets whose elegant definitions I reproduce below:
{-# OPTIONS --cubical --safe #-}
open import Cubical.Foundations.Prelude
infixr 20 _∷_
data FMSet (A : Set) : Set where
[] :…

Bob
- 1,713
- 10
- 23
6
votes
2 answers
Which vector library to use in coq?
I'm wondering, is there a commonly used library for vectors in coq, I.e. lists indexed by their length in their type.
Some tutorials reference Bvector, but it's not found when I try to import it.
There's Coq.Vectors.Vectordef, but the type defined…

jmite
- 8,171
- 6
- 40
- 81
6
votes
2 answers
If two things are not not equal, are they equal?
If two values in Agda, or some other dependently typed language, you can prove that v₁ is not not equal to v₂, can you prove v₁ equals v₂?
Like, is there a function of the type ((v₁ ≡ v₂ → ⊥) → ⊥) → v₁ ≡ v₂?
This seems like something that is safe to…

PyRulez
- 10,513
- 10
- 42
- 87
6
votes
1 answer
How to end this Proof in Coq
I have managed to reduce my goal to
(fun x0 : PSR => me (x x0)) = x
I know that reflexivity will work, but for pedagogical reasons I prefer to continue reducing it.
me is an identity function so unfold me simplifies it to
(fun x0 : PSR => x x0) =…

Cristian Garcia
- 9,630
- 6
- 54
- 75
6
votes
5 answers
How to prove that the C statement -x, ~x+1, and ~(x-1) yield the same results?
I want to know the logic behind this statement, the proof. The C expression -x, ~x+1, and ~(x-1) all yield the same results for any x. I can show this is true for specific examples. I think the way to prove this has something to do with the…

Ben Fossen
- 1,331
- 6
- 21
- 33