import Spa.Lattice namespace Spa /-- Agda: `TransportFiniteHeight.finiteHeightLattice`. Transport a `FiniteHeightLattice` structure along a monotone inverse pair `f : α → β`, `g : β → α`. -/ def FiniteHeightLattice.transport {α β : Type*} [Lattice α] [Lattice β] [I : FiniteHeightLattice α] (f : α → β) (g : β → α) (hf : Monotone f) (hg : Monotone g) (hgf : ∀ a, g (f a) = a) (hfg : ∀ b, f (g b) = b) : FiniteHeightLattice β where bot := f ⊥ top := f ⊤ height := I.height longest_chain := { series := I.longest_chain.series.map f (hf.strictMono_of_injective (Function.LeftInverse.injective hgf)) head_series := congrArg f I.longest_chain.head_series last_series := congrArg f I.longest_chain.last_series length_series := I.longest_chain.length_series } chains_bounded := fun c => I.chains_bounded (c.map g (hg.strictMono_of_injective (Function.LeftInverse.injective hfg))) end Spa