为什么这个双偏序集定义不进行类型检查

Why doesn't this dual poset definition don't type check

我创建了以下偏序集定义,对偶定义不对反对称进行类型检查。我不确定如何让它工作,有什么建议吗?

structure Poset {α : Type} (leq : α → (α → Prop)) :=  mkPoset :: 
    (reflexive: (∀x : α, (leq x x))) 
    (antisymmetric : (∀x y : α, (leq x y) → (leq y x) → x = y))
    (transitive : (∀x y z: α, (leq x y) → (leq y z) → (leq x z)))

section Poset
    parameter α : Type
    parameter leq : α → α → Prop
    parameter poset: (Poset leq)

    def geq (x: α)(y: α) := leq y x


    def dual : Poset geq := Poset.mkPoset poset.reflexive (λx y: α, poset.antisymmetric y x) (λ x y z: α, poset.transitive z y x)
end Poset

我们来看看报错信息:

term
  λ (x y : α), poset.antisymmetric y x
has type
  ∀ (x y : α), leq y x → leq x y → y = x
but is expected to have type
  ∀ (x y : α), geq x y → geq y x → x = y

虽然假设在定义上是相等的,但结论并非如此。您必须在正确的位置应用 eq.symm

def dual : Poset geq :=
{ reflexive := poset.reflexive,
  antisymmetric := λ x y h₁ h₂, eq.symm (poset.antisymmetric y x h₁ h₂),
  -- note, this is not quite correct yet either
  transitive := λ x y z, poset.transitive z y x }