-
Definition - A type
T
is promise-Like iffT
has a callablethen
method that accepts a function as its first argument. -
Definition - The fulfillment type of
T
is the typeV
inT.then((value: V) ⇒> {})
. -
Definition - The promised type of
T
(nee.promised T
) is the promised type of the fulfillment type ofT
iffT
is promise-like; otherwise,T
. -
Definition - The constraint type
C
is the base constraint ofT
, such thatT <: C
.
- Given - There exists types
S₁
andT₁
such thatS₁ <: T₁
. - Given - There exists a type
T₂
such thatT₂ <: T₁
and¬(T₁ <: T₂)
. - Given - There exists a type
S₂
such thatS₂ <: S₁
and¬(S₁ <: S₂)
.
-
Lemma - If
S <: T
, thenpromised S <: promised T
.-
Proof - If
S := S₁
andT := T₁
, we have:S <: T ⇒ promised S <: promised T S₁ <: T₁ ⇒ promised S₁ <: promised T₁ (by instantiation) S₁ <: T₁ ⇒ S₁ <: T₁ (by Definition 3)
-
Proof - If
S := Promise<S₁>
andT := Promise<T₁>
, we have:S <: T ⇒ promised Promise<S> <: promised Promise<T> S₁ <: T₁ ⇒ promised Promise<S₁> <: promised Promise<T₁> (by instantiation) S₁ <: T₁ ⇒ S₁ <: T₁ (by Definition 3)
-
-
Lemma - IfS <: promised C
whereC
is the constraint type ofT
, thenS <: promised T
.-
Proof - IfS := S₁
,C := T₁
, andT := T₂
, we have:S <: promised C ⇒ S <: promised T S₁ <: promised T₁ ⇒ S₁ <: promised T₂ (by instantiation) S₁ <: T₁ ⇒ S₁ <: T₂ (by Definition 3)
- This is a contradiction as
¬(T₁ <: T₂)
, therefore we cannot prove thatS₁ <: T₂
.
- This is a contradiction as
-
Proof - IfS := S₁
,C := Promise<T₁>
, andT := Promise<T₂>
, we have:S <: promised C ⇒ S <: promised T S₁ <: promised Promise<T₁> ⇒ S₁ <: promised Promise<T₂> (by instantiation) S₁ <: T₁ ⇒ S₁ <: T₂ (by Definition 3)
- This is a contradiction as
¬(T₁ <: T₂)
, therefore we cannot prove thatS₁ <: T₂
.
- This is a contradiction as
-
-
Lemma - If
promised C <: T
whereC
is the constraint type ofS
, thenpromised S <: T
.-
Proof - If
C := S₁
,S := S₂
, andT := T₁
, we have:promised C <: T ⇒ promised S <: T promised S₁ <: T₁ ⇒ promised S₂ <: T₁ (by instantiation) S₁ <: T₁ ⇒ S₂ <: T₁ (by Definition 3) S₁ <: T₁ ⇒ S₁ <: T₁ (by transitive rule)
-
Proof - If
C := Promise<S₁>
,S := Promise<S₂>
, andT := T₁
, we have:promised C <: T ⇒ promised S <: T promised Promise<S₁> <: T₁ ⇒ promised Promise<S₂> <: T₁ (by instantiation) S₁ <: T₁ ⇒ S₂ <: T₁ (by Definition 3) S₁ <: T₁ ⇒ S₁ <: T₁ (by transitive rule)
-
After exploring this further, it seems that Lemma 2 is a fallacy.