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

Commit 8e413eb

Browse files
awainversejcommelin
andcommitted
feat(order/bounded_lattice): define atoms, coatoms, and simple lattices (#5471)
Defines `is_atom`, `is_coatom`, and `is_simple_lattice` Refactors `ideal.is_maximal` to use `is_coatom`, the new definition is definitionally equal to the old one Co-authored-by: Johan Commelin <johan@commelin.net>
1 parent 15ff865 commit 8e413eb

File tree

4 files changed

+119
-2
lines changed

4 files changed

+119
-2
lines changed

src/order/atoms.lean

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/-
2+
Copyright (c) 2020 Aaron Anderson. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Author: Aaron Anderson.
5+
-/
6+
7+
import order.bounded_lattice
8+
import order.order_dual
9+
10+
/-!
11+
# Atoms, Coatoms, and Simple Lattices
12+
13+
This module defines atoms, which are minimal non-`⊥` elements in bounded lattices, simple lattices,
14+
which are lattices with only two elements, and related ideas.
15+
16+
## Main definitions
17+
* `is_atom a` indicates that the only element below `a` is `⊥`.
18+
* `is_coatom a` indicates that the only element above `a` is `⊤`.
19+
* `is_simple_lattice` indicates that a bounded lattice has only two elements, `⊥` and `⊤`.
20+
21+
-/
22+
23+
variable {α : Type*}
24+
25+
section atoms
26+
27+
section is_atom
28+
29+
variable [order_bot α]
30+
31+
/-- An atom of an `order_bot` is an element with no other element between it and `⊥`,
32+
which is not `⊥`. -/
33+
def is_atom (a : α) : Prop := a ≠ ⊥ ∧ (∀ b, b < a → b = ⊥)
34+
35+
lemma eq_bot_or_eq_of_le_atom {a b : α} (ha : is_atom a) (hab : b ≤ a) : b = ⊥ ∨ b = a :=
36+
or.imp_left (ha.2 b) (lt_or_eq_of_le hab)
37+
38+
end is_atom
39+
40+
section is_coatom
41+
42+
variable [order_top α]
43+
44+
/-- A coatom of an `order_top` is an element with no other element between it and `⊤`,
45+
which is not `⊤`. -/
46+
def is_coatom (a : α) : Prop := a ≠ ⊤ ∧ (∀ b, a < b → b = ⊤)
47+
48+
lemma eq_top_or_eq_of_coatom_le {a b : α} (ha : is_coatom a) (hab : a ≤ b) : b = ⊤ ∨ b = a :=
49+
or.imp (ha.2 b) eq_comm.2 (lt_or_eq_of_le hab)
50+
51+
end is_coatom
52+
53+
variables [bounded_lattice α] {a : α}
54+
55+
lemma is_atom_iff_is_coatom_dual : is_atom a ↔ is_coatom (order_dual.to_dual a) := iff.refl _
56+
57+
lemma is_coatom_iff_is_atom_dual : is_coatom a ↔ is_atom (order_dual.to_dual a) := iff.refl _
58+
59+
end atoms
60+
61+
/-- A lattice is simple iff it has only two elements, `⊥` and `⊤`. -/
62+
class is_simple_lattice (α : Type*) [bounded_lattice α] extends nontrivial α : Prop :=
63+
(eq_bot_or_eq_top : ∀ (a : α), a = ⊥ ∨ a = ⊤)
64+
65+
export is_simple_lattice (eq_bot_or_eq_top)
66+
67+
theorem is_simple_lattice_iff_is_simple_lattice_order_dual [bounded_lattice α] :
68+
is_simple_lattice α ↔ is_simple_lattice (order_dual α) :=
69+
begin
70+
split; intro i; haveI := i,
71+
{ exact { exists_pair_ne := @exists_pair_ne α _,
72+
eq_bot_or_eq_top := λ a, or.symm (eq_bot_or_eq_top ((order_dual.of_dual a)) : _ ∨ _) } },
73+
{ exact { exists_pair_ne := @exists_pair_ne (order_dual α) _,
74+
eq_bot_or_eq_top := λ a, or.symm (eq_bot_or_eq_top (order_dual.to_dual a)) } }
75+
end
76+
77+
section is_simple_lattice
78+
79+
variables [bounded_lattice α] [is_simple_lattice α]
80+
81+
instance : is_simple_lattice (order_dual α) :=
82+
is_simple_lattice_iff_is_simple_lattice_order_dual.1 (by apply_instance)
83+
84+
@[simp] lemma is_atom_top : is_atom (⊤ : α) :=
85+
⟨top_ne_bot, λ a ha, or.resolve_right (eq_bot_or_eq_top a) (ne_of_lt ha)⟩
86+
87+
@[simp] lemma is_coatom_bot : is_coatom (⊥ : α) := is_coatom_iff_is_atom_dual.2 is_atom_top
88+
89+
end is_simple_lattice
90+
91+
theorem is_simple_lattice_iff_is_atom_top [bounded_lattice α] :
92+
is_simple_lattice α ↔ is_atom (⊤ : α) :=
93+
⟨λ h, @is_atom_top _ _ h, λ h, {
94+
exists_pair_ne := ⟨⊤, ⊥, h.1⟩,
95+
eq_bot_or_eq_top := λ a, ((eq_or_lt_of_le (@le_top _ _ a)).imp_right (h.2 a)).symm }⟩
96+
97+
theorem is_simple_lattice_iff_is_coatom_bot [bounded_lattice α] :
98+
is_simple_lattice α ↔ is_coatom (⊥ : α) :=
99+
iff.trans is_simple_lattice_iff_is_simple_lattice_order_dual is_simple_lattice_iff_is_atom_top

src/order/bounded_lattice.lean

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Includes the Prop and fun instances.
1010
import order.lattice
1111
import data.option.basic
1212
import tactic.pi_instances
13+
import logic.nontrivial
1314

1415
set_option old_structure_cmd true
1516

@@ -1010,6 +1011,8 @@ end bounded_distrib_lattice
10101011

10111012
end disjoint
10121013

1014+
section is_compl
1015+
10131016
/-!
10141017
### `is_compl` predicate
10151018
-/
@@ -1100,3 +1103,16 @@ is_compl.of_eq bot_inf_eq sup_top_eq
11001103

11011104
lemma is_compl_top_bot [bounded_lattice α] : is_compl (⊤ : α) ⊥ :=
11021105
is_compl.of_eq inf_bot_eq top_sup_eq
1106+
1107+
end is_compl
1108+
1109+
section nontrivial
1110+
1111+
variables [bounded_lattice α] [nontrivial α]
1112+
1113+
lemma bot_ne_top : (⊥ : α) ≠ ⊤ :=
1114+
λ H, not_nontrivial_iff_subsingleton.mpr (subsingleton_of_bot_eq_top H) ‹_›
1115+
1116+
lemma top_ne_bot : (⊤ : α) ≠ ⊥ := ne.symm bot_ne_top
1117+
1118+
end nontrivial

src/order/order_dual.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ variables {α : Type u} {β : Type v} {γ : Type w} {r : α → α → Prop}
2424

2525
namespace order_dual
2626

27+
instance [nontrivial α] : nontrivial (order_dual α) := by delta order_dual; assumption
28+
2729
/-- `to_dual` is the identity function to the `order_dual` of a linear order. -/
2830
def to_dual : α ≃ order_dual α := ⟨id, id, λ h, rfl, λ h, rfl⟩
2931

src/ring_theory/ideal/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Kenny Lau, Chris Hughes, Mario Carneiro
66
import algebra.associated
77
import linear_algebra.basic
88
import order.zorn
9+
import order.atoms
910
/-!
1011
1112
# Ideals over a ring
@@ -197,8 +198,7 @@ lemma bot_prime {R : Type*} [integral_domain R] : (⊥ : ideal R).is_prime :=
197198
λ x y h, mul_eq_zero.mp (by simpa only [submodule.mem_bot] using h)⟩
198199

199200
/-- An ideal is maximal if it is maximal in the collection of proper ideals. -/
200-
@[class] def is_maximal (I : ideal α) : Prop :=
201-
I ≠ ⊤ ∧ ∀ J, I < J → J = ⊤
201+
@[class] def is_maximal (I : ideal α) : Prop := is_coatom I
202202

203203
theorem is_maximal_iff {I : ideal α} : I.is_maximal ↔
204204
(1:α) ∉ I ∧ ∀ (J : ideal α) x, I ≤ J → x ∉ I → x ∈ J → (1:α) ∈ J :=

0 commit comments

Comments
 (0)