coq


Coq: Remove all (nested) parentheses from a sum


Suppose I've a sum like a + (b + (c + d)), which I wish to transform into a + b + c + d to apply a lemma.
Doing this manually with Nat.add_assoc is extremly tedious. Is there a smarter way?
You can use the repeat tactical, which repeats some tactic until it cannot be applied anymore:
repeat rewrite Nat.add_assoc.
or a more concise version:
rewrite !Nat.add_assoc.
It works just the same as the variant with repeat.
The downside of this approach is that it rewrites everywhere in the goal. So, you might want to select some part of your formula to do the rewrites on it only.
The 'easy but not nice' way I would use is replace (a + (b + (c + d)))) with (a + b + c + d) by now omega

Related Links

Using “rewrite [hypothesis with implication]”
Confused by Coq imports
Behaviour of the apply tactic when the goal and the applied term match
Is there a ring or field tactic that can solve existential variables in Coq?
Proof by case analysis in Coq
How to let COQ write complete proof log?
How to compile Logic.v in Coq
is there a `eapply`-like tactic that works on `exists` goals in Coq?
rewrite works for = but not for <-> (iff) in Coq
Passing patterns to tactics
How to automatically introduce symmetries into Coq hypotheses?
How to save the current goal / subgoal as an `assert` lemma
How to introduce a new existential condition from a witness in Coq?
How to use a custom induction principle in Coq?
How to proof consistency in a COQ theory
Printing a message only if a tactic succeeds

Categories

HOME
gitlab
deployment
electron
at-command
programming-languages
tizen-web-app
ojdbc
applepay
medical
reveal.js
n-gram
static-libraries
opentracing
aurigma
oxyplot
nodatime
apache-commons-io
vision
tasklet
lightswitch-2013
microsoft-chart-controls
pdb
language-concepts
wallpaper
normal-distribution
hexo
bytecode-manipulation
overlap
adobe-premiere
reportbuilder
sqlite2
angularjs-factory
squib
eigenvalue
isbn
bootstrap-dialog
http-redirect
checkboxlist
hibernate-tools
togetherjs
aurelia-validation
colorama
android-cursor
pdfclown
linode
dynamics-sl
orthogonal
xcb
abcpdf9
spring-android
websitepanel
connect-by
sigabrt
bgp
pervasive-sql
thredds
libressl
ionic
nsight
nstableviewcell
java.util.concurrent
applescript-objc
xcode-6.2
responsive-slides
aapt
navigationservice
elliptic-curve
poller
random-seed
orchardcms-1.7
drools-planner
propertyeditor
ocx
amazon-appstore
ohm
php-parser
vdsp
subgurim-maps
infobox
coercion
xtype
remember-me
w3wp.exe
yslow
google-friend-connect
infrastructure
microsoft-virtualization
adrotator
grid-system

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App