Skip to content
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
14 changes: 14 additions & 0 deletions templates/contribute/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,20 @@ theorem Ordinal.sub_eq_zero_iff_le {a b : Ordinal} : a - b = 0 ↔ a ≤ b :=
fun h => by rwa [← Ordinal.le_zero, sub_le, add_zero]⟩
```

The `@[to_additive]` and `@[to_dual]` attributes are pieces of automation
that respectively generate additive versions of algebraic multiplicative
statements and dualised versions of order/category theoretic statements.
Where applicable, these attributes should be used
Comment thread
YaelDillies marked this conversation as resolved.
over writing the second statement by hand.
```lean
@[to_additive] -- generates `add_rotate`
theorem mul_rotate {G : Type*} (a b c : G) : a * b * c = b * c * a := sorry

-- `to_additive` can't be used here because `ℝ` can't be additivised.
theorem mul_rotate' (a b c : ℝ) : a * b * c = b * c * a := sorry
```


### Instances

When providing terms of structures or instances of classes, the `where`
Expand Down