improve hints in Implication lvl 2. #45
This commit is contained in:
@@ -11,9 +11,16 @@ use rewrites to fix things up."
|
||||
|
||||
/-- Assuming $0+x=(0+y)+2$, we have $x=y+2$. -/
|
||||
Statement (x : ℕ) (h : 0 + x = 0 + y + 2) : x = y + 2 := by
|
||||
Hint "Rewrite `zero_add` at `h` twice, to change `h` into the goal."
|
||||
repeat rw [zero_add] at h
|
||||
Hint "Now you could finish with `rw [h]` then `rfl`, but `exact h`
|
||||
Hint "You can use `rw [zero_add] at h` to rewrite at `{h}` instead
|
||||
of at the goal."
|
||||
rw [zero_add] at h
|
||||
Hint (hidden := true) "Do that again!
|
||||
|
||||
`rw [zero_add] at {h}` tries to fill in
|
||||
the arguments to `zero_add` (finding `{x}`) then it replaces all occurences of
|
||||
`0 + {x}` it finds. Therefor, it did not rewrite `0 + {y}`, yet."
|
||||
rw [zero_add] at h
|
||||
Hint "Now you could finish with `rw [{h}]` then `rfl`, but `exact {h}`
|
||||
does it in one line."
|
||||
exact h
|
||||
|
||||
|
||||
Reference in New Issue
Block a user