Documentation

Mathlib.Data.Seq.Computation

Coinductive formalization of unbounded computations. #

This file provides a Computation type where Computation α is the type of unbounded computations returning α.

def Computation (α : Type u) :

Computation α is the type of unbounded computations returning α. An element of Computation α is an infinite sequence of Option α such that if f n = some a for some n then it is constantly some a after that.

Equations
def Computation.pure {α : Type u} (a : α) :

pure a is the computation that immediately terminates with result a.

Equations
def Computation.think {α : Type u} (c : Computation α) :

think c is the computation that delays for one "tick" and then performs computation c.

Equations
def Computation.thinkN {α : Type u} (c : Computation α) :

thinkN c n is the computation that delays for n ticks and then performs computation c.

Equations
def Computation.head {α : Type u} (c : Computation α) :

head c is the first step of computation, either some a if c = pure a or none if c = think c'.

Equations
def Computation.tail {α : Type u} (c : Computation α) :

tail c is the remainder of computation, either c if c = pure a or c' if c = think c'.

Equations

empty α is the computation that never returns, an infinite sequence of thinks.

Equations
def Computation.runFor {α : Type u} :
Computation αOption α

runFor c n evaluates c for n steps and returns the result, or none if it did not terminate after n steps.

Equations
def Computation.destruct {α : Type u} (c : Computation α) :

destruct c is the destructor for Computation α as a coinductive type. It returns inl a if c = pure a and inr c' if c = think c'.

Equations
unsafe def Computation.run {α : Type u} :
Computation αα

run c is an unsound meta function that runs c to completion, possibly resulting in an infinite loop in the VM.

Equations
theorem Computation.destruct_eq_pure {α : Type u} {s : Computation α} {a : α} :
s.destruct = Sum.inl as = pure a
theorem Computation.destruct_eq_think {α : Type u} {s s' : Computation α} :
s.destruct = Sum.inr s's = s'.think
@[simp]
theorem Computation.destruct_pure {α : Type u} (a : α) :
@[simp]
@[simp]
theorem Computation.head_pure {α : Type u} (a : α) :
(pure a).head = some a
@[simp]
theorem Computation.head_think {α : Type u} (s : Computation α) :
@[simp]
theorem Computation.head_empty {α : Type u} :
@[simp]
theorem Computation.tail_pure {α : Type u} (a : α) :
(pure a).tail = pure a
@[simp]
theorem Computation.tail_think {α : Type u} (s : Computation α) :
@[simp]
theorem Computation.tail_empty {α : Type u} :
(empty α).tail = empty α
def Computation.recOn {α : Type u} {C : Computation αSort v} (s : Computation α) (h1 : (a : α) → C (pure a)) (h2 : (s : Computation α) → C s.think) :
C s

Recursion principle for computations, compare with List.recOn.

Equations
def Computation.Corec.f {α : Type u} {β : Type v} (f : βα β) :
α βOption α × (α β)

Corecursor constructor for corec

Equations
def Computation.corec {α : Type u} {β : Type v} (f : βα β) (b : β) :

corec f b is the corecursor for Computation α as a coinductive type. If f b = inl a then corec f b = pure a, and if f b = inl b' then corec f b = think (corec f b').

Equations
def Computation.lmap {α : Type u} {β : Type v} {γ : Type w} (f : αβ) :
α γβ γ

left map of

Equations
def Computation.rmap {α : Type u} {β : Type v} {γ : Type w} (f : βγ) :
α βα γ

right map of

Equations
@[simp]
theorem Computation.corec_eq {α : Type u} {β : Type v} (f : βα β) (b : β) :
(corec f b).destruct = rmap (corec f) (f b)
def Computation.BisimO {α : Type u} (R : Computation αComputation αProp) :
α Computation αα Computation αProp

Bisimilarity over a sum of Computations

Equations

Attribute expressing bisimilarity over two Computations

