l3lab/ntp-mathlib huggingface dataset:
theorem fix_eq_ωSup : Part.fix f = ωSup (approxChain f) := by
  apply le_antisymm
  · intro x
    cases' exists_fix_le_approx f x with i hx
    trans approx f i.succ x
    · trans
      apply hx
      apply approx_mono' f
    apply le_ωSup_of_le i.succ
    dsimp [approx]
    rfl
  · apply ωSup_le _ _ _
    simp only [Fix.approxChain, OrderHom.coe_mk]
    intro y x
    

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
y : ℕ
x : α✝
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } y x ≤ Part.fix (⇑f) x

Next tactic:
apply approx_le_fix f
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
⊢ Part.fix ⇑f ≤ X

Next tactic:
rw [fix_eq_ωSup f]
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
⊢ ωSup (approxChain f) ≤ X

Next tactic:
apply ωSup_le _ _ _
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
⊢ ∀ (i : ℕ), (approxChain f) i ≤ X

Next tactic:
simp only [Fix.approxChain, OrderHom.coe_mk]
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
⊢ ∀ (i : ℕ), { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } i ≤ X

Next tactic:
intro i
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
i : ℕ
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } i ≤ X

Next tactic:
induction i with
  | zero => dsimp [Fix.approx]; apply bot_le
  | succ _ i_ih => trans f X; apply f.monotone i_ih; apply hX
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  induction i with
  

Proof state:
case zero
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } Nat.zero ≤ X

Next tactic:
| zero => dsimp [Fix.approx]; apply bot_le
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  induction i with
  | zero => 

Proof state:
case zero
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } Nat.zero ≤ X

Next tactic:
dsimp [Fix.approx]
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  induction i with
  | zero => dsimp [Fix.approx]; 

Proof state:
case zero
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } 0 ≤ X

Next tactic:
apply bot_le
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  induction i with
  | zero => dsimp [Fix.approx]; apply bot_le
  

Proof state:
case succ
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
n✝ : ℕ
i_ih : { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } n✝ ≤ X
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } (Nat.succ n✝) ≤ X

Next tactic:
| succ _ i_ih => trans f X; apply f.monotone i_ih; apply hX
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  induction i with
  | zero => dsimp [Fix.approx]; apply bot_le
  | succ _ i_ih => 

Proof state:
case succ
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
n✝ : ℕ
i_ih : { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } n✝ ≤ X
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } (Nat.succ n✝) ≤ X

Next tactic:
trans f X
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  induction i with
  | zero => dsimp [Fix.approx]; apply bot_le
  | succ _ i_ih => trans f X; 

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
n✝ : ℕ
i_ih : { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } n✝ ≤ X
⊢ { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } (Nat.succ n✝) ≤ f X
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
n✝ : ℕ
i_ih : { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } n✝ ≤ X
⊢ f X ≤ X

