Questions tagged [induction]

Anything related to mathematical induction principle and techniques applied to computing. Please DO NOT USE this tag for math-only questions since they are off-topic on SO. This tag may be used for math-related questions only if it involves some programming activity or software tools (e.g. automatic theorem proving, etc.).

Anything related to mathematical induction principle and techniques applied to computing. Please DO NOT USE this tag for math-only questions since they are off-topic on SO. This tag may be used for math-related questions only if it involves some programming activity or software tools (e.g. automatic theorem proving, etc.).

262 questions
0
votes
1 answer

Prove recursive function exists using only `nat_ind`

I'm trying to prove the following in Coq: ∀ B: Type, ∀ a: B, ∀ b: nat -> B -> B, ∃ f: nat -> B, f 0 = a ∧ ∀ n: nat, f (S n) = b n (f n). Which implies that a fairly general class of recursive functions exist. I know that I can construct that…
hamid k
  • 481
  • 4
  • 11
0
votes
1 answer

proving a binary add function

I'm fairly new to the Coq language and I want to prove a function that does an binary add from numbers represented as a list (least significant bit upfront). I have created this badd function that does that and now I want to prove it: Fixpoint badd…
Alice
  • 15
  • 3
0
votes
2 answers

How to do an inductive proof

I have to show that : Lemma bsuccOK: forall l, value (bsucc l) = S (value l). with an induction proof, but I don't understand how to do it. Here is the bsucc function: Fixpoint bsucc (l: list bool): list bool := match l…
Alice
  • 15
  • 3
0
votes
0 answers

Induction proof of Perfect number

fun perfect(n) = let fun add_factors(n) = let fun f(i) = if n mod i = 0 then i else 0; fun sum(a, b) = if a > b then 0 else f(b) + sum(a, b-1); in …
Artique
  • 19
  • 3
0
votes
1 answer

How to prove that another definition of permutation is the same as the Default Permutation Library for COQ

I need to proove that a secondary definition of permutation is equivalent to the default definition of permutation in Coq: Down bellow is the default Permutation definition in Coq Inductive Permutation : list A -> list A -> Prop := | perm_nil:…
Breno
  • 135
  • 8
0
votes
1 answer

Show that for any AVL tree with height h, all levels until h/2 are complete trees by induction

I was given this question on a test: "show by induction, that for a given AVL tree of height h, all levels of the tree until h/2 (round down) are complete binary trees". I wrote down the following answer and would like to know if my argument…
Yair
  • 99
  • 8
0
votes
1 answer

Tree Traversal and Recursion Conceptual Question

Many recursive solutions to problems of size N follow the pattern: Step 1: Solve the problem for the smallest input (say, n = 1) Step 2: Given the solution to the same problem of size n = k-1 (k <= N), solve it for n = k. We can see the inductive…
0
votes
1 answer

Coq: Induction on associated variable

I can figure out how to prove my "degree_descent" Theorem below if I really need to: Variable X : Type. Variable degree : X -> nat. Variable P : X -> Prop. Axiom inductive_by_degree : forall n, (forall x, S (degree x) = n -> P x) -> (forall x,…
Feryll
  • 317
  • 1
  • 8
0
votes
1 answer

Dafny prove lemmas in a high-order polymorphic function

I have been working on an algorithm (Dafny cannot prove function-method equivalence, with High-Order-Polymorphic Recursive vs Linear Iterative) to count the number of subsequences of a sequence that hold a property P. For instance, how many…
Theo Deep
  • 666
  • 4
  • 15
0
votes
1 answer

Inductive proof of question regarding recurrence relations

Currently, I am solving some problems regarding the algorithm, and one problem has become a pain in the butt. Solve the following recurrence. Then, use induction to prove that your solution is correct. T(n) = 3T(n/9) + n^(1/2), for n > 1, and T(1) =…
0
votes
1 answer

Proving in Dafny: A non-empty even sequence, is the concatenation of it's two halves

I would like to prove this "trivial" lemma in Dafny. A non-empty even sequence, is the concatenation of it's two halves: lemma sequence_division(sequ:seq) requires sequ != [] requires even(|sequ|) ensures sequ[0..|sequ|] ==…
0
votes
1 answer

Defining integers inductively in Coq (inductive definitions subject to relations)

In Coq, one can define the natural numbers inductively as follows: Inductive nat := | zero : nat | succ : nat -> nat. I would like to know if it's possible to define the integers inductively, in a similar fashion? I can do something like Inductive…
0
votes
1 answer

Induction order for relation between three lists

I'm working on a theory of string grammars, but I'm completely blocked by a particular theorem. Every induction ordering I've tried ends up stuck with nonsensical and useless induction hypotheses, and I'm not sure what I'm missing. I've now reread…
blaineh
  • 2,263
  • 3
  • 28
  • 46
0
votes
1 answer

Isabelle induction, custom base case

I'm currently trying to proof the following lemma in isabelle: lemma helper: fixes n :: nat assumes "n ≥ 5" shows "(n * n > 2*n + 1)" proof (induction n) qed However the induction proof tactic forces me to show the following two cases: 1. 2…
loki locus
  • 73
  • 2
  • 7
0
votes
1 answer

How to pass Induction in SymbiYosys?

I am very new to formal verification and I started my formal verification with SymbiYosys. I had written some code in System Verilog for learning formal verification, I was able to pass BMC and cover for the code but it is failing (UNKNOWN sate) for…