|
| 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 |
0 commit comments