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

Proving a theorem about ordered lists
Strong Induction on Lists
What does the simpl tactic do in COQ
Induction on predicates with product type arguments
Construct Sets in Coq
Is this relationship between forall and exists provable in Coq/intuitionistic logic?
Proof automation in Coq how to factorize a proof
How to use matched case and variable equivalence in coq
Proof with false hypothesis in Isabelle/HOL Isar
Is there a convention for the order of applying ssreflect tactic/taticals?
How to systematically normalize inequalities to < (lt) and <= (le) in Coq?
Inductive subset of an inductive set in Coq
How to find the source file for an identifier in Coq
Coq “Unknown interpretation for notation” error
How to switch the current goal in Coq?
Reasoning about lists in Coq

Categories

HOME
maven
java
pdf
gerrit
relayjs
relay
grep
gis
paw-app
microservices
rubygems
ip
yum
onelogin
elasticsearch-hadoop
here-api
alignment
carthage
jsprit
netflix
tostring
apache-metamodel
shared-hosting
kryo
scriptcs
errorlevel
autosys
trading
minitab
primitive
instant-messaging
gtrendsr
perlin-noise
plsql-psp
io-redirection
disassembling
serve
xcode-extension
espeak
neuroscience
mixture-model
opshub
elasticsearch-plugin
ncalc
botbuilder
eigenvalue
midl
carrot
diagnostics
knockout-components
google-perftools
knpmenubundle
zendesk-app
flutterwave
jspdf-autotable
sonarlint-vs
query-performance
watchconnectivity
grails-tomcat-plugin
android-textview
probability-density
gridview-sorting
clang-static-analyzer
moveit
ready-api
bluegiga
wapiti
maven-tomcat-plugin
thredds
atk4
ibaction
myo
sortedlist
dundas
proj4js
modalpopup
offloading
dd
camanjs
knuth
cdt
fpml
elliptic-curve
cloud-connect
intentservice
prettify
commoncrypto
ril
mqx
reddot
mercurial-server
krl
lpeg
dmx512
forums
memory-size
uimenucontroller
ubuntu-9.04
uiq3

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App