Skip to content

Commit bcaf929

Browse files
committed
Some small fixes for latest Lean version. Move set builder to separate file
1 parent e687f00 commit bcaf929

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
.lake
55
TODO.md
66
.vscode
7-
**/*/private_*.lean
7+
**/private_*.lean

Mathematics/Algebra/Group.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ theorem multiply.associative: ∀ a b c: T, a * (b * c) = (a * b) * c := Group.a
2525
theorem inv.double : (a⁻¹)⁻¹ = a := by
2626
rw [←multiply.one (a⁻¹)⁻¹, ←(Group.inverse a).left, Group.associativity, (Group.inverse _).left, one.multiply]
2727

28-
theorem one.inverse : (1⁻¹) = (1: T) := by
29-
rw [←multiply.one 1⁻¹, (Group.inverse 1).1]
28+
theorem one.inverse : (1⁻¹: T) = (1: T) := by
29+
rw [←multiply.one (1⁻¹: T), (Group.inverse 1).1]
3030

3131
theorem multiply.eq_one_implies_eq (h : a * b = 1) : a⁻¹ = b := by
3232
rw [←multiply.one a⁻¹, ←h, Group.associativity, (Group.inverse a).left, one.multiply]

Mathematics/Structures/Set.lean

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,3 @@ def Set.includes (z: Set A) (a: A) : Prop := z a
3737

3838
@[simp, reducible]
3939
instance { A: Type }: Membership A (Set A) := ⟨fun z a => z a⟩
40-
41-
-- syntax (name := emptyset) "s{}" : term
42-
-- syntax (name := set) "s{" term,+ "}" : term
43-
44-
-- macro_rules (kind := emptyset) | `(s{}) => `(Set.empty)
45-
46-
-- macro_rules (kind := set)
47-
-- | `(s{ $x }) => `(Set.singleton $x)
48-
-- | `(s{ $x, $xs,* }) => `(operators.Set.union (Set.singleton $x) (s{ $[$xs: term],* }))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Mathematics.Structures.Set
2+
import Mathematics.Structures.Set.Operations
3+
4+
syntax (name := emptyset) "s{}" : term
5+
syntax (name := set) "s{" term,+ "}" : term
6+
7+
macro_rules (kind := emptyset) | `(s{}) => `(Set.empty)
8+
9+
macro_rules (kind := set)
10+
| `(s{ $x }) => `(Set.singleton $x)
11+
| `(s{ $x, $xs,* }) => `(Set.union (Set.singleton $x) (s{ $[$xs: term],* }))
12+
13+
-- def first_three: Set Nat := s{1, 2, 3}

Mathematics/Structures/Set/Relations.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ variable { X: Type }
66
-- Non strict
77
@[reducible]
88
def Set.subset (s₁ s₂: Set X) : Prop := ∀ {a: X}, a ∈ s₁ → a ∈ s₂
9-
-- Non strict
109

1110
@[reducible]
1211
def Set.subset.strict (s₁ s₂: Set X) : Prop := s₁ ≠ s₂ ∧ Set.subset s₁ s₂

Mathematics/Structures/Set/Theorems.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ theorem singleton.includes (a b: A) : b ∈ Set.singleton a ↔ a = b := by
1919
intro h1
2020
exact h1 ▸ singleton.includes.self b
2121

22+
theorem singleton.eq (a b: A) : Set.singleton a = Set.singleton b ↔ a = b := by
23+
constructor
24+
intro h1
25+
rw [Set.extensionality] at h1
26+
exact (h1 a).mp (rfl)
27+
intro h2
28+
ext c
29+
rw [h2]
30+
2231
theorem empty.no_members' (a: A): a ∈ Set.empty A → False := by intro h1; contradiction
2332

2433
theorem empty.no_members : ¬(∃a, a ∈ Set.empty A) := fun ⟨a, p⟩ => empty.no_members' a p

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ Mathematics
1111
### About
1212

1313
Proofs can definitely be shorter and clearer. (feel free to PR)
14-

0 commit comments

Comments
 (0)