Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: ambiguity with newly introduced divisibility symbol #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions quantifiers_and_equality.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,20 +497,18 @@ example (h₁ : divides x y) (h₂ : y = z) : divides x (2*z) :=
_ = z := h₂
divides _ (2*z) := divides_mul ..

infix:50 " " => divides
infix:51 " " => divides

example (h₁ : divides x y) (h₂ : y = z) : divides x (2*z) :=
calc
x y := h₁
x y := h₁
_ = z := h₂
_ 2*z := divides_mul ..
_ 2*z := divides_mul ..
```

The example above also makes it clear that you can use `calc` even if you
do not have an infix notation for your relation. Finally we remark that
the vertical bar `∣` in the example above is the unicode one. We use
unicode to make sure we do not overload the ASCII `|` used in the
`match .. with` expression.
do not have an infix notation for your relation.
Finally, we remark that, in the example above, we use the double pipe `‖` symbol instead of the vertical bar `∣` or ASCII `|`. We do that to avoid ambiguity with the already defined `∣` and overloading `|` used in the `match .. with` expression. In practice, it is probably better to use the standard library's `∣` (or `Dvd.dvd`) to express divisibility instead of defining it yourself.

With ``calc``, we can write the proof in the last section in a more
natural and perspicuous way.
Expand Down
Loading