l3lab/ntp-mathlib huggingface dataset:
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> simp [himp_eq]
  sdiff_eq x y := by ext <;> simp [sdiff_eq]
  inf_compl_le_bot x := by constructor <;> 

Proof state:
case right
α✝ : Type u
β✝ : Type u_1
w x✝ y z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x : α × β
⊢ (x ⊓ xᶜ).2 ≤ ⊥.2

Next tactic:
simp
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> simp [himp_eq]
  sdiff_eq x y := by ext <;> simp [sdiff_eq]
  inf_compl_le_bot x := by constructor <;> simp
  top_le_sup_compl x := by 

Proof state:
α✝ : Type u
β✝ : Type u_1
w x✝ y z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x : α × β
⊢ ⊤ ≤ x ⊔ xᶜ

Next tactic:
constructor
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> simp [himp_eq]
  sdiff_eq x y := by ext <;> simp [sdiff_eq]
  inf_compl_le_bot x := by constructor <;> simp
  top_le_sup_compl x := by constructor <;> 

Proof state:
case left
α✝ : Type u
β✝ : Type u_1
w x✝ y z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x : α × β
⊢ ⊤.1 ≤ (x ⊔ xᶜ).1

Next tactic:
simp
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> simp [himp_eq]
  sdiff_eq x y := by ext <;> simp [sdiff_eq]
  inf_compl_le_bot x := by constructor <;> simp
  top_le_sup_compl x := by constructor <;> 

Proof state:
case right
α✝ : Type u
β✝ : Type u_1
w x✝ y z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x : α × β
⊢ ⊤.2 ≤ (x ⊔ xᶜ).2

Next tactic:
simp
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> simp [himp_eq]
  sdiff_eq x y := by 

Proof state:
α✝ : Type u
β✝ : Type u_1
w x✝ y✝ z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x y : α × β
⊢ x \ y = x ⊓ yᶜ

Next tactic:
ext
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> simp [himp_eq]
  sdiff_eq x y := by ext <;> 

Proof state:
case a
α✝ : Type u
β✝ : Type u_1
w x✝ y✝ z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x y : α × β
⊢ (x \ y).1 = (x ⊓ yᶜ).1

Next tactic:
simp [sdiff_eq]
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> simp [himp_eq]
  sdiff_eq x y := by ext <;> 

Proof state:
case a
α✝ : Type u
β✝ : Type u_1
w x✝ y✝ z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x y : α × β
⊢ (x \ y).2 = (x ⊓ yᶜ).2

Next tactic:
simp [sdiff_eq]
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by 

Proof state:
α✝ : Type u
β✝ : Type u_1
w x✝ y✝ z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x y : α × β
⊢ x ⇨ y = y ⊔ xᶜ

Next tactic:
ext
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> 

Proof state:
case a
α✝ : Type u
β✝ : Type u_1
w x✝ y✝ z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x y : α × β
⊢ (x ⇨ y).1 = (y ⊔ xᶜ).1

Next tactic:
simp [himp_eq]
instance Prod.booleanAlgebra (α β) [BooleanAlgebra α] [BooleanAlgebra β] :
    BooleanAlgebra (α × β) where
  __ := Prod.heytingAlgebra
  __ := Prod.distribLattice α β
  himp_eq x y := by ext <;> 

Proof state:
case a
α✝ : Type u
β✝ : Type u_1
w x✝ y✝ z : α✝
α : Type ?u.69761
β : Type ?u.69764
inst✝¹ : BooleanAlgebra α
inst✝ : BooleanAlgebra β
src✝¹ : HeytingAlgebra (α × β) := heytingAlgebra
src✝ : DistribLattice (α × β) := distribLattice α β
x y : α × β
⊢ (x ⇨ y).2 = (y ⊔ xᶜ).2

