forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalcQuestionMark.lean
More file actions
67 lines (59 loc) · 1.34 KB
/
CalcQuestionMark.lean
File metadata and controls
67 lines (59 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import Mathlib.Tactic.Widget.Calc
/-!
Note that while the suggestions look incorrectly indented here,
this is an artifact of the rendering to a string for `guard_msgs` (https://github.com/leanprover/lean4/issues/7191).
When used from the widget that appears in VSCode, they insert correctly-indented code.
-/
/--
info: Create calc tactic:
[apply] calc
1 = 1 := by sorry
---
warning: declaration uses `sorry`
-/
#guard_msgs in
example : 1 = 1 := by
have := 0
calc?
/--
info: Create calc tactic:
[apply] calc
a ≤ a := by sorry
---
warning: declaration uses `sorry`
-/
#guard_msgs in
example (a : Nat) : a ≤ a := by
calc?
-- an indented `calc?`
/--
info: Create calc tactic:
[apply] calc
a ≤ a := by sorry
---
warning: declaration uses `sorry`
-/
#guard_msgs in
example (a : Nat) : a ≤ a := by
all_goals
calc?
-- a deliberately long line
/--
info: Create calc tactic:
[apply] calc
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 +
1 +
1 =
8 + 8 + 8 + 8 :=
by sorry
---
warning: declaration uses `sorry`
-/
#guard_msgs in
example :
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 8 + 8 + 8 + 8 := by
calc?