Documentation

Cedar.Thm.Validation.Typechecker.LUB

This file contains useful definitions and lemmas about the least upper bound (LUB) functions on Cedar types.

theorem Cedar.Thm.lubBool_comm {bty₁ bty₂ : Validation.BoolType} :
Validation.lubBool bty₁ bty₂ = Validation.lubBool bty₂ bty₁
@[irreducible]
theorem Cedar.Thm.lub_comm {ty₁ ty₂ : Validation.CedarType} :
(ty₁ ty₂) = (ty₂ ty₁)
@[irreducible]
theorem Cedar.Thm.lub_refl (ty : Validation.CedarType) :
(ty ty) = some ty
@[irreducible]
theorem Cedar.Thm.lub_trans {ty₁ ty₂ ty₃ : Validation.CedarType} :
(ty₁ ty₂) = some ty₂(ty₂ ty₃) = some ty₃ → (ty₁ ty₃) = some ty₃
@[irreducible]
theorem Cedar.Thm.lubRecordType_trans {rty₁ rty₂ rty₃ : List (Spec.Attr × Validation.QualifiedType)} :
Validation.lubRecordType rty₁ rty₂ = some rty₂Validation.lubRecordType rty₂ rty₃ = some rty₃Validation.lubRecordType rty₁ rty₃ = some rty₃
@[irreducible]
theorem Cedar.Thm.lubQualifiedType_trans {qty₁ qty₂ qty₃ : Validation.QualifiedType} :
Validation.lubQualifiedType qty₁ qty₂ = some qty₂Validation.lubQualifiedType qty₂ qty₃ = some qty₃Validation.lubQualifiedType qty₁ qty₃ = some qty₃
theorem Cedar.Thm.subty_trans {ty₁ ty₂ ty₃ : Validation.CedarType} :
(ty₁ ty₂) = true(ty₂ ty₃) = true → (ty₁ ty₃) = true
@[irreducible]
theorem Cedar.Thm.lub_left_subty {ty₁ ty₂ ty₃ : Validation.CedarType} :
(ty₁ ty₂) = some ty₃ → (ty₁ ty₃) = true
@[irreducible]
theorem Cedar.Thm.lubRecordType_left_subty {rty₁ rty₂ rty₃ : List (Spec.Attr × Validation.QualifiedType)} :
Validation.lubRecordType rty₁ rty₂ = some rty₃Validation.lubRecordType rty₁ rty₃ = some rty₃
@[irreducible]
theorem Cedar.Thm.lubQualifiedType_left_subty {qty₁ qty₂ qty₃ : Validation.QualifiedType} :
Validation.lubQualifiedType qty₁ qty₂ = some qty₃Validation.lubQualifiedType qty₁ qty₃ = some qty₃
theorem Cedar.Thm.lubBool_assoc_none_some {ty₁ ty₂ : Validation.CedarType} {bty₁ bty₂ : Validation.BoolType} (h₁ : (ty₁ Validation.CedarType.bool bty₁) = none) (h₂ : some (Validation.CedarType.bool (Validation.lubBool bty₁ bty₂)) = some ty₂) :
(ty₁ ty₂) = none
@[irreducible]
theorem Cedar.Thm.lub_assoc_none_some {ty₁ ty₂ ty₃ ty₄ : Validation.CedarType} (h₁ : (ty₁ ty₂) = none) (h₂ : (ty₂ ty₃) = some ty₄) :
(ty₁ ty₄) = none
@[irreducible]
theorem Cedar.Thm.lubRecordType_assoc_none_some {rty₁ rty₂ rty₃ rty₄ : List (Spec.Attr × Validation.QualifiedType)} (h₁ : Validation.lubRecordType rty₁ rty₂ = none) (h₂ : Validation.lubRecordType rty₂ rty₃ = some rty₄) :
@[irreducible]
theorem Cedar.Thm.lubQualifiedType_assoc_none_some {qty₁ qty₂ qty₃ qty₄ : Validation.QualifiedType} (h₁ : Validation.lubQualifiedType qty₁ qty₂ = none) (h₂ : Validation.lubQualifiedType qty₂ qty₃ = some qty₄) :
theorem Cedar.Thm.lubBool_assoc_some_some {ty₄ ty₅ : Validation.CedarType} {bty₁ bty₂ bty₃ : Validation.BoolType} (h₁ : Validation.CedarType.bool (Validation.lubBool bty₁ bty₂) = ty₄) (h₂ : Validation.CedarType.bool (Validation.lubBool bty₂ bty₃) = ty₅) :
@[irreducible]
theorem Cedar.Thm.lub_assoc_some_some {ty₁ ty₂ ty₃ ty₄ ty₅ : Validation.CedarType} (h₁ : (ty₁ ty₂) = some ty₄) (h₂ : (ty₂ ty₃) = some ty₅) :
(ty₄ ty₃) = (ty₁ ty₅)
@[irreducible]
theorem Cedar.Thm.lubRecordType_assoc_some_some {rty₁ rty₂ rty₃ rty₄ rty₅ : List (Spec.Attr × Validation.QualifiedType)} (h₁ : Validation.lubRecordType rty₁ rty₂ = some rty₄) (h₂ : Validation.lubRecordType rty₂ rty₃ = some rty₅) :
@[irreducible]
theorem Cedar.Thm.lubQualifiedType_assoc_some_some {qty₁ qty₂ qty₃ qty₄ qty₅ : Validation.QualifiedType} (h₁ : Validation.lubQualifiedType qty₁ qty₂ = some qty₄) (h₂ : Validation.lubQualifiedType qty₂ qty₃ = some qty₅) :
theorem Cedar.Thm.lub_assoc (ty₁ ty₂ ty₃ : Validation.CedarType) :
(do let ty₄ty₁ ty₂ ty₄ ty₃) = do let ty₄ty₂ ty₃ ty₁ ty₄
theorem Cedar.Thm.lub_lub_fixed {ty₁ ty₂ ty₃ ty₄ : Validation.CedarType} (h₁ : (ty₁ ty₂) = some ty₃) (h₂ : (ty₃ ty₄) = some ty₄) :
(ty₁ ty₄) = some ty₄
theorem Cedar.Thm.foldlM_of_lub_assoc (ty₁ ty₂ : Validation.CedarType) (tys : List Validation.CedarType) :
List.foldlM Validation.lub? ty₁ (ty₂ :: tys) = do let ty₃List.foldlM Validation.lub? ty₂ tys ty₁ ty₃