Skip to content

Commit ff8ab57

Browse files
committed
test: test for set equivalence
1 parent d047eb7 commit ff8ab57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

GrwTest/SetEq.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import Grw.Tactic
2+
import Grw.Attribute
23

34
set_option trace.Meta.Tactic.grewrite true
45

5-
def setEq : List α → List α → Prop :=
6+
def setEq {α : Type} : List α → List α → Prop :=
67
fun l1 l2 => ∀ x, x ∈ l1 <-> x ∈ l2
78

89
instance setEqEquivalence {α : Type} : Equivalence (@setEq α) where
@@ -30,7 +31,7 @@ instance setEqEquivalence {α : Type} : Equivalence (@setEq α) where
3031
def addElem {α : Type} (x : α) (l : List α) : List α :=
3132
x :: l
3233

33-
@[grewrite]
34+
@[grw]
3435
theorem addElemProper {α : Type} (x : α) : @Proper (List α → List α) (setEq ⟹ setEq) (addElem x) := by
3536
constructor
3637
unfold respectful
@@ -50,4 +51,6 @@ theorem addElemProper {α : Type} (x : α) : @Proper (List α → List α) (setE
5051
theorem rewriteExample : setEq [1,2,3] [3,2,1] → setEq (addElem 4 [1,2,3]) (addElem 4 [3,2,1]) := by
5152
intro h
5253
grewrite [h]
54+
unfold setEq
55+
simp
5356
repeat sorry

0 commit comments

Comments
 (0)