Next tactic:
apply f.monotone i_ih
theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X := by
  rw [fix_eq_ωSup f]
  apply ωSup_le _ _ _
  simp only [Fix.approxChain, OrderHom.coe_mk]
  intro i
  induction i with
  | zero => dsimp [Fix.approx]; apply bot_le
  | succ _ i_ih => trans f X; apply f.monotone i_ih; 

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
X : (a : α✝) → Part (β a)
hX : f X ≤ X
n✝ : ℕ
i_ih : { toFun := approx ⇑f, monotone' := (_ : ∀ ⦃i j : ℕ⦄, i ≤ j → approx (⇑f) i ≤ approx (⇑f) j) } n✝ ≤ X
⊢ f X ≤ X

Next tactic:
apply hX
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
⊢ Part.fix ⇑f = f (Part.fix ⇑f)

Next tactic:
rw [fix_eq_ωSup f, hc]
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
⊢ ωSup (approxChain f) = ωSup (Chain.map (approxChain f) f)

Next tactic:
apply le_antisymm
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · 

Proof state:
case a
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
⊢ ωSup (approxChain f) ≤ ωSup (Chain.map (approxChain f) f)

Next tactic:
apply ωSup_le_ωSup_of_le _
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · apply ωSup_le_ωSup_of_le _
    

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
⊢ approxChain f ≤ Chain.map (approxChain f) f

Next tactic:
intro i
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · apply ωSup_le_ωSup_of_le _
    intro i
    

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
i : ℕ
⊢ ∃ j, (approxChain f) i ≤ (Chain.map (approxChain f) f) j

Next tactic:
exists i
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · apply ωSup_le_ωSup_of_le _
    intro i
    exists i
    

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
i : ℕ
⊢ (approxChain f) i ≤ (Chain.map (approxChain f) f) i

Next tactic:
intro x
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · apply ωSup_le_ωSup_of_le _
    intro i
    exists i
    intro x
    -- intros x y hx,
    

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
i : ℕ
x : α✝
⊢ (approxChain f) i x ≤ (Chain.map (approxChain f) f) i x

Next tactic:
apply le_f_of_mem_approx _ ⟨i, rfl⟩
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · apply ωSup_le_ωSup_of_le _
    intro i
    exists i
    intro x
    -- intros x y hx,
    apply le_f_of_mem_approx _ ⟨i, rfl⟩
  · 

Proof state:
case a
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
⊢ ωSup (Chain.map (approxChain f) f) ≤ ωSup (approxChain f)

Next tactic:
apply ωSup_le_ωSup_of_le _
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · apply ωSup_le_ωSup_of_le _
    intro i
    exists i
    intro x
    -- intros x y hx,
    apply le_f_of_mem_approx _ ⟨i, rfl⟩
  · apply ωSup_le_ωSup_of_le _
    

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
⊢ Chain.map (approxChain f) f ≤ approxChain f

Next tactic:
intro i
theorem fix_eq : Part.fix f = f (Part.fix f) := by
  rw [fix_eq_ωSup f, hc]
  apply le_antisymm
  · apply ωSup_le_ωSup_of_le _
    intro i
    exists i
    intro x
    -- intros x y hx,
    apply le_f_of_mem_approx _ ⟨i, rfl⟩
  · apply ωSup_le_ωSup_of_le _
    intro i
    

Proof state:
α✝ : Type u_1
β : α✝ → Type u_2
α : Type u_3
f : ((a : α✝) → Part (β a)) →o (a : α✝) → Part (β a)
hc : Continuous f
i : ℕ
⊢ ∃ j, (Chain.map (approxChain f) f) i ≤ (approxChain f) j

Next tactic:
exists i.succ
theorem to_unit_cont (f : Part α →o Part α) (hc : Continuous f) : Continuous (toUnitMono f)
  | _ => by
    

Proof state:
α : Type u_1
β : α → Type u_2
f : Part α →o Part α
hc : Continuous f
x✝ : Chain (Unit → Part α)
⊢ (toUnitMono f) (ωSup x✝) = ωSup (Chain.map x✝ (toUnitMono f))

Next tactic:
ext ⟨⟩ : 1
theorem to_unit_cont (f : Part α →o Part α) (hc : Continuous f) : Continuous (toUnitMono f)
  | _ => by
    ext ⟨⟩ : 1
    

Proof state:
case h.unit
α : Type u_1
β : α → Type u_2
f : Part α →o Part α
hc : Continuous f
x✝ : Chain (Unit → Part α)
⊢ (toUnitMono f) (ωSup x✝) PUnit.unit = ωSup (Chain.map x✝ (toUnitMono f)) PUnit.unit

Next tactic:
dsimp [OmegaCompletePartialOrder.ωSup]
theorem to_unit_cont (f : Part α →o Part α) (hc : Continuous f) : Continuous (toUnitMono f)
  | _ => by
    ext ⟨⟩ : 1
    dsimp [OmegaCompletePartialOrder.ωSup]
    

Proof state:
case h.unit
α : Type u_1
β : α → Type u_2
f : Part α →o Part α
hc : Continuous f
x✝ : Chain (Unit → Part α)
⊢ f (Part.ωSup (Chain.map x✝ (Pi.evalOrderHom PUnit.unit))) =
    Part.ωSup (Chain.map (Chain.map x✝ (toUnitMono f)) (Pi.evalOrderHom PUnit.unit))

Next tactic:
erw [hc, Chain.map_comp]
theorem to_unit_cont (f : Part α →o Part α) (hc : Continuous f) : Continuous (toUnitMono f)
  | _ => by
    ext ⟨⟩ : 1
    dsimp [OmegaCompletePartialOrder.ωSup]
    erw [hc, Chain.map_comp]; 

Proof state:
case h.unit
α : Type u_1
β : α → Type u_2
f : Part α →o Part α
hc : Continuous f
x✝ : Chain (Unit → Part α)
⊢ ωSup (Chain.map x✝ (OrderHom.comp f (Pi.evalOrderHom PUnit.unit))) =
    Part.ωSup (Chain.map x✝ (OrderHom.comp f (Pi.evalOrderHom PUnit.unit)))

Next tactic:
rfl
instance lawfulFix : LawfulFix (Part α) :=
  ⟨fun {f : Part α →o Part α} hc ↦ show Part.fix (toUnitMono f) () = _ by
    

Proof state:
α : Type u_1
β : α → Type u_2
f : Part α →o Part α
hc : Continuous f
⊢ Part.fix ⇑(toUnitMono f) () = f (Fix.fix ⇑f)

Next tactic:
rw [Part.fix_eq (to_unit_cont f hc)]
instance lawfulFix : LawfulFix (Part α) :=
  ⟨fun {f : Part α →o Part α} hc ↦ show Part.fix (toUnitMono f) () = _ by
    rw [Part.fix_eq (to_unit_cont f hc)]; 

Proof state:
α : Type u_1
β : α → Type u_2
f : Part α →o Part α
hc : Continuous f
⊢ (toUnitMono f) (Part.fix ⇑(toUnitMono f)) () = f (Fix.fix ⇑f)

Next tactic:
rfl
theorem continuous_curry : Continuous <| monotoneCurry α β γ := fun c ↦ by
  

Proof state:
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((x : (a : α) × β a) → γ x.fst x.snd)
⊢ (monotoneCurry α β γ) (ωSup c) = ωSup (Chain.map c (monotoneCurry α β γ))

Next tactic:
ext x y
theorem continuous_curry : Continuous <| monotoneCurry α β γ := fun c ↦ by
  ext x y
  

Proof state:
case h.h
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((x : (a : α) × β a) → γ x.fst x.snd)
x : α
y : β x
⊢ (monotoneCurry α β γ) (ωSup c) x y = ωSup (Chain.map c (monotoneCurry α β γ)) x y

Next tactic:
dsimp [curry, ωSup]
theorem continuous_curry : Continuous <| monotoneCurry α β γ := fun c ↦ by
  ext x y
  dsimp [curry, ωSup]
  

Proof state:
case h.h
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((x : (a : α) × β a) → γ x.fst x.snd)
x : α
y : β x
⊢ ωSup (Chain.map c (evalOrderHom { fst := x, snd := y })) =
    ωSup (Chain.map (Chain.map (Chain.map c (monotoneCurry α β γ)) (evalOrderHom x)) (evalOrderHom y))

Next tactic:
rw [map_comp, map_comp]
theorem continuous_curry : Continuous <| monotoneCurry α β γ := fun c ↦ by
  ext x y
  dsimp [curry, ωSup]
  rw [map_comp, map_comp]
  

Proof state:
case h.h
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((x : (a : α) × β a) → γ x.fst x.snd)
x : α
y : β x
⊢ ωSup (Chain.map c (evalOrderHom { fst := x, snd := y })) =
    ωSup (Chain.map c (OrderHom.comp (OrderHom.comp (evalOrderHom y) (evalOrderHom x)) (monotoneCurry α β γ)))

Next tactic:
rfl
theorem continuous_uncurry : Continuous <| monotoneUncurry α β γ := fun c ↦ by
  

Proof state:
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((a : α) → (b : β a) → γ a b)
⊢ (monotoneUncurry α β γ) (ωSup c) = ωSup (Chain.map c (monotoneUncurry α β γ))

Next tactic:
ext ⟨x, y⟩
theorem continuous_uncurry : Continuous <| monotoneUncurry α β γ := fun c ↦ by
  ext ⟨x, y⟩
  

Proof state:
case h.mk
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((a : α) → (b : β a) → γ a b)
x : α
y : β x
⊢ (monotoneUncurry α β γ) (ωSup c) { fst := x, snd := y } =
    ωSup (Chain.map c (monotoneUncurry α β γ)) { fst := x, snd := y }

Next tactic:
dsimp [uncurry, ωSup]
theorem continuous_uncurry : Continuous <| monotoneUncurry α β γ := fun c ↦ by
  ext ⟨x, y⟩
  dsimp [uncurry, ωSup]
  

Proof state:
case h.mk
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((a : α) → (b : β a) → γ a b)
x : α
y : β x
⊢ ωSup (Chain.map (Chain.map c (evalOrderHom x)) (evalOrderHom y)) =
    ωSup (Chain.map (Chain.map c (monotoneUncurry α β γ)) (evalOrderHom { fst := x, snd := y }))

Next tactic:
rw [map_comp, map_comp]
theorem continuous_uncurry : Continuous <| monotoneUncurry α β γ := fun c ↦ by
  ext ⟨x, y⟩
  dsimp [uncurry, ωSup]
  rw [map_comp, map_comp]
  

Proof state:
case h.mk
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
c : Chain ((a : α) → (b : β a) → γ a b)
x : α
y : β x
⊢ ωSup (Chain.map c (OrderHom.comp (evalOrderHom y) (evalOrderHom x))) =
    ωSup (Chain.map c (OrderHom.comp (evalOrderHom { fst := x, snd := y }) (monotoneUncurry α β γ)))

Next tactic:
rfl
instance Pi.lawfulFix' [LawfulFix <| (x : Sigma β) → γ x.1 x.2] :
    LawfulFix ((x y : _) → γ x y) where
  fix_eq {_f} hc := by
    

Proof state:
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝¹ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
inst✝ : LawfulFix ((x : Sigma β) → γ x.fst x.snd)
_f : ((x : α) → (y : β x) → γ x y) →o (x : α) → (y : β x) → γ x y
hc : Continuous _f
⊢ fix ⇑_f = _f (fix ⇑_f)

Next tactic:
dsimp [fix]
instance Pi.lawfulFix' [LawfulFix <| (x : Sigma β) → γ x.1 x.2] :
    LawfulFix ((x y : _) → γ x y) where
  fix_eq {_f} hc := by
    dsimp [fix]
    

Proof state:
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝¹ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
inst✝ : LawfulFix ((x : Sigma β) → γ x.fst x.snd)
_f : ((x : α) → (y : β x) → γ x y) →o (x : α) → (y : β x) → γ x y
hc : Continuous _f
⊢ curry (fix (uncurry ∘ ⇑_f ∘ curry)) = _f (curry (fix (uncurry ∘ ⇑_f ∘ curry)))

Next tactic:
conv =>
      lhs
      erw [LawfulFix.fix_eq (uncurry_curry_continuous hc)]
instance Pi.lawfulFix' [LawfulFix <| (x : Sigma β) → γ x.1 x.2] :
    LawfulFix ((x y : _) → γ x y) where
  fix_eq {_f} hc := by
    dsimp [fix]
    conv =>
      

Proof state:
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝¹ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
inst✝ : LawfulFix ((x : Sigma β) → γ x.fst x.snd)
_f : ((x : α) → (y : β x) → γ x y) →o (x : α) → (y : β x) → γ x y
hc : Continuous _f
| curry (fix (uncurry ∘ ⇑_f ∘ curry)) = _f (curry (fix (uncurry ∘ ⇑_f ∘ curry)))

Next tactic:
lhs
      erw [LawfulFix.fix_eq (uncurry_curry_continuous hc)]
instance Pi.lawfulFix' [LawfulFix <| (x : Sigma β) → γ x.1 x.2] :
    LawfulFix ((x y : _) → γ x y) where
  fix_eq {_f} hc := by
    dsimp [fix]
    conv =>
      

Proof state:
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝¹ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
inst✝ : LawfulFix ((x : Sigma β) → γ x.fst x.snd)
_f : ((x : α) → (y : β x) → γ x y) →o (x : α) → (y : β x) → γ x y
hc : Continuous _f
| curry (fix (uncurry ∘ ⇑_f ∘ curry)) = _f (curry (fix (uncurry ∘ ⇑_f ∘ curry)))

Next tactic:
lhs
instance Pi.lawfulFix' [LawfulFix <| (x : Sigma β) → γ x.1 x.2] :
    LawfulFix ((x y : _) → γ x y) where
  fix_eq {_f} hc := by
    dsimp [fix]
    conv =>
      lhs
      

Proof state:
α : Type u_1
β : α → Type u_2
γ : (a : α) → β a → Type u_3
inst✝¹ : (x : α) → (y : β x) → OmegaCompletePartialOrder (γ x y)
inst✝ : LawfulFix ((x : Sigma β) → γ x.fst x.snd)
_f : ((x : α) → (y : β x) → γ x y) →o (x : α) → (y : β x) → γ x y
hc : Continuous _f
| curry (fix (uncurry ∘ ⇑_f ∘ curry))

Next tactic:
erw [LawfulFix.fix_eq (uncurry_curry_continuous hc)]
/-- The left inverse of a formal multilinear series, where the `n`-th term is defined inductively
in terms of the previous ones to make sure that `(leftInv p i) ∘ p = id`. For this, the linear term
`p₁` in `p` should be invertible. In the definition, `i` is a linear isomorphism that should
coincide with `p₁`, so that one can use its inverse in the construction. The definition does not
use that `i = p₁`, but proofs that the definition is well-behaved do.

The `n`-th term in `q ∘ p` is `∑ qₖ (p_{j₁}, ..., p_{jₖ})` over `j₁ + ... + jₖ = n`. In this
expression, `qₙ` appears only once, in `qₙ (p₁, ..., p₁)`. We adjust the definition so that this
term compensates the rest of the sum, using `i⁻¹` as an inverse to `p₁`.

These formulas only make sense when the constant term `p₀` vanishes. The definition we give is
general, but it ignores the value of `p₀`.
-/
noncomputable def leftInv (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    FormalMultilinearSeries 𝕜 F E
  | 0 => 0
  | 1 => (continuousMultilinearCurryFin1 𝕜 F E).symm i.symm
  | n + 2 =>
    -∑ c : { c : Composition (n + 2) // c.length < n + 2 },
        (leftInv p i (c : Composition (n + 2)).length).compAlongComposition
          (p.compContinuousLinearMap i.symm) c
  decreasing_by 

Proof state:
n : ℕ
c : { c // Composition.length c < n + 2 }
⊢ (invImage (fun a => sizeOf a) instWellFoundedRelation).1 (Composition.length ↑c) (Nat.succ (Nat.succ n))

Next tactic:
exact c.2
@[simp]
theorem leftInv_coeff_zero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.leftInv i 0 = 0 := by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
F : Type u_3
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : FormalMultilinearSeries 𝕜 E F
i : E ≃L[𝕜] F
⊢ leftInv p i 0 = 0

Next tactic:
rw [leftInv]
@[simp]
theorem leftInv_coeff_one (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.leftInv i 1 = (continuousMultilinearCurryFin1 𝕜 F E).symm i.symm := by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
F : Type u_3
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : FormalMultilinearSeries 𝕜 E F
i : E ≃L[𝕜] F
⊢ leftInv p i 1 = (LinearIsometryEquiv.symm (continuousMultilinearCurryFin1 𝕜 F E)) ↑(ContinuousLinearEquiv.symm i)

Next tactic:
rw [leftInv]
/-- The left inverse does not depend on the zeroth coefficient of a formal multilinear
series. -/
theorem leftInv_removeZero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.removeZero.leftInv i = p.leftInv i := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
F : Type u_3
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : FormalMultilinearSeries 𝕜 E F
i : E ≃L[𝕜] F
⊢ leftInv (removeZero p) i = leftInv p i

Next tactic:
ext1 n
/-- The left inverse does not depend on the zeroth coefficient of a formal multilinear
series. -/
theorem leftInv_removeZero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.removeZero.leftInv i = p.leftInv i := by
  ext1 n
  

Proof state:
case h
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
F : Type u_3
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : FormalMultilinearSeries 𝕜 E F
i : E ≃L[𝕜] F
n : ℕ
⊢ leftInv (removeZero p) i n = leftInv p i n

Next tactic:
induction' n using Nat.strongRec' with n IH
/-- The left inverse does not depend on the zeroth coefficient of a formal multilinear
series. -/
theorem leftInv_removeZero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.removeZero.leftInv i = p.leftInv i := by
  ext1 n
  induction' n using Nat.strongRec' with n IH
  

Proof state:
case h.H
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
E : Type u_2
inst✝³ : NormedAddCommGroup E
inst✝² : NormedSpace 𝕜 E
F : Type u_3
inst✝¹ : NormedAddCommGroup F
inst✝ : NormedSpace 𝕜 F
p : FormalMultilinearSeries 𝕜 E F
i : E ≃L[𝕜] F
n : ℕ
IH : ∀ m < n, leftInv (removeZero p) i m = leftInv p i m
⊢ leftInv (removeZero p) i n = leftInv p i n

Next tactic:
match n with
  | 0 => simp -- if one replaces `simp` with `refl`, the proof times out in the kernel.
  | 1 => simp -- TODO: why?
  | n + 2 =>
    simp only [leftInv, neg_inj]
    refine' Finset.sum_congr rfl fun c cuniv => _
    rcases c with ⟨c, hc⟩
    ext v
    dsimp
    simp [IH _ hc]