Skip to content

Commit f024c71

Browse files
committed
Moved joinSingleT.restrict Theorem
1 parent 49c7c4b commit f024c71

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

RelationalAlgebra/RA/EquivRules.lean

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,6 @@ import RelationalAlgebra.RA.RelationalAlgebra
22

33
open RM
44

5-
/-- Each tuple is the join of itself and a restricted version of itself -/
6-
@[simp]
7-
theorem joinSingleT.restrict (t : α →. μ) {h : rs ⊆ t.Dom} :
8-
joinSingleT t (t.restrict h) t := by
9-
simp_all only [joinSingleT, Set.mem_union]
10-
intro a
11-
simp_all only [PFun.mem_dom, PFun.mem_restrict, exists_and_left, and_imp, forall_exists_index, implies_true,
12-
not_or, not_and, not_exists, true_and]
13-
apply And.intro
14-
· intro a_1 x h_1
15-
ext a_2 : 1
16-
simp_all only [PFun.mem_restrict, true_and]
17-
· intro a_1 a_2
18-
simp_all only [not_false_eq_true, implies_true]
19-
ext a_1 : 1
20-
simp_all only [Part.notMem_none]
21-
225
/-- Projection distributes over union -/
236
@[simp ←]
247
theorem projectionT_unionT {rs : Finset α} (ts1 ts2 : Set (α →. μ)) :

RelationalAlgebra/RA/RelationalAlgebra.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,23 @@ def joinDomSingleT {t t1 t2 : α →. μ} (h : joinSingleT t t1 t2) [DecidableEq
170170
| inr h_1 =>
171171
simp_all only [← PFun.mem_dom]
172172

173+
/-- Each tuple is the join of itself and a restricted version of itself -/
174+
@[simp]
175+
theorem joinSingleT.restrict (t : α →. μ) {h : rs ⊆ t.Dom} :
176+
joinSingleT t (t.restrict h) t := by
177+
simp_all only [joinSingleT, Set.mem_union]
178+
intro a
179+
simp_all only [PFun.mem_dom, PFun.mem_restrict, exists_and_left, and_imp, forall_exists_index, implies_true,
180+
not_or, not_and, not_exists, true_and]
181+
apply And.intro
182+
· intro a_1 x h_1
183+
ext a_2 : 1
184+
simp_all only [PFun.mem_restrict, true_and]
185+
· intro a_1 a_2
186+
simp_all only [not_false_eq_true, implies_true]
187+
ext a_1 : 1
188+
simp_all only [Part.notMem_none]
189+
173190
/--
174191
Join on `S₁ S₂ : Set` of tuples.
175192
Result: tuples which are the natural join of two arbitrary tuples in `inTuples1` and `inTuples2`

0 commit comments

Comments
 (0)