improve hints in Implication lvl 2. #45

This commit is contained in:
Jon Eugster
2024-03-18 16:33:57 +01:00
parent c35d29dcf4
commit 0353657b3e
2 changed files with 23 additions and 7 deletions

View File

@@ -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