forked from leanprover-community/mathlib3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstance_cache.lean
More file actions
71 lines (60 loc) · 1.29 KB
/
Copy pathinstance_cache.lean
File metadata and controls
71 lines (60 loc) · 1.29 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
68
69
70
71
import tactic.cache
meta def assert_frozen_instances : tactic unit := do
frozen ← tactic.frozen_local_instances,
when frozen.is_none $ tactic.fail "instances are not frozen"
example (α) (a : α) :=
begin
haveI h : inhabited α := ⟨a⟩,
assert_frozen_instances,
exact default α
end
example (α) (a : α) :=
begin
haveI h := inhabited.mk a,
assert_frozen_instances,
exact default α
end
example (α) (a : α) :=
begin
letI h : inhabited α := ⟨a⟩,
assert_frozen_instances,
exact default α
end
example (α) (a : α) :=
begin
letI h : inhabited α,
all_goals { assert_frozen_instances },
exact ⟨a⟩,
exact default α
end
example (α) (a : α) :=
begin
letI h := inhabited.mk a,
exact default α
end
example (α) : inhabited α → α :=
by intro a; exactI default α
example (α) : inhabited α → α :=
begin
introsI a,
assert_frozen_instances,
exact default α
end
example (α β) (h : α = β) [inhabited α] : β :=
begin
substI h,
assert_frozen_instances,
exact default _
end
example (α β) (h : α = β) [inhabited α] : β :=
begin
unfreezingI { cases _inst_1 },
assert_frozen_instances,
subst h, assumption
end
example (α β) (h : α = β) [inhabited α] : β :=
begin
casesI _inst_1,
assert_frozen_instances,
subst h, assumption
end