Next tactic:
simp [himp_eq]
/-- Pullback a `GeneralizedBooleanAlgebra` along an injection. -/
@[reducible]
protected def Function.Injective.generalizedBooleanAlgebra [Sup α] [Inf α] [Bot α] [SDiff α]
    [GeneralizedBooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_bot : f ⊥ = ⊥) (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) :
    GeneralizedBooleanAlgebra α :=
  { hf.generalizedCoheytingAlgebra f map_sup map_inf map_bot map_sdiff,
    hf.distribLattice f map_sup map_inf with
    sup_inf_sdiff := fun a b => hf <| by 

Proof state:
α : Type u
β : Type u_1
w x y z : α
inst✝⁴ : Sup α
inst✝³ : Inf α
inst✝² : Bot α
inst✝¹ : SDiff α
inst✝ : GeneralizedBooleanAlgebra β
f : α → β
hf : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
map_bot : f ⊥ = ⊥
map_sdiff : ∀ (a b : α), f (a \ b) = f a \ f b
src✝¹ : GeneralizedCoheytingAlgebra α := Injective.generalizedCoheytingAlgebra f hf map_sup map_inf map_bot map_sdiff
src✝ : DistribLattice α := Injective.distribLattice f hf map_sup map_inf
a b : α
⊢ f (a ⊓ b ⊔ a \ b) = f a

Next tactic:
erw [map_sup, map_sdiff, map_inf, sup_inf_sdiff]
/-- Pullback a `GeneralizedBooleanAlgebra` along an injection. -/
@[reducible]
protected def Function.Injective.generalizedBooleanAlgebra [Sup α] [Inf α] [Bot α] [SDiff α]
    [GeneralizedBooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_bot : f ⊥ = ⊥) (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) :
    GeneralizedBooleanAlgebra α :=
  { hf.generalizedCoheytingAlgebra f map_sup map_inf map_bot map_sdiff,
    hf.distribLattice f map_sup map_inf with
    sup_inf_sdiff := fun a b => hf <| by erw [map_sup, map_sdiff, map_inf, sup_inf_sdiff],
    inf_inf_sdiff := fun a b => hf <| by 

Proof state:
α : Type u
β : Type u_1
w x y z : α
inst✝⁴ : Sup α
inst✝³ : Inf α
inst✝² : Bot α
inst✝¹ : SDiff α
inst✝ : GeneralizedBooleanAlgebra β
f : α → β
hf : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
map_bot : f ⊥ = ⊥
map_sdiff : ∀ (a b : α), f (a \ b) = f a \ f b
src✝¹ : GeneralizedCoheytingAlgebra α := Injective.generalizedCoheytingAlgebra f hf map_sup map_inf map_bot map_sdiff
src✝ : DistribLattice α := Injective.distribLattice f hf map_sup map_inf
a b : α
⊢ f (a ⊓ b ⊓ a \ b) = f ⊥

Next tactic:
erw [map_inf, map_sdiff, map_inf, inf_inf_sdiff, map_bot]
/-- Pullback a `BooleanAlgebra` along an injection. -/
@[reducible]
protected def Function.Injective.booleanAlgebra [Sup α] [Inf α] [Top α] [Bot α] [HasCompl α]
    [SDiff α] [BooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) (map_compl : ∀ a, f aᶜ = (f a)ᶜ)
    (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) : BooleanAlgebra α :=
  { hf.generalizedBooleanAlgebra f map_sup map_inf map_bot map_sdiff with
    compl := compl,
    top := ⊤,
    le_top := fun a => (@le_top β _ _ _).trans map_top.ge,
    bot_le := fun a => map_bot.le.trans bot_le,
    inf_compl_le_bot :=
      fun a => ((map_inf _ _).trans <| by 

Proof state:
α : Type u
β : Type u_1
w x y z : α
inst✝⁶ : Sup α
inst✝⁵ : Inf α
inst✝⁴ : Top α
inst✝³ : Bot α
inst✝² : HasCompl α
inst✝¹ : SDiff α
inst✝ : BooleanAlgebra β
f : α → β
hf : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
map_top : f ⊤ = ⊤
map_bot : f ⊥ = ⊥
map_compl : ∀ (a : α), f aᶜ = (f a)ᶜ
map_sdiff : ∀ (a b : α), f (a \ b) = f a \ f b
src✝ : GeneralizedBooleanAlgebra α := Injective.generalizedBooleanAlgebra f hf map_sup map_inf map_bot map_sdiff
a : α
⊢ f a ⊓ f aᶜ = f ⊥

Next tactic:
rw [map_compl, inf_compl_eq_bot, map_bot]
/-- Pullback a `BooleanAlgebra` along an injection. -/
@[reducible]
protected def Function.Injective.booleanAlgebra [Sup α] [Inf α] [Top α] [Bot α] [HasCompl α]
    [SDiff α] [BooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) (map_compl : ∀ a, f aᶜ = (f a)ᶜ)
    (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) : BooleanAlgebra α :=
  { hf.generalizedBooleanAlgebra f map_sup map_inf map_bot map_sdiff with
    compl := compl,
    top := ⊤,
    le_top := fun a => (@le_top β _ _ _).trans map_top.ge,
    bot_le := fun a => map_bot.le.trans bot_le,
    inf_compl_le_bot :=
      fun a => ((map_inf _ _).trans <| by rw [map_compl, inf_compl_eq_bot, map_bot]).le,
    top_le_sup_compl :=
      fun a => ((map_sup _ _).trans <| by 

Proof state:
α : Type u
β : Type u_1
w x y z : α
inst✝⁶ : Sup α
inst✝⁵ : Inf α
inst✝⁴ : Top α
inst✝³ : Bot α
inst✝² : HasCompl α
inst✝¹ : SDiff α
inst✝ : BooleanAlgebra β
f : α → β
hf : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
map_top : f ⊤ = ⊤
map_bot : f ⊥ = ⊥
map_compl : ∀ (a : α), f aᶜ = (f a)ᶜ
map_sdiff : ∀ (a b : α), f (a \ b) = f a \ f b
src✝ : GeneralizedBooleanAlgebra α := Injective.generalizedBooleanAlgebra f hf map_sup map_inf map_bot map_sdiff
a : α
⊢ f a ⊔ f aᶜ = f ⊤

Next tactic:
rw [map_compl, sup_compl_eq_top, map_top]
/-- Pullback a `BooleanAlgebra` along an injection. -/
@[reducible]
protected def Function.Injective.booleanAlgebra [Sup α] [Inf α] [Top α] [Bot α] [HasCompl α]
    [SDiff α] [BooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) (map_compl : ∀ a, f aᶜ = (f a)ᶜ)
    (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) : BooleanAlgebra α :=
  { hf.generalizedBooleanAlgebra f map_sup map_inf map_bot map_sdiff with
    compl := compl,
    top := ⊤,
    le_top := fun a => (@le_top β _ _ _).trans map_top.ge,
    bot_le := fun a => map_bot.le.trans bot_le,
    inf_compl_le_bot :=
      fun a => ((map_inf _ _).trans <| by rw [map_compl, inf_compl_eq_bot, map_bot]).le,
    top_le_sup_compl :=
      fun a => ((map_sup _ _).trans <| by rw [map_compl, sup_compl_eq_top, map_top]).ge,
    sdiff_eq := fun a b => by
      

Proof state:
α : Type u
β : Type u_1
w x y z : α
inst✝⁶ : Sup α
inst✝⁵ : Inf α
inst✝⁴ : Top α
inst✝³ : Bot α
inst✝² : HasCompl α
inst✝¹ : SDiff α
inst✝ : BooleanAlgebra β
f : α → β
hf : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
map_top : f ⊤ = ⊤
map_bot : f ⊥ = ⊥
map_compl : ∀ (a : α), f aᶜ = (f a)ᶜ
map_sdiff : ∀ (a b : α), f (a \ b) = f a \ f b
src✝ : GeneralizedBooleanAlgebra α := Injective.generalizedBooleanAlgebra f hf map_sup map_inf map_bot map_sdiff
a b : α
⊢ a \ b = a ⊓ bᶜ

Next tactic:
refine hf ((map_sdiff _ _).trans (sdiff_eq.trans ?_))
/-- Pullback a `BooleanAlgebra` along an injection. -/
@[reducible]
protected def Function.Injective.booleanAlgebra [Sup α] [Inf α] [Top α] [Bot α] [HasCompl α]
    [SDiff α] [BooleanAlgebra β] (f : α → β) (hf : Injective f)
    (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b)
    (map_top : f ⊤ = ⊤) (map_bot : f ⊥ = ⊥) (map_compl : ∀ a, f aᶜ = (f a)ᶜ)
    (map_sdiff : ∀ a b, f (a \ b) = f a \ f b) : BooleanAlgebra α :=
  { hf.generalizedBooleanAlgebra f map_sup map_inf map_bot map_sdiff with
    compl := compl,
    top := ⊤,
    le_top := fun a => (@le_top β _ _ _).trans map_top.ge,
    bot_le := fun a => map_bot.le.trans bot_le,
    inf_compl_le_bot :=
      fun a => ((map_inf _ _).trans <| by rw [map_compl, inf_compl_eq_bot, map_bot]).le,
    top_le_sup_compl :=
      fun a => ((map_sup _ _).trans <| by rw [map_compl, sup_compl_eq_top, map_top]).ge,
    sdiff_eq := fun a b => by
      refine hf ((map_sdiff _ _).trans (sdiff_eq.trans ?_))
      

Proof state:
α : Type u
β : Type u_1
w x y z : α
inst✝⁶ : Sup α
inst✝⁵ : Inf α
inst✝⁴ : Top α
inst✝³ : Bot α
inst✝² : HasCompl α
inst✝¹ : SDiff α
inst✝ : BooleanAlgebra β
f : α → β
hf : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
map_top : f ⊤ = ⊤
map_bot : f ⊥ = ⊥
map_compl : ∀ (a : α), f aᶜ = (f a)ᶜ
map_sdiff : ∀ (a b : α), f (a \ b) = f a \ f b
src✝ : GeneralizedBooleanAlgebra α := Injective.generalizedBooleanAlgebra f hf map_sup map_inf map_bot map_sdiff
a b : α
⊢ f a ⊓ (f b)ᶜ = f (a ⊓ bᶜ)

Next tactic:
rw [map_inf, map_compl]
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  

Proof state:
α : Type u
β : Type u_1
w x y z : α
⊢ BooleanAlgebra PUnit.{?u.90848 + 1}

Next tactic:
refine'
  { PUnit.biheytingAlgebra with
    .. }
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (

Proof state:
case refine'_1
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
⊢ ∀ (x y z : PUnit.{?u.90854 + 1}), (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ y ⊓ z

Next tactic:
intros
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (intros; 

Proof state:
case refine'_1
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
x✝ y✝ z✝ : PUnit.{?u.90854 + 1}
⊢ (x✝ ⊔ y✝) ⊓ (x✝ ⊔ z✝) ≤ x✝ ⊔ y✝ ⊓ z✝

Next tactic:
trivial
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (

Proof state:
case refine'_2
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
⊢ ∀ (x : PUnit.{?u.90854 + 1}), x ⊓ xᶜ ≤ ⊥

Next tactic:
intros
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (intros; 

Proof state:
case refine'_2
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
x✝ : PUnit.{?u.90854 + 1}
⊢ x✝ ⊓ x✝ᶜ ≤ ⊥

Next tactic:
trivial
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (

Proof state:
case refine'_3
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
⊢ ∀ (x : PUnit.{?u.90854 + 1}), ⊤ ≤ x ⊔ xᶜ

Next tactic:
intros
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (intros; 

Proof state:
case refine'_3
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
x✝ : PUnit.{?u.90854 + 1}
⊢ ⊤ ≤ x✝ ⊔ x✝ᶜ

Next tactic:
trivial
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (

Proof state:
case refine'_4
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
⊢ ∀ (x y : PUnit.{?u.90854 + 1}), x \ y = x ⊓ yᶜ

Next tactic:
intros
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (intros; 

Proof state:
case refine'_4
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
x✝ y✝ : PUnit.{?u.90854 + 1}
⊢ x✝ \ y✝ = x✝ ⊓ y✝ᶜ

Next tactic:
trivial
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (

Proof state:
case refine'_5
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
⊢ ∀ (x y : PUnit.{?u.90854 + 1}), x ⇨ y = y ⊔ xᶜ

Next tactic:
intros
instance PUnit.booleanAlgebra : BooleanAlgebra PUnit := by
  refine'
  { PUnit.biheytingAlgebra with
    .. } <;> (intros; 

Proof state:
case refine'_5
α : Type u
β : Type u_1
w x y z : α
src✝ : BiheytingAlgebra PUnit.{?u.90854 + 1} := biheytingAlgebra
x✝ y✝ : PUnit.{?u.90854 + 1}
⊢ x✝ ⇨ y✝ = y✝ ⊔ x✝ᶜ

Next tactic:
trivial
theorem continuantsAux_recurrence {gp ppred pred : Pair K} (nth_s_eq : g.s.get? n = some gp)
    (nth_conts_aux_eq : g.continuantsAux n = ppred)
    (succ_nth_conts_aux_eq : g.continuantsAux (n + 1) = pred) :
    g.continuantsAux (n + 2) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩ :=
  by 

Proof state:
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp ppred pred : Pair K
nth_s_eq : Stream'.Seq.get? g.s n = some gp
nth_conts_aux_eq : continuantsAux g n = ppred
succ_nth_conts_aux_eq : continuantsAux g (n + 1) = pred
⊢ continuantsAux g (n + 2) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }

Next tactic:
simp [*, continuantsAux, nextContinuants, nextDenominator, nextNumerator]
theorem continuants_recurrenceAux {gp ppred pred : Pair K} (nth_s_eq : g.s.get? n = some gp)
    (nth_conts_aux_eq : g.continuantsAux n = ppred)
    (succ_nth_conts_aux_eq : g.continuantsAux (n + 1) = pred) :
    g.continuants (n + 1) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩ := by
  

Proof state:
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp ppred pred : Pair K
nth_s_eq : Stream'.Seq.get? g.s n = some gp
nth_conts_aux_eq : continuantsAux g n = ppred
succ_nth_conts_aux_eq : continuantsAux g (n + 1) = pred
⊢ continuants g (n + 1) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }

Next tactic:
simp [nth_cont_eq_succ_nth_cont_aux,
    continuantsAux_recurrence nth_s_eq nth_conts_aux_eq succ_nth_conts_aux_eq]
/-- Shows that `Aₙ = bₙ * Aₙ₋₁ + aₙ * Aₙ₋₂` and `Bₙ = bₙ * Bₙ₋₁ + aₙ * Bₙ₋₂`. -/
theorem continuants_recurrence {gp ppred pred : Pair K} (succ_nth_s_eq : g.s.get? (n + 1) = some gp)
    (nth_conts_eq : g.continuants n = ppred) (succ_nth_conts_eq : g.continuants (n + 1) = pred) :
    g.continuants (n + 2) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩ := by
  

Proof state:
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp ppred pred : Pair K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
nth_conts_eq : continuants g n = ppred
succ_nth_conts_eq : continuants g (n + 1) = pred
⊢ continuants g (n + 2) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }

Next tactic:
rw [nth_cont_eq_succ_nth_cont_aux] at nth_conts_eq succ_nth_conts_eq
/-- Shows that `Aₙ = bₙ * Aₙ₋₁ + aₙ * Aₙ₋₂` and `Bₙ = bₙ * Bₙ₋₁ + aₙ * Bₙ₋₂`. -/
theorem continuants_recurrence {gp ppred pred : Pair K} (succ_nth_s_eq : g.s.get? (n + 1) = some gp)
    (nth_conts_eq : g.continuants n = ppred) (succ_nth_conts_eq : g.continuants (n + 1) = pred) :
    g.continuants (n + 2) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩ := by
  rw [nth_cont_eq_succ_nth_cont_aux] at nth_conts_eq succ_nth_conts_eq
  

Proof state:
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp ppred pred : Pair K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
nth_conts_eq : continuantsAux g (n + 1) = ppred
succ_nth_conts_eq : continuantsAux g (n + 1 + 1) = pred
⊢ continuants g (n + 2) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }

Next tactic:
exact continuants_recurrenceAux succ_nth_s_eq nth_conts_eq succ_nth_conts_eq
/-- Shows that `Aₙ = bₙ * Aₙ₋₁ + aₙ * Aₙ₋₂`. -/
theorem numerators_recurrence {gp : Pair K} {ppredA predA : K}
    (succ_nth_s_eq : g.s.get? (n + 1) = some gp) (nth_num_eq : g.numerators n = ppredA)
    (succ_nth_num_eq : g.numerators (n + 1) = predA) :
    g.numerators (n + 2) = gp.b * predA + gp.a * ppredA := by
  

Proof state:
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp : Pair K
ppredA predA : K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
nth_num_eq : numerators g n = ppredA
succ_nth_num_eq : numerators g (n + 1) = predA
⊢ numerators g (n + 2) = gp.b * predA + gp.a * ppredA

Next tactic:
obtain ⟨ppredConts, nth_conts_eq, ⟨rfl⟩⟩ : ∃ conts, g.continuants n = conts ∧ conts.a = ppredA
/-- Shows that `Aₙ = bₙ * Aₙ₋₁ + aₙ * Aₙ₋₂`. -/
theorem numerators_recurrence {gp : Pair K} {ppredA predA : K}
    (succ_nth_s_eq : g.s.get? (n + 1) = some gp) (nth_num_eq : g.numerators n = ppredA)
    (succ_nth_num_eq : g.numerators (n + 1) = predA) :
    g.numerators (n + 2) = gp.b * predA + gp.a * ppredA := by
  obtain ⟨ppredConts, nth_conts_eq, ⟨rfl⟩⟩ : ∃ conts, g.continuants n = conts ∧ conts.a = ppredA
  

Proof state:
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp : Pair K
ppredA predA : K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
nth_num_eq : numerators g n = ppredA
succ_nth_num_eq : numerators g (n + 1) = predA
⊢ ∃ conts, continuants g n = conts ∧ conts.a = ppredA
case intro.intro.refl
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp : Pair K
predA : K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
succ_nth_num_eq : numerators g (n + 1) = predA
ppredConts : Pair K
nth_conts_eq : continuants g n = ppredConts
nth_num_eq : numerators g n = ppredConts.a
⊢ numerators g (n + 2) = gp.b * predA + gp.a * ppredConts.a

Next tactic:
exact exists_conts_a_of_num nth_num_eq
/-- Shows that `Aₙ = bₙ * Aₙ₋₁ + aₙ * Aₙ₋₂`. -/
theorem numerators_recurrence {gp : Pair K} {ppredA predA : K}
    (succ_nth_s_eq : g.s.get? (n + 1) = some gp) (nth_num_eq : g.numerators n = ppredA)
    (succ_nth_num_eq : g.numerators (n + 1) = predA) :
    g.numerators (n + 2) = gp.b * predA + gp.a * ppredA := by
  obtain ⟨ppredConts, nth_conts_eq, ⟨rfl⟩⟩ : ∃ conts, g.continuants n = conts ∧ conts.a = ppredA
  exact exists_conts_a_of_num nth_num_eq
  

Proof state:
case intro.intro.refl
K : Type u_1
g : GeneralizedContinuedFraction K
n : ℕ
inst✝ : DivisionRing K
gp : Pair K
predA : K
succ_nth_s_eq : Stream'.Seq.get? g.s (n + 1) = some gp
succ_nth_num_eq : numerators g (n + 1) = predA
ppredConts : Pair K
nth_conts_eq : continuants g n = ppredConts
nth_num_eq : numerators g n = ppredConts.a
⊢ numerators g (n + 2) = gp.b * predA + gp.a * ppredConts.a

Next tactic:
obtain ⟨predConts, succ_nth_conts_eq, ⟨rfl⟩⟩ :
    ∃ conts, g.continuants (n + 1) = conts ∧ conts.a = predA