Equations
theorem Computation.eq_of_bisim {α : Type u} (R : Computation αComputation αProp) (bisim : IsBisimulation R) {s₁ s₂ : Computation α} (r : R s₁ s₂) :
s₁ = s₂
def Computation.Mem {α : Type u} (s : Computation α) (a : α) :

Assertion that a Computation limits to a given value

Equations
theorem Computation.le_stable {α : Type u} (s : Computation α) {a : α} {m n : } (h : m n) :
s m = some as n = some a
theorem Computation.mem_unique {α : Type u} {s : Computation α} {a b : α} :
a sb sa = b
theorem Computation.Mem.left_unique {α : Type u} :
Relator.LeftUnique fun (x1 : α) (x2 : Computation α) => x1 x2
class Computation.Terminates {α : Type u} (s : Computation α) :

Terminates s asserts that the computation s eventually terminates with some value.

Instances
    theorem Computation.terminates_of_mem {α : Type u} {s : Computation α} {a : α} (h : a s) :
    theorem Computation.ret_mem {α : Type u} (a : α) :
    a pure a
    theorem Computation.eq_of_pure_mem {α : Type u} {a a' : α} (h : a' pure a) :
    a' = a
    @[simp]
    theorem Computation.mem_pure_iff {α : Type u} (a b : α) :
    a pure b a = b
    instance Computation.ret_terminates {α : Type u} (a : α) :
    theorem Computation.think_mem {α : Type u} {s : Computation α} {a : α} :
    a sa s.think
    theorem Computation.of_think_mem {α : Type u} {s : Computation α} {a : α} :
    a s.thinka s
    theorem Computation.notMem_empty {α : Type u} (a : α) :
    @[deprecated Computation.notMem_empty (since := "2025-05-23")]
    theorem Computation.not_mem_empty {α : Type u} (a : α) :

    Alias of Computation.notMem_empty.

    theorem Computation.thinkN_mem {α : Type u} {s : Computation α} {a : α} (n : ) :
    a s.thinkN n a s
    def Computation.Promises {α : Type u} (s : Computation α) (a : α) :

    Promises s a, or s ~> a, asserts that although the computation s may not terminate, if it does, then the result is a.

    Equations

    Promises s a, or s ~> a, asserts that although the computation s may not terminate, if it does, then the result is a.

    Equations
    theorem Computation.mem_promises {α : Type u} {s : Computation α} {a : α} :
    a ss.Promises a
    theorem Computation.empty_promises {α : Type u} (a : α) :
    def Computation.length {α : Type u} (s : Computation α) [h : s.Terminates] :

    length s gets the number of steps of a terminating computation

    Equations
    def Computation.get {α : Type u} (s : Computation α) [h : s.Terminates] :
    α

    get s returns the result of a terminating computation

    Equations
    theorem Computation.get_mem {α : Type u} (s : Computation α) [h : s.Terminates] :
    s.get s
    theorem Computation.get_eq_of_mem {α : Type u} (s : Computation α) [h : s.Terminates] {a : α} :
    a ss.get = a
    theorem Computation.mem_of_get_eq {α : Type u} (s : Computation α) [h : s.Terminates] {a : α} :
    s.get = aa s
    @[simp]
    theorem Computation.get_think {α : Type u} (s : Computation α) [h : s.Terminates] :
    @[simp]
    theorem Computation.get_thinkN {α : Type u} (s : Computation α) [h : s.Terminates] (n : ) :
    (s.thinkN n).get = s.get
    theorem Computation.get_promises {α : Type u} (s : Computation α) [h : s.Terminates] :
    theorem Computation.mem_of_promises {α : Type u} (s : Computation α) [h : s.Terminates] {a : α} (p : s.Promises a) :
    a s
    theorem Computation.get_eq_of_promises {α : Type u} (s : Computation α) [h : s.Terminates] {a : α} :
    s.Promises as.get = a
    def Computation.Results {α : Type u} (s : Computation α) (a : α) (n : ) :

    Results s a n completely characterizes a terminating computation: it asserts that s terminates after exactly n steps, with result a.

    Equations
    theorem Computation.results_of_terminates' {α : Type u} (s : Computation α) [T : s.Terminates] {a : α} (h : a s) :
    theorem Computation.Results.mem {α : Type u} {s : Computation α} {a : α} {n : } :
    s.Results a na s
    theorem Computation.Results.terminates {α : Type u} {s : Computation α} {a : α} {n : } (h : s.Results a n) :
    theorem Computation.Results.length {α : Type u} {s : Computation α} {a : α} {n : } [_T : s.Terminates] :
    s.Results a ns.length = n
    theorem Computation.Results.val_unique {α : Type u} {s : Computation α} {a b : α} {m n : } (h1 : s.Results a m) (h2 : s.Results b n) :
    a = b
    theorem Computation.Results.len_unique {α : Type u} {s : Computation α} {a b : α} {m n : } (h1 : s.Results a m) (h2 : s.Results b n) :
    m = n
    theorem Computation.exists_results_of_mem {α : Type u} {s : Computation α} {a : α} (h : a s) :
    @[simp]
    theorem Computation.get_pure {α : Type u} (a : α) :
    (pure a).get = a
    @[simp]
    theorem Computation.length_pure {α : Type u} (a : α) :
    (pure a).length = 0
    theorem Computation.results_pure {α : Type u} (a : α) :
    (pure a).Results a 0
    @[simp]
    theorem Computation.length_think {α : Type u} (s : Computation α) [h : s.Terminates] :
    theorem Computation.results_think {α : Type u} {s : Computation α} {a : α} {n : } (h : s.Results a n) :
    s.think.Results a (n + 1)
    theorem Computation.of_results_think {α : Type u} {s : Computation α} {a : α} {n : } (h : s.think.Results a n) :
    (m : ), s.Results a m n = m + 1
    @[simp]
    theorem Computation.results_think_iff {α : Type u} {s : Computation α} {a : α} {n : } :
    s.think.Results a (n + 1) s.Results a n
    theorem Computation.results_thinkN {α : Type u} {s : Computation α} {a : α} {m : } (n : ) :
    s.Results a m(s.thinkN n).Results a (m + n)
    theorem Computation.results_thinkN_pure {α : Type u} (a : α) (n : ) :
    ((pure a).thinkN n).Results a n
    @[simp]
    theorem Computation.length_thinkN {α : Type u} (s : Computation α) [_h : s.Terminates] (n : ) :
    (s.thinkN n).length = s.length + n
    theorem Computation.eq_thinkN {α : Type u} {s : Computation α} {a : α} {n : } (h : s.Results a n) :
    s = (pure a).thinkN n
    theorem Computation.eq_thinkN' {α : Type u} (s : Computation α) [_h : s.Terminates] :
    def Computation.memRecOn {α : Type u} {C : Computation αSort v} {a : α} {s : Computation α} (M : a s) (h1 : C (pure a)) (h2 : (s : Computation α) → C sC s.think) :
    C s

    Recursor based on membership

    Equations
    def Computation.terminatesRecOn {α : Type u} {C : Computation αSort v} (s : Computation α) [s.Terminates] (h1 : (a : α) → C (pure a)) (h2 : (s : Computation α) → C sC s.think) :
    C s

    Recursor based on assertion of Terminates

    Equations
    def Computation.map {α : Type u} {β : Type v} (f : αβ) :

    Map a function on the result of a computation.

    Equations
    def Computation.Bind.f {α : Type u} {β : Type v} (f : αComputation β) :

    bind over a function mapping α to a Computation

    Equations
    def Computation.bind {α : Type u} {β : Type v} (c : Computation α) (f : αComputation β) :

    Compose two computations into a monadic bind operation.

    Equations
    theorem Computation.has_bind_eq_bind {α β : Type u} (c : Computation α) (f : αComputation β) :
    c >>= f = c.bind f

    Flatten a computation of computations into a single computation.

    Equations
    @[simp]
    theorem Computation.map_pure {α : Type u} {β : Type v} (f : αβ) (a : α) :
    map f (pure a) = pure (f a)
    @[simp]
    theorem Computation.map_think {α : Type u} {β : Type v} (f : αβ) (s : Computation α) :
    map f s.think = (map f s).think
    @[simp]
    theorem Computation.destruct_map {α : Type u} {β : Type v} (f : αβ) (s : Computation α) :
    (map f s).destruct = lmap f (rmap (map f) s.destruct)
    @[simp]
    theorem Computation.map_id {α : Type u} (s : Computation α) :
    map id s = s
    theorem Computation.map_comp {α : Type u} {β : Type v} {γ : Type w} (f : αβ) (g : βγ) (s : Computation α) :
    map (g f) s = map g (map f s)
    @[simp]
    theorem Computation.ret_bind {α : Type u} {β : Type v} (a : α) (f : αComputation β) :
    (pure a).bind f = f a
    @[simp]
    theorem Computation.think_bind {α : Type u} {β : Type v} (c : Computation α) (f : αComputation β) :
    c.think.bind f = (c.bind f).think
    @[simp]
    theorem Computation.bind_pure {α : Type u} {β : Type v} (f : αβ) (s : Computation α) :
    s.bind (pure f) = map f s
    @[simp]
    theorem Computation.bind_pure' {α : Type u} (s : Computation α) :
    s.bind pure = s
    @[simp]
    theorem Computation.bind_assoc {α : Type u} {β : Type v} {γ : Type w} (s : Computation α) (f : αComputation β) (g : βComputation γ) :
    (s.bind f).bind g = s.bind fun (x : α) => (f x).bind g
    theorem Computation.results_bind {α : Type u} {β : Type v} {s : Computation α} {f : αComputation β} {a : α} {b : β} {m n : } (h1 : s.Results a m) (h2 : (f a).Results b n) :
    (s.bind f).Results b (n + m)
    theorem Computation.mem_bind {α : Type u} {β : Type v} {s : Computation α} {f : αComputation β} {a : α} {b : β} (h1 : a s) (h2 : b f a) :
    b s.bind f
    instance Computation.terminates_bind {α : Type u} {β : Type v} (s : Computation α) (f : αComputation β) [s.Terminates] [(f s.get).Terminates] :
    @[simp]
    theorem Computation.get_bind {α : Type u} {β : Type v} (s : Computation α) (f : αComputation β) [s.Terminates] [(f s.get).Terminates] :
    (s.bind f).get = (f s.get).get
    @[simp]
    theorem Computation.length_bind {α : Type u} {β : Type v} (s : Computation α) (f : αComputation β) [_T1 : s.Terminates] [_T2 : (f s.get).Terminates] :
    (s.bind f).length = (f s.get).length + s.length
    theorem Computation.of_results_bind {α : Type u} {β : Type v} {s : Computation α} {f : αComputation β} {b : β} {k : } :
    (s.bind f).Results b k (a : α), (m : ), (n : ), s.Results a m (f a).Results b n k = n + m
    theorem Computation.exists_of_mem_bind {α : Type u} {β : Type v} {s : Computation α} {f : αComputation β} {b : β} (h : b s.bind f) :
    (a : α), a s b f a
    theorem Computation.bind_promises {α : Type u} {β : Type v} {s : Computation α} {f : αComputation β} {a : α} {b : β} (h1 : s.Promises a) (h2 : (f a).Promises b) :
    (s.bind f).Promises b
    Equations
    • One or more equations did not get rendered due to their size.
    theorem Computation.has_map_eq_map {α β : Type u} (f : αβ) (c : Computation α) :
    f <$> c = map f c
    @[simp]
    theorem Computation.pure_def {α : Type u} (a : α) :
    @[simp]
    theorem Computation.map_pure' {α β : Type u_1} (f : αβ) (a : α) :
    f <$> pure a = pure (f a)
    @[simp]
    theorem Computation.map_think' {α β : Type u_1} (f : αβ) (s : Computation α) :
    f <$> s.think = (f <$> s).think
    theorem Computation.mem_map {α : Type u} {β : Type v} (f : αβ) {a : α} {s : Computation α} (m : a s) :
    f a map f s
    theorem Computation.exists_of_mem_map {α : Type u} {β : Type v} {f : αβ} {b : β} {s : Computation α} (h : b map f s) :
    (a : α), a s f a = b
    instance Computation.terminates_map {α : Type u} {β : Type v} (f : αβ) (s : Computation α) [s.Terminates] :
    theorem Computation.terminates_map_iff {α : Type u} {β : Type v} (f : αβ) (s : Computation α) :
    def Computation.orElse {α : Type u} (c₁ : Computation α) (c₂ : UnitComputation α) :

    c₁ <|> c₂ calculates c₁ and c₂ simultaneously, returning the first one that gives a result.

    Equations
    • One or more equations did not get rendered due to their size.
    @[simp]
    theorem Computation.ret_orElse {α : Type u} (a : α) (c₂ : Computation α) :
    (pure a <|> c₂) = pure a
    @[simp]
    theorem Computation.orElse_pure {α : Type u} (c₁ : Computation α) (a : α) :
    (c₁.think <|> pure a) = pure a
    @[simp]
    theorem Computation.orElse_think {α : Type u} (c₁ c₂ : Computation α) :
    (c₁.think <|> c₂.think) = (c₁ <|> c₂).think
    @[simp]
    theorem Computation.empty_orElse {α : Type u} (c : Computation α) :
    (empty α <|> c) = c
    @[simp]
    theorem Computation.orElse_empty {α : Type u} (c : Computation α) :
    (c <|> empty α) = c
    def Computation.Equiv {α : Type u} (c₁ c₂ : Computation α) :

    c₁ ~ c₂ asserts that c₁ and c₂ either both terminate with the same result, or both loop forever.

    Equations

    equivalence relation for computations

    Equations
    theorem Computation.Equiv.refl {α : Type u} (s : Computation α) :
    s.Equiv s
    theorem Computation.Equiv.symm {α : Type u} {s t : Computation α} :
    s.Equiv tt.Equiv s
    theorem Computation.Equiv.trans {α : Type u} {s t u : Computation α} :
    s.Equiv tt.Equiv us.Equiv u
    theorem Computation.equiv_of_mem {α : Type u} {s t : Computation α} {a : α} (h1 : a s) (h2 : a t) :
    s.Equiv t
    theorem Computation.terminates_congr {α : Type u} {c₁ c₂ : Computation α} (h : c₁.Equiv c₂) :
    theorem Computation.promises_congr {α : Type u} {c₁ c₂ : Computation α} (h : c₁.Equiv c₂) (a : α) :
    c₁.Promises a c₂.Promises a
    theorem Computation.get_equiv {α : Type u} {c₁ c₂ : Computation α} (h : c₁.Equiv c₂) [c₁.Terminates] [c₂.Terminates] :
    c₁.get = c₂.get
    theorem Computation.thinkN_equiv {α : Type u} (s : Computation α) (n : ) :
    (s.thinkN n).Equiv s
    theorem Computation.bind_congr {α : Type u} {β : Type v} {s1 s2 : Computation α} {f1 f2 : αComputation β} (h1 : s1.Equiv s2) (h2 : ∀ (a : α), (f1 a).Equiv (f2 a)) :
    (s1.bind f1).Equiv (s2.bind f2)
    theorem Computation.equiv_pure_of_mem {α : Type u} {s : Computation α} {a : α} (h : a s) :
    s.Equiv (pure a)
    def Computation.LiftRel {α : Type u} {β : Type v} (R : αβProp) (ca : Computation α) (cb : Computation β) :

    LiftRel R ca cb is a generalization of Equiv to relations other than equality. It asserts that if ca terminates with a, then cb terminates with some b such that R a b, and if cb terminates with b then ca terminates with some a such that R a b.

    Equations
    theorem Computation.LiftRel.swap {α : Type u} {β : Type v} (R : αβProp) (ca : Computation α) (cb : Computation β) :
    LiftRel (Function.swap R) cb ca LiftRel R ca cb
    theorem Computation.lift_eq_iff_equiv {α : Type u} (c₁ c₂ : Computation α) :
    LiftRel (fun (x1 x2 : α) => x1 = x2) c₁ c₂ c₁.Equiv c₂
    theorem Computation.LiftRel.refl {α : Type u} (R : ααProp) (H : Reflexive R) :
    theorem Computation.LiftRel.symm {α : Type u} (R : ααProp) (H : Symmetric R) :
    theorem Computation.LiftRel.trans {α : Type u} (R : ααProp) (H : Transitive R) :
    theorem Computation.LiftRel.equiv {α : Type u} (R : ααProp) :
    theorem Computation.LiftRel.imp {α : Type u} {β : Type v} {R S : αβProp} (H : ∀ {a : α} {b : β}, R a bS a b) (s : Computation α) (t : Computation β) :
    LiftRel R s tLiftRel S s t
    theorem Computation.terminates_of_liftRel {α : Type u} {β : Type v} {R : αβProp} {s : Computation α} {t : Computation β} :
    theorem Computation.rel_of_liftRel {α : Type u} {β : Type v} {R : αβProp} {ca : Computation α} {cb : Computation β} :
    LiftRel R ca cb∀ {a : α} {b : β}, a cab cbR a b
    theorem Computation.liftRel_of_mem {α : Type u} {β : Type v} {R : αβProp} {a : α} {b : β} {ca : Computation α} {cb : Computation β} (ma : a ca) (mb : b cb) (ab : R a b) :
    LiftRel R ca cb
    theorem Computation.exists_of_liftRel_left {α : Type u} {β : Type v} {R : αβProp} {ca : Computation α} {cb : Computation β} (H : LiftRel R ca cb) {a : α} (h : a ca) :
    (b : β), b cb R a b
    theorem Computation.exists_of_liftRel_right {α : Type u} {β : Type v} {R : αβProp} {ca : Computation α} {cb : Computation β} (H : LiftRel R ca cb) {b : β} (h : b cb) :
    (a : α), a ca R a b
    theorem Computation.liftRel_def {α : Type u} {β : Type v} {R : αβProp} {ca : Computation α} {cb : Computation β} :
    LiftRel R ca cb (ca.Terminates cb.Terminates) ∀ {a : α} {b : β}, a cab cbR a b
    theorem Computation.liftRel_bind {α : Type u} {β : Type v} {γ : Type w} {δ : Type u_1} (R : αβProp) (S : γδProp) {s1 : Computation α} {s2 : Computation β} {f1 : αComputation γ} {f2 : βComputation δ} (h1 : LiftRel R s1 s2) (h2 : ∀ {a : α} {b : β}, R a bLiftRel S (f1 a) (f2 b)) :
    LiftRel S (s1.bind f1) (s2.bind f2)
    @[simp]
    theorem Computation.liftRel_pure_left {α : Type u} {β : Type v} (R : αβProp) (a : α) (cb : Computation β) :
    LiftRel R (pure a) cb (b : β), b cb R a b
    @[simp]
    theorem Computation.liftRel_pure_right {α : Type u} {β : Type v} (R : αβProp) (ca : Computation α) (b : β) :
    LiftRel R ca (pure b) (a : α), a ca R a b
    theorem Computation.liftRel_pure {α : Type u} {β : Type v} (R : αβProp) (a : α) (b : β) :
    LiftRel R (pure a) (pure b) R a b
    @[simp]
    theorem Computation.liftRel_think_left {α : Type u} {β : Type v} (R : αβProp) (ca : Computation α) (cb : Computation β) :
    LiftRel R ca.think cb LiftRel R ca cb
    @[simp]
    theorem Computation.liftRel_think_right {α : Type u} {β : Type v} (R : αβProp) (ca : Computation α) (cb : Computation β) :
    LiftRel R ca cb.think LiftRel R ca cb
    theorem Computation.liftRel_mem_cases {α : Type u} {β : Type v} {R : αβProp} {ca : Computation α} {cb : Computation β} (Ha : ∀ (a : α), a caLiftRel R ca cb) (Hb : ∀ (b : β), b cbLiftRel R ca cb) :
    LiftRel R ca cb
    theorem Computation.liftRel_congr {α : Type u} {β : Type v} {R : αβProp} {ca ca' : Computation α} {cb cb' : Computation β} (ha : ca.Equiv ca') (hb : cb.Equiv cb') :
    LiftRel R ca cb LiftRel R ca' cb'
    theorem Computation.liftRel_map {α : Type u} {β : Type v} {γ : Type w} {δ : Type u_1} (R : αβProp) (S : γδProp) {s1 : Computation α} {s2 : Computation β} {f1 : αγ} {f2 : βδ} (h1 : LiftRel R s1 s2) (h2 : ∀ {a : α} {b : β}, R a bS (f1 a) (f2 b)) :
    LiftRel S (map f1 s1) (map f2 s2)
    theorem Computation.map_congr {α : Type u} {β : Type v} {s1 s2 : Computation α} {f : αβ} (h1 : s1.Equiv s2) :
    (map f s1).Equiv (map f s2)
    def Computation.LiftRelAux {α : Type u} {β : Type v} (R : αβProp) (C : Computation αComputation βProp) :
    α Computation αβ Computation βProp

    Alternate definition of LiftRel over relations between Computations

    Equations
    @[simp]
    theorem Computation.liftRelAux_inl_inl {α : Type u} {β : Type v} {R : αβProp} {C : Computation αComputation βProp} {a : α} {b : β} :
    LiftRelAux R C (Sum.inl a) (Sum.inl b) = R a b
    @[simp]
    theorem Computation.liftRelAux_inl_inr {α : Type u} {β : Type v} {R : αβProp} {C : Computation αComputation βProp} {a : α} {cb : Computation β} :
    LiftRelAux R C (Sum.inl a) (Sum.inr cb) = (b : β), b cb R a b
    @[simp]
    theorem Computation.liftRelAux_inr_inl {α : Type u} {β : Type v} {R : αβProp} {C : Computation αComputation βProp} {b : β} {ca : Computation α} :
    LiftRelAux R C (Sum.inr ca) (Sum.inl b) = (a : α), a ca R a b
    @[simp]
    theorem Computation.liftRelAux_inr_inr {α : Type u} {β : Type v} {R : αβProp} {C : Computation αComputation βProp} {ca : Computation α} {cb : Computation β} :
    LiftRelAux R C (Sum.inr ca) (Sum.inr cb) = C ca cb
    @[simp]
    theorem Computation.LiftRelAux.ret_left {α : Type u} {β : Type v} (R : αβProp) (C : Computation αComputation βProp) (a : α) (cb : Computation β) :
    LiftRelAux R C (Sum.inl a) cb.destruct (b : β), b cb R a b
    theorem Computation.LiftRelAux.swap {α : Type u} {β : Type v} (R : αβProp) (C : Computation αComputation βProp) (a : α Computation α) (b : β Computation β) :
    @[simp]
    theorem Computation.LiftRelAux.ret_right {α : Type u} {β : Type v} (R : αβProp) (C : Computation αComputation βProp) (b : β) (ca : Computation α) :
    LiftRelAux R C ca.destruct (Sum.inl b) (a : α), a ca R a b
    theorem Computation.LiftRelRec.lem {α : Type u} {β : Type v} {R : αβProp} (C : Computation αComputation βProp) (H : ∀ {ca : Computation α} {cb : Computation β}, C ca cbLiftRelAux R C ca.destruct cb.destruct) (ca : Computation α) (cb : Computation β) (Hc : C ca cb) (a : α) (ha : a ca) :
    LiftRel R ca cb
    theorem Computation.liftRel_rec {α : Type u} {β : Type v} {R : αβProp} (C : Computation αComputation βProp) (H : ∀ {ca : Computation α} {cb : Computation β}, C ca cbLiftRelAux R C ca.destruct cb.destruct) (ca : Computation α) (cb : Computation β) (Hc : C ca cb) :
    LiftRel R ca cb