internlm/Lean-Github huggingface dataset:
Theorem: Reactor.LawfulMemUpdate.obj?_updated
Proof state before:
α : Type
inst✝ : Hierarchical α
rtr₁ : α
cpt : Component.Valued
i : ID
v : Value
rtr₂ : α
j✝ : ID
rtr₁✝ rtr₂✝ : α
n₁✝ n₂✝ : Component.type α Component.rtr
a✝ : rtr₁✝ ≃[Component.rtr][j✝] rtr₂✝
h₁ : rtr₁✝{Component.rtr}{j✝} = some n₁✝
h₂ : rtr₂✝{Component.rtr}{j✝} = some n₂✝
u : LawfulMemUpdate cpt i v n₁✝ n₂✝
hi : n₂✝[Component.val cpt][i] = (fun x => v) <$> n₁✝[Component.val cpt][i]
w✝¹ : Component.type α (Component.val cpt)
h₁' : n₁✝[Component.val cpt][i] = some w✝¹
w✝ : Component.type α (Component.val cpt)
h₂' : n₂✝[Component.val cpt][i] = some w✝
⊢ rtr₂✝[Component.val cpt][i] = (fun x => v) <$> rtr₁✝[Component.val cpt][i]
Tactic:
rw [obj?_some_nested h₁ h₁', obj?_some_nested h₂ h₂']
Proof state after:
α : Type
inst✝ : Hierarchical α
rtr₁ : α
cpt : Component.Valued
i : ID
v : Value
rtr₂ : α
j✝ : ID
rtr₁✝ rtr₂✝ : α
n₁✝ n₂✝ : Component.type α Component.rtr
a✝ : rtr₁✝ ≃[Component.rtr][j✝] rtr₂✝
h₁ : rtr₁✝{Component.rtr}{j✝} = some n₁✝
h₂ : rtr₂✝{Component.rtr}{j✝} = some n₂✝
u : LawfulMemUpdate cpt i v n₁✝ n₂✝
hi : n₂✝[Component.val cpt][i] = (fun x => v) <$> n₁✝[Component.val cpt][i]
w✝¹ : Component.type α (Component.val cpt)
h₁' : n₁✝[Component.val cpt][i] = some w✝¹
w✝ : Component.type α (Component.val cpt)
h₂' : n₂✝[Component.val cpt][i] = some w✝
⊢ some w✝ = (fun x => v) <$> some w✝¹
Theorem: Reactor.LawfulMemUpdate.obj?_updated
Proof state before:
α : Type
inst✝ : Hierarchical α
rtr₁ : α
cpt : Component.Valued
i : ID
v : Value
rtr₂ : α
j✝ : ID
rtr₁✝ rtr₂✝ : α
n₁✝ n₂✝ : Component.type α Component.rtr
a✝ : rtr₁✝ ≃[Component.rtr][j✝] rtr₂✝
h₁ : rtr₁✝{Component.rtr}{j✝} = some n₁✝
h₂ : rtr₂✝{Component.rtr}{j✝} = some n₂✝
u : LawfulMemUpdate cpt i v n₁✝ n₂✝
hi : n₂✝[Component.val cpt][i] = (fun x => v) <$> n₁✝[Component.val cpt][i]
w✝¹ : Component.type α (Component.val cpt)
h₁' : n₁✝[Component.val cpt][i] = some w✝¹
w✝ : Component.type α (Component.val cpt)
h₂' : n₂✝[Component.val cpt][i] = some w✝
⊢ some w✝ = (fun x => v) <$> some w✝¹
Tactic:
exact h₁' ▸ h₂' ▸ hi
Proof state after:
no goals
Theorem: Reactor.LawfulUpdate.obj?_updated
Proof state before:
α : Type
inst✝ : Hierarchical α
rtr₁ : α
cpt : Component.Valued
i : ID
v : Value
rtr₂ : α
h : IsEmpty (Member (Component.val cpt) i rtr₁)
e : rtr₁ = rtr₂
⊢ rtr₂[Component.val cpt][i] = (fun x => v) <$> rtr₁[Component.val cpt][i]
Tactic:
subst e
Proof state after:
α : Type
inst✝ : Hierarchical α
rtr₁ : α
cpt : Component.Valued
i : ID
v : Value
h : IsEmpty (Member (Component.val cpt) i rtr₁)
⊢ rtr₁[Component.val cpt][i] = (fun x => v) <$> rtr₁[Component.val cpt][i]
Theorem: Reactor.LawfulUpdate.obj?_updated
Proof state before:
α : Type
inst✝ : Hierarchical α
rtr₁ : α
cpt : Component.Valued
i : ID
v : Value
h : IsEmpty (Member (Component.val cpt) i rtr₁)
⊢ rtr₁[Component.val cpt][i] = (fun x => v) <$> rtr₁[Component.val cpt][i]
Tactic:
simp [member_isEmpty_obj?_none h]
Proof state after:
no goals
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
rtr : α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
ids : List ID
⊢ rtr ≈ go rtr cpt vs ids
Tactic:
induction ids generalizing rtr <;> simp [go]
Proof state after:
case nil
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
rtr : α
⊢ rtr ≈ rtr

