Questions tagged [ssreflect]

The SSReflect proof language is a set of Coq tactics which allows for small scale reflection. It is the core language used in the Mathematical Components project and has been integrated into vanilla Coq starting from version 8.7.

78 questions
1
vote
1 answer

How do I describe a multiplication of vectorized matrices?

I want to calculate a product of huge (specific) matrices. From a point complexity of view, the product should be taken the form of an elementwise expression. I tried to "vectorize" the matrices with mxvec / vec_mx and calculate the product via one…
1
vote
1 answer

SsrReflect and setoid rewriting

I can't use Ssreflect's rewrite with setoids. Although I don't think this information is relevant to solve the problem, I'm using this formulation of category theory in coq: https://github.com/jwiegley/category-theory. As far as I know, Ssreflect's…
jabberabbe
  • 35
  • 4
1
vote
2 answers

Proving that size with filter is not equal to (size + 1)

Having this theorem: Lemma all_count T (a : pred T) s : all a s = (count a s == size s). Proof. elim: s=> [| x xs IH] //. case E: (a x)=> /=; rewrite E. - rewrite addnC. rewrite addn1. rewrite eqSS. by rewrite -IH. - rewrite addnC=> /=. rewrite…
user4035
  • 22,508
  • 11
  • 59
  • 94
1
vote
1 answer

Use condition in a ssreflect finset comprehension

I have a function f that takes a x of fintype A and a proof of P x to return an element of fintype B. I want to return the finset of f x for all x satisfying P, which could be written like this : From mathcomp Require Import ssreflect ssrbool…
1
vote
1 answer

Extract / use membership proof from a ssreflect finset

EDIT : I have made the example more minimal by introducing a structure that augments an element by carrying a proof of the membership of the said element to a set: Structure elem_and_in_proof {T : finType} (s : {set T}) := {el :> T ; Helin : el \in…
1
vote
1 answer

Cardinality of finFieldType / Euler's criterion

I am trying to prove a very limited form of Euler's criterion: Variable F : finFieldType. Hypothesis HF : (1 != -1 :> F). Lemma euler (a : F) : a^+(#|F|.-1./2) = -1 -> forall x, x^+2 != a. I have the bulk of the proof done already, but I am left…
Garogolun
  • 323
  • 2
  • 11
1
vote
1 answer

Automation of ssreflect, Coq while dealing with contradicted hypotheses about nat numbers

While using ssreflect in the following lemma: From mathcomp Require Import ssreflect ssrfun ssrbool ssrnat eqtype. Lemma nat_dec n m: (m <= n) -> (~~ (m <= n)) -> False. Proof. intros A notA. (* auto. *) red in A. red in notA. (* auto.…
Zheng Cheng
  • 389
  • 2
  • 11
1
vote
1 answer

Coq - Proving strict inequality involving bigops in Ssreflect

I am trying to prove the following using the Mathematical Components library: Lemma bigsum_aux (i: 'I_q) (j: 'I_q) (F G : 'I_q -> R): (forall i0, F i0 <= G i0) /\ (exists j0, F j0 < G j0) -> \sum_(i < q) F i < \sum_(i < q) G i. Initially, I was…
VHarisop
  • 2,816
  • 1
  • 14
  • 28
1
vote
1 answer

Coq - dependent type error in rewrite

I am using the Mathematical Components library and I am trying to prove this: Lemma card_sub_ord (k : nat) (P : nat -> bool) : #|[set i : 'I_k | P i]| <= k. Proof. set S := [set i : 'I_k | P i]. have H1 : S \subset 'I_k. by apply:…
VHarisop
  • 2,816
  • 1
  • 14
  • 28
1
vote
2 answers

Proving simple inequality in Ssreflect

I'm having trouble with some pretty simple proofs in Coq, using the MathComp library for reflection. Suppose I want to prove this Lemma: From mathcomp Require Import ssreflect ssrbool ssrnat. Lemma example m n: n.+1 < m -> n < m. Proof. have…
VHarisop
  • 2,816
  • 1
  • 14
  • 28
1
vote
1 answer

Is there a convention for the order of applying ssreflect tactic/taticals?

I am trying to understand how combined ssreflect tactics should be "decomposed" (or how they are composed in the first place). One of the problems I have is to understand the order and associativity of the taticals. Sometimes, I feel that the order…
thor
  • 21,418
  • 31
  • 87
  • 173
1
vote
1 answer

What is GroupScope?

In all of the coq codes in ssreflect there is this statement Import GroupScope. What is GroupScope? If it is another file, where can I download it from?
0
votes
1 answer

Coerce rat to realType im math-comp/analysis

Is there a way to coerce a rat into a realType (from the math-comp/analysis library)? For example, the notation for coercing a nat is %:R.
dvr
  • 370
  • 1
  • 9
0
votes
2 answers

Understanding \is a unit in ssreflect

I'm really annoyed by the following goal: a%:R \is a unit where a is a nat. The only lemma that seems to help is unitrE, but then it seems impossible to simplify further. This goal should be solvable. Can someone explain how to coerce this to a…
dvr
  • 370
  • 1
  • 9
0
votes
1 answer

using addf_div for rat_numDomainType

I am trying to apply the addf_div theorem from math-comp's ssralg to the following: 1 / a%:R + 1 / a%:R. I want to show that this is 2 / a%:R, but addf_div is over fieldTypes and can't be applied. Is there a way to apply addf_div to the goal. Here,…
dvr
  • 370
  • 1
  • 9