Remove maximal chain witness from FiniteHeightLattice
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -77,45 +77,24 @@ lemma boundedChains_of_subsingleton (α : Type*) [Preorder α] [Subsingleton α]
|
||||
|
||||
/-- A finite height lattice is a lattice in which all chains $a < \ldots < z$ have a maximum height `height`. -/
|
||||
class FiniteHeightLattice (α : Type*) extends Lattice α, OrderBot α, OrderTop α where
|
||||
longestChain : LTSeries α
|
||||
chains_bounded : BoundedChains α longestChain.length
|
||||
height : ℕ
|
||||
chains_bounded : BoundedChains α height
|
||||
|
||||
-- a < ... < z
|
||||
-- ----------- length <= height
|
||||
|
||||
namespace FiniteHeightLattice
|
||||
|
||||
def height (α : Type*) [FiniteHeightLattice α] : ℕ :=
|
||||
(longestChain (α := α)).length
|
||||
|
||||
variable (α : Type*) [FiniteHeightLattice α]
|
||||
|
||||
/-- Any maximum-length chain in a bounded finite-height lattice starts at `⊥`. -/
|
||||
lemma longestChain_head : (longestChain (α := α)).head = ⊥ := by
|
||||
by_contra hne
|
||||
have hbound := chains_bounded ((longestChain (α := α)).cons ⊥ (bot_lt_iff_ne_bot.mpr hne))
|
||||
rw [RelSeries.cons_length] at hbound
|
||||
omega
|
||||
|
||||
/-- Any maximum-length chain in a bounded finite-height lattice ends at `⊤`. -/
|
||||
lemma longestChain_last : (longestChain (α := α)).last = ⊤ := by
|
||||
by_contra hne
|
||||
have hbound := chains_bounded ((longestChain (α := α)).snoc ⊤ (lt_top_iff_ne_top.mpr hne))
|
||||
rw [RelSeries.snoc_length] at hbound
|
||||
omega
|
||||
|
||||
/-- This is something like a lemma about isomorphic types having the same height.
|
||||
Given a finite-height lattice `α`, lattice `β`, and a `Monotone` bijection
|
||||
between the two, we can show that lattice `β` also has a finite height.
|
||||
|
||||
The proof is fairly trivial: the longest chain in `α` can be transported
|
||||
to be a longest chain in `β` (by monotonicity), establishing a height witness.
|
||||
At the same time, any chain in `β` can be transported to a chain in `α`,
|
||||
The proof is fairly trivial: any chain in `β` can be transported to a chain in `α`,
|
||||
and must be bounded by the same height by `FiniteHeightLattice.chains_bounded`. -/
|
||||
def transport {α β : Type*} [Lattice β]
|
||||
[I : FiniteHeightLattice α] (f : α → β) (g : β → α)
|
||||
(hf : Monotone f) (hg : Monotone g)
|
||||
(hgf : Function.LeftInverse g f) (hfg : Function.LeftInverse f g) :
|
||||
(hfg : Function.LeftInverse f g) :
|
||||
FiniteHeightLattice β where
|
||||
toLattice := inferInstance
|
||||
toOrderBot := {
|
||||
@@ -128,8 +107,7 @@ def transport {α β : Type*} [Lattice β]
|
||||
le_top := fun b => by
|
||||
rw [← hfg b]
|
||||
exact hf (_root_.le_top : g b ≤ (⊤ : α)) }
|
||||
longestChain :=
|
||||
I.longestChain.map f (hf.strictMono_of_injective hgf.injective)
|
||||
height := I.height
|
||||
chains_bounded := fun c =>
|
||||
I.chains_bounded (c.map g (hg.strictMono_of_injective hfg.injective))
|
||||
|
||||
@@ -144,7 +122,7 @@ def ofUnique (α : Type*) [Lattice α] [Unique α] :
|
||||
toOrderTop := {
|
||||
top := default
|
||||
le_top := fun _ => le_of_eq (Subsingleton.elim _ _) }
|
||||
longestChain := RelSeries.singleton _ default
|
||||
height := 0
|
||||
chains_bounded := boundedChains_of_subsingleton α 0
|
||||
|
||||
end FiniteHeightLattice
|
||||
|
||||
Reference in New Issue
Block a user