The `conv` tactic tries to close “trivial” goals after itself. As of now, it uses `try rfl`, which means it can close goals that are only trivial after reducing with default transparency. This is suboptimal * this can require a fair amount of unfolding, and possibly slow down the proof a lot. And the user cannot even prevent it. * it does not match what `rw` does, and a user might expect the two to behave the same. So this PR changes it to `with_reducible rfl`, matching `rw`’s behavior. I considered `with_reducible eq_refl` to only solve trivial goals that involve equality, but not other relations (e.g. `Perm xs xs`), but a discussion on mathlib pointed out that it’s expected and desirable to solve more general reflexive goals: https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Closing.20after.20.60rw.60.2C.20.60conv.60.3A.20.60eq_refl.60.20instead.20of.20.60rfl.60/near/429851605
194 lines
3.2 KiB
Text
194 lines
3.2 KiB
Text
x y : Nat
|
|
| p (x + y) (y + x + 0)
|
|
x y : Nat
|
|
| x + y = y + x + 0
|
|
x y : Nat
|
|
| x + y = y + x + 0
|
|
x y : Nat
|
|
⊢ x + y = y.add x
|
|
case x
|
|
x y : Nat
|
|
⊢ x + y = y.add x
|
|
case a
|
|
a b : Nat
|
|
| foo (0 + a) (b + 0)
|
|
case a.x
|
|
a b : Nat
|
|
| 0 + a
|
|
|
|
case a.y
|
|
a b : Nat
|
|
| b + 0
|
|
a b : Nat
|
|
| a
|
|
case x
|
|
a b : Nat
|
|
| 0 + a
|
|
|
|
case y
|
|
a b : Nat
|
|
| b + 0
|
|
case x
|
|
a b : Nat
|
|
| 0 + a
|
|
case x
|
|
a b : Nat
|
|
| a
|
|
|
|
case y
|
|
a b : Nat
|
|
| b + 0
|
|
a b : Nat
|
|
| a + b
|
|
case x
|
|
a b : Nat
|
|
| a
|
|
|
|
case y
|
|
a b : Nat
|
|
| b
|
|
x y : Nat
|
|
⊢ x + y = y.add x
|
|
x y : Nat
|
|
⊢ x.add y = y.add x
|
|
x y : Nat
|
|
⊢ f x (x.add y) y = y + x
|
|
x y : Nat
|
|
| x + y
|
|
case h.h
|
|
a b : Nat
|
|
| 0 + a + b
|
|
case h.h
|
|
a b : Nat
|
|
| a + b
|
|
case h.h
|
|
a b : Nat
|
|
| 0 + a + b
|
|
p : Nat → Prop
|
|
h : ∀ (a : Nat), p a
|
|
x : Nat
|
|
| p (id (0 + x))
|
|
p : Nat → Prop
|
|
h : ∀ (a : Nat), p a
|
|
x : Nat
|
|
| id (0 + x)
|
|
p : Nat → Prop
|
|
h : ∀ (a : Nat), p a
|
|
x : Nat
|
|
| 0 + x
|
|
case h₁
|
|
p : Prop
|
|
x : Nat
|
|
| x = x → p
|
|
p : Prop
|
|
x : Nat
|
|
⊢ (True → p) → p
|
|
case h
|
|
x : Nat
|
|
| 0 + x
|
|
p : Prop
|
|
x : Nat
|
|
⊢ (True → p) → p
|
|
x y : Nat
|
|
f : Nat → Nat → Nat
|
|
g : Nat → Nat
|
|
h₁ : ∀ (z : Nat), f z z = z
|
|
h₂ : ∀ (x y : Nat), f (g x) (g y) = y
|
|
⊢ f (g y) (f (g x) (g (0 + x))) = x
|
|
x y : Nat
|
|
f : Nat → Nat → Nat
|
|
g : Nat → Nat
|
|
h₁ : ∀ (z : Nat), f z z = z
|
|
h₂ : ∀ (x y : Nat), f (g x) (g y) = y
|
|
⊢ f (g y) (f (g x) (g x)) = x
|
|
x y : Nat
|
|
h : y = 0
|
|
| y + x
|
|
p : Nat → Prop
|
|
x y : Nat
|
|
h1 : y = 0
|
|
h2 : p x
|
|
| y + x
|
|
j : Fin 5
|
|
p : (n : Nat) → Fin n → Prop
|
|
i : Fin 5
|
|
hp : p 5 i
|
|
hi : j = i
|
|
| j
|
|
p : {x : Nat} → Nat → Prop
|
|
x y : Nat
|
|
h1 : y = 0
|
|
h2 : p x
|
|
| y
|
|
p : {x : Nat} → Nat → Prop
|
|
x y : Nat
|
|
h1 : y = 0
|
|
h2 : p x
|
|
| y
|
|
conv1.lean:221:10-221:13: error: invalid 'lhs' conv tactic, application has only 1 (nondependent) argument(s)
|
|
conv1.lean:224:10-224:15: error: invalid 'arg' conv tactic, application has only 1 (nondependent) argument(s)
|
|
conv1.lean:227:10-227:13: error: invalid 'congr' conv tactic, application or implication expected
|
|
p
|
|
conv1.lean:230:10-230:15: error: cannot select argument
|
|
a✝ : Nat := 0
|
|
b✝ : Nat := a✝
|
|
| 0 = 0
|
|
x y z : Nat
|
|
| x + y + z
|
|
x y z : Nat
|
|
| x + y + z
|
|
|
|
x y z : Nat
|
|
| x + (y + z)
|
|
x y z : Nat
|
|
| x + y + z
|
|
|
|
x y z : Nat
|
|
| y + z
|
|
x y z : Nat
|
|
| y + z
|
|
|
|
x y z : Nat
|
|
| x + y + z
|
|
x y z : Nat
|
|
| x + y
|
|
|
|
x y z : Nat
|
|
| x + (y + z)
|
|
x y z : Nat
|
|
| x + y
|
|
|
|
x y z : Nat
|
|
| y + z
|
|
conv1.lean:248:58-248:83: error: 'pattern' conv tactic failed, pattern was found only 4 times but 5 expected
|
|
conv1.lean:249:58-249:85: error: 'pattern' conv tactic failed, pattern was found only 4 times but 5 expected
|
|
conv1.lean:250:58-250:85: error: 'pattern' conv tactic failed, pattern was found only 3 times but 5 expected
|
|
conv1.lean:251:58-251:87: error: 'pattern' conv tactic failed, pattern was found only 2 times but 5 expected
|
|
P Q : Nat → Nat → Nat → Prop
|
|
h : P = Q
|
|
h2 : Q 1 2 3
|
|
| P 1 2 3
|
|
P Q : Nat → Nat → Nat → Prop
|
|
h : P = Q
|
|
h2 : Q 1 2 3
|
|
| P 1 2
|
|
P Q : Nat → Nat → Nat → Prop
|
|
h : P = Q
|
|
h2 : Q 1 2 3
|
|
| P 1
|
|
P Q : Nat → Nat → Nat → Prop
|
|
h : P = Q
|
|
h2 : Q 1 2 3
|
|
| P
|
|
conv1.lean:275:10-275:13: error: invalid 'fun' conv tactic, application expected
|
|
p
|
|
P Q : Nat → Nat → Nat → Prop
|
|
h : P = Q
|
|
h2 : Q 1 2 3
|
|
| P 1 2 3
|
|
P Q : Nat → Nat → Nat → Prop
|
|
h : P = Q
|
|
h2 : Q 1 2 3
|
|
| P
|
|
conv1.lean:287:10-287:15: error: invalid 'arg 0' conv tactic, application expected
|
|
p
|