Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 98c62bd

Browse files
committed
feat(data/set/prod): add theorems about λ x, (x, x) (#15604)
From the sphere eversion project. Also swap LHS with RHS in `set.diagonal_eq_range` and rename it to `set.range_diag`. Co-authored-by: Oliver Nash <oliver.nash@gmail.com>
1 parent e52026f commit 98c62bd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/data/set/prod.lean

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,11 @@ end mono
299299

300300
end prod
301301

302-
/-! ### Diagonal -/
302+
/-! ### Diagonal
303+
304+
In this section we prove some lemmas about the diagonal set `{p | p.1 = p.2}` and the diagonal map
305+
`λ x, (x, x)`.
306+
-/
303307

304308
section diagonal
305309
variables {α : Type*} {s t : set α}
@@ -314,13 +318,17 @@ lemma mem_diagonal (x : α) : (x, x) ∈ diagonal α := by simp [diagonal]
314318
lemma preimage_coe_coe_diagonal (s : set α) : (prod.map coe coe) ⁻¹' (diagonal α) = diagonal s :=
315319
by { ext ⟨⟨x, hx⟩, ⟨y, hy⟩⟩, simp [set.diagonal] }
316320

317-
lemma diagonal_eq_range : diagonal α = range (λ x, (x, x)) :=
321+
@[simp] lemma range_diag : range (λ x, (x, x)) = diagonal α :=
318322
by { ext ⟨x, y⟩, simp [diagonal, eq_comm] }
319323

320324
@[simp] lemma prod_subset_compl_diagonal_iff_disjoint : s ×ˢ t ⊆ (diagonal α)ᶜ ↔ disjoint s t :=
321-
subset_compl_comm.trans $ by simp_rw [diagonal_eq_range, range_subset_iff,
325+
subset_compl_comm.trans $ by simp_rw [← range_diag, range_subset_iff,
322326
disjoint_left, mem_compl_iff, prod_mk_mem_set_prod_eq, not_and]
323327

328+
@[simp] lemma diag_preimage_prod (s t : set α) : (λ x, (x, x)) ⁻¹' (s ×ˢ t) = s ∩ t := rfl
329+
330+
lemma diag_preimage_prod_sellf (s : set α) : (λ x, (x, x)) ⁻¹' (s ×ˢ s) = s := inter_self s
331+
324332
end diagonal
325333

326334
/-! ### Cartesian set-indexed product of sets -/

0 commit comments

Comments
 (0)