case cons
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
tail_ih✝ : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
⊢ rtr ≈
    match vs head✝ with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt head✝ v) cpt vs tail✝
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
rtr : α
⊢ rtr ≈ rtr
Tactic:
case nil     => exact .refl _
Proof state after:
no goals
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
⊢ rtr ≈
    match vs hd with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝
Tactic:
case cons hd _ hi =>
  cases vs hd
  case none => exact hi
  case some => exact Equivalent.trans LawfulUpdatable.equiv hi
Proof state after:
no goals
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
rtr : α
⊢ rtr ≈ rtr
Tactic:
exact .refl _
Proof state after:
no goals
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
⊢ rtr ≈
    match vs hd with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝
Tactic:
cases vs hd
Proof state after:
case none
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
⊢ rtr ≈
    match none with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝

case some
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
val✝ : Value
⊢ rtr ≈
    match some val✝ with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
⊢ rtr ≈
    match none with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝
Tactic:
case none => exact hi
Proof state after:
no goals
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
val✝ : Value
⊢ rtr ≈
    match some val✝ with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝
Tactic:
case some => exact Equivalent.trans LawfulUpdatable.equiv hi
Proof state after:
no goals
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
⊢ rtr ≈
    match none with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝
Tactic:
exact hi
Proof state after:
no goals
Theorem: Reactor.set.go_equiv
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
cpt : Component.Valued
vs : ID ⇀ Value
hd : ID
tail✝ : List ID
hi : ∀ {rtr : α}, rtr ≈ go rtr cpt vs tail✝
rtr : α
val✝ : Value
⊢ rtr ≈
    match some val✝ with
    | none => go rtr cpt vs tail✝
    | some v => go (update rtr cpt hd v) cpt vs tail✝
Tactic:
exact Equivalent.trans LawfulUpdatable.equiv hi
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
rtr : α
inst✝ : Finite α
i : ID
cpt : Component.Valued
ids : List ID
c : Component.Valued
o : Component.type α (Component.val c)
vs : ID ⇀ Value
ho : rtr[Component.val c][i] = some o
h : c ≠ cpt ∨ i ∉ ids ∨ vs i = none
⊢ go rtr cpt vs ids[Component.val c][i] = some o
Tactic:
induction ids generalizing rtr o <;> simp_all [go]
Proof state after:
case cons
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
tail_ih✝ :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
h : ¬c = cpt ∨ ¬(i = head✝ ∨ i ∈ tail✝) ∨ vs i = none
⊢ (match vs head✝ with
      | none => go rtr cpt vs tail✝
      | some v => go (update rtr cpt head✝ v) cpt vs tail✝)[Component.val c][i] =
    some o
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
heq✝ : vs head✝ = none
h : ¬c = cpt
⊢ go rtr cpt vs tail✝[Component.val c][i] = some o
Tactic:
case _ hi _ _ h => exact hi ho $ .inl h
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
heq✝ : vs head✝ = none
h : ¬(i = head✝ ∨ i ∈ tail✝)
⊢ go rtr cpt vs tail✝[Component.val c][i] = some o
Tactic:
case _ hi _ _ h => exact hi ho $ .inr $ .inl (not_or.mp h).right
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
heq✝ : vs head✝ = none
h : vs i = none
⊢ go rtr cpt vs tail✝[Component.val c][i] = some o
Tactic:
case _ hi _ _ h => exact hi ho $ .inr $ .inr h
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
case inl hd tl hi _ v _ h =>
  have e := @LawfulUpdatable.equiv _ cpt ‹_› v _ rtr
  have ⟨_, ho'⟩ := Equivalent.obj?_some_iff e |>.mp ⟨_, ho⟩
  simp [hi ho' $ .inl h]
  injection ho' ▸ ho ▸ obj?_preserved_cpt h
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬(i = hd ∨ i ∈ tl)
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
case inr.inl hd tl hi _ v _ h =>
  have e := @LawfulUpdatable.equiv _ cpt ‹_› v _ rtr
  have ⟨_, ho'⟩ := Equivalent.obj?_some_iff e |>.mp ⟨_, ho⟩
  push_neg at h
  simp [hi ho' $ .inr $ .inl h.right]
  injection ho' ▸ ho ▸ obj?_preserved_id h.left
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : vs i = none
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
case inr.inr hd tl hi _ v _ h =>
  have hh : i ≠ hd := by by_contra; simp_all
  have ho' := ho ▸ (@LawfulUpdatable.lawful _ _ rtr cpt hd v).obj?_preserved (c := c) (.inr hh)
  exact hi ho' (.inr $ .inr h)
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
case cons.h_2.inr
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
tail_ih✝ :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v✝ : Value
heq✝ : vs head✝ = some v✝
h✝ : ¬(i = head✝ ∨ i ∈ tail✝) ∨ vs i = none
⊢ go (update rtr cpt head✝ v✝) cpt vs tail✝[Component.val c][i] = some o
Tactic:
cases ‹_ ∨ _›
Proof state after:
case cons.h_2.inr.inl
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
tail_ih✝ :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v✝ : Value
heq✝ : vs head✝ = some v✝
h✝ : ¬(i = head✝ ∨ i ∈ tail✝)
⊢ go (update rtr cpt head✝ v✝) cpt vs tail✝[Component.val c][i] = some o

case cons.h_2.inr.inr
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
tail_ih✝ :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v✝ : Value
heq✝ : vs head✝ = some v✝
h✝ : vs i = none
⊢ go (update rtr cpt head✝ v✝) cpt vs tail✝[Component.val c][i] = some o
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
heq✝ : vs head✝ = none
h : ¬c = cpt
⊢ go rtr cpt vs tail✝[Component.val c][i] = some o
Tactic:
exact hi ho $ .inl h
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
heq✝ : vs head✝ = none
h : ¬(i = head✝ ∨ i ∈ tail✝)
⊢ go rtr cpt vs tail✝[Component.val c][i] = some o
Tactic:
exact hi ho $ .inr $ .inl (not_or.mp h).right
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
head✝ : ID
tail✝ : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o →
      ¬c = cpt ∨ i ∉ tail✝ ∨ vs i = none → go rtr cpt vs tail✝[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
heq✝ : vs head✝ = none
h : vs i = none
⊢ go rtr cpt vs tail✝[Component.val c][i] = some o
Tactic:
exact hi ho $ .inr $ .inr h
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
have e := @LawfulUpdatable.equiv _ cpt ‹_› v _ rtr
Proof state after:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
e : rtr ≈ update rtr cpt hd v
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
e : rtr ≈ update rtr cpt hd v
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
have ⟨_, ho'⟩ := Equivalent.obj?_some_iff e |>.mp ⟨_, ho⟩
Proof state after:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
e : rtr ≈ update rtr cpt hd v
w✝ : Component.type α (Component.val c)
ho' : update rtr cpt hd v[Component.val c][i] = some w✝
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
e : rtr ≈ update rtr cpt hd v
w✝ : Component.type α (Component.val c)
ho' : update rtr cpt hd v[Component.val c][i] = some w✝
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
simp [hi ho' $ .inl h]
Proof state after:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
e : rtr ≈ update rtr cpt hd v
w✝ : Component.type α (Component.val c)
ho' : update rtr cpt hd v[Component.val c][i] = some w✝
⊢ w✝ = o
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬c = cpt
e : rtr ≈ update rtr cpt hd v
w✝ : Component.type α (Component.val c)
ho' : update rtr cpt hd v[Component.val c][i] = some w✝
⊢ w✝ = o
Tactic:
injection ho' ▸ ho ▸ obj?_preserved_cpt h
Proof state after:
no goals
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬(i = hd ∨ i ∈ tl)
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
have e := @LawfulUpdatable.equiv _ cpt ‹_› v _ rtr
Proof state after:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬(i = hd ∨ i ∈ tl)
e : rtr ≈ update rtr cpt hd v
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Theorem: Reactor.set.go_preserves
Proof state before:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬(i = hd ∨ i ∈ tl)
e : rtr ≈ update rtr cpt hd v
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o
Tactic:
have ⟨_, ho'⟩ := Equivalent.obj?_some_iff e |>.mp ⟨_, ho⟩
Proof state after:
α : Type
inst✝¹ : Accessible α
inst✝ : Finite α
i : ID
cpt c : Component.Valued
vs : ID ⇀ Value
hd : ID
tl : List ID
rtr : α
o : Component.type α (Component.val c)
hi :
  ∀ {rtr : α} {o : Component.type α (Component.val c)},
    rtr[Component.val c][i] = some o → ¬c = cpt ∨ i ∉ tl ∨ vs i = none → go rtr cpt vs tl[Component.val c][i] = some o
ho : rtr[Component.val c][i] = some o
x✝ : Option Value
v : Value
heq✝ : vs hd = some v
h : ¬(i = hd ∨ i ∈ tl)
e : rtr ≈ update rtr cpt hd v
w✝ : Component.type α (Component.val c)
ho' : update rtr cpt hd v[Component.val c][i] = some w✝
⊢ go (update rtr cpt hd v) cpt vs tl[Component.val c][i] = some o