Last active
April 24, 2018 01:38
-
-
Save cipher1024/0d3328135367269cc35f74f43ecbb302 to your computer and use it in GitHub Desktop.
try to apply a rule that doesn't quite fit the goal and generate equality obligations for the parts where they differ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace tactic | |
namespace interactive | |
open interactive interactive.types lean.parser | |
local postfix `?`:9001 := optional | |
local postfix *:9001 := many | |
meta def convert (sym : parse (with_desc "←" (tk "<-")?)) (r : parse texpr) (n : parse (tk "using" *> small_nat)?) : tactic unit := | |
do v ← mk_mvar, | |
if sym.is_some | |
then refine ``(eq.mp %%v %%r) | |
else refine ``(eq.mpr %%v %%r), | |
gs ← get_goals, | |
set_goals [v], | |
(option.cases_on n congr congr_n : tactic unit), | |
gs' ← get_goals, | |
set_goals $ gs' ++ gs | |
end interactive | |
end tactic | |
open set | |
variables {α β : Type} | |
@[simp] lemma singleton_inter_singleton_eq_empty {x y : α} : | |
({x} ∩ {y} = (∅ : set α)) ↔ x ≠ y := | |
by simp [singleton_inter_eq_empty] | |
example {f : β → α} {x y : α} (h : x ≠ y) : f ⁻¹' {x} ∩ f ⁻¹' {y} = ∅ := | |
begin | |
have : {x} ∩ {y} = (∅ : set α) := by simpa using h, | |
convert preimage_empty, | |
rw [←preimage_inter,this], | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment