Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
Advice
1 vote
6 replies
227 views

When performing recursion, it seems reasonable to assume that if two subcases f b1 and f b2 are equal, they will produce equal results IH b1 = IH b2: after all, we only expect to call the inductive ...
Jasper Hugunin's user avatar
Advice
1 vote
1 replies
84 views

I'm looking for a Coq function that converts a natural number (of type nat) to a string. I've found some code here that works, but I'd really prefer if there was a function in a standard library that ...
Sambo's user avatar
  • 199
0 votes
3 answers
119 views

I have two discrete systems. The first one (B1) is composed of sequences starting with 0 and where steps are either +2 or "no-op". For instance : 0 → 2 → 4 → 6... 0 → 0 → 2 → 4 → 4 → 4 → 6......
dvnh87's user avatar
  • 23
0 votes
3 answers
87 views

I would like to have a following Dafny lemma to be proved. The automatic proof fails, so I have to use Dafny calc feature for guided proofs, but I don't see a way how to apply it in lemma with an ...
Daniil Iaitskov's user avatar
1 vote
2 answers
103 views

Trying to get some basic results about Fibonnaci sequence, I faced a rocq behavior that is daunting for my understanding of recursion. The following code shows that the two-step Fibonacci function is ...
David Roman-Ferriere's user avatar
2 votes
1 answer
99 views

In the development below, I arrive at the goal, and I don't know how to proceed. A: Type a: list (list A) b: list A i,j: nat Hi: i < length a Hj: j < length (nth i a []) -------------------------...
larsr's user avatar
  • 5,933
1 vote
1 answer
67 views

Consider the following code: void incr(int *a, int *b) { (*a)++; (*b)++; } void f(int *a, int *b) { incr(a, b); incr(a, a); } The incr function admits two specifications: {a ↦ n * b ↦ m}...
tymmym's user avatar
  • 500
0 votes
2 answers
188 views

I've been trying to prove this lemma (an abstract version of what I need), but I seem to be stuck with dependent-type errors. I tried to provide a first proof attempt (see below), but I fail to see ...
Pierre Jouvelot's user avatar
0 votes
2 answers
117 views

I'm puzzled by this simple lemma (a simplified version of what I'm trying to do). From mathcomp Require Import all_ssreflect. Lemma foo (bar : bool) : match boolP bar with | @AltTrue _ _ baz => (...
Pierre Jouvelot's user avatar
3 votes
2 answers
165 views

Trying to follow the course material in the Mathematical Components book (see here, I tried to mimic the type of the nat. The code is the followoing: From HB Require Import structures. From mathcomp ...
David Roman-Ferriere's user avatar
1 vote
1 answer
64 views

Section 5.1.3 "Using views in intro patterns" of the book "Mathematical Components" explain how the view intro-pattern works as follows. First, we have a lemma andP which relates (...
hengxin's user avatar
  • 2,011
0 votes
1 answer
161 views

I am having trouble with a piece of Rocq code that I think has to do with providing a proof argument to a function, but I am not sure. Here's the relevant code. The code below typechecks: Require ...
Anirudh's user avatar
  • 361
1 vote
2 answers
187 views

I'm doing inversion H on an Inductive definition that uses dependent types, and I obtain some assumptions of the form existT ... n = existT ... n' from which I want to deduce n = n' (this is done ...
Mathieu Paturel's user avatar
0 votes
2 answers
134 views

I have an inductive type Inductive fin : nat -> Set := | First : forall n, fin (S n) | Next : forall n, fin n -> fin (S n). Coq cannot deduce that if something is of type fin 1 then it must be ...
Wiktor's user avatar
  • 311
1 vote
3 answers
96 views

When I prove with Coq (or Rocq), I find that sometimes if a hypothesis is "P" and another is "P -> forall x, Q x", I cannot make "forall x, Q x" a new premise by modus ...
Arthur Kexu-Wang's user avatar

15 30 50 per page
1
2 3 4 5
201