l3lab/ntp-mathlib huggingface dataset:
instance : CstarRing (α →ᵇ β) where
  norm_star_mul_self := by
    intro f
    refine' le_antisymm _ _
    · rw [← sq, norm_le (sq_nonneg _)]
      dsimp [star_apply]
      intro x
      rw [CstarRing.norm_star_mul_self, ← sq]
      refine' sq_le_sq' _ _
      · linarith [norm_nonneg (f x), norm_nonneg f]
      · exact norm_coe_le_norm f x
    · rw [← sq, ← Real.le_sqrt (norm_nonneg _) (norm_nonneg _), norm_le (Real.sqrt_nonneg _)]
      

Proof state:
case refine'_2
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNormedRing β
inst✝¹ : StarRing β
inst✝ : CstarRing β
f : α →ᵇ β
⊢ ∀ (x : α), ‖f x‖ ≤ Real.sqrt ‖star f * f‖

Next tactic:
intro x
instance : CstarRing (α →ᵇ β) where
  norm_star_mul_self := by
    intro f
    refine' le_antisymm _ _
    · rw [← sq, norm_le (sq_nonneg _)]
      dsimp [star_apply]
      intro x
      rw [CstarRing.norm_star_mul_self, ← sq]
      refine' sq_le_sq' _ _
      · linarith [norm_nonneg (f x), norm_nonneg f]
      · exact norm_coe_le_norm f x
    · rw [← sq, ← Real.le_sqrt (norm_nonneg _) (norm_nonneg _), norm_le (Real.sqrt_nonneg _)]
      intro x
      

Proof state:
case refine'_2
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNormedRing β
inst✝¹ : StarRing β
inst✝ : CstarRing β
f : α →ᵇ β
x : α
⊢ ‖f x‖ ≤ Real.sqrt ‖star f * f‖

Next tactic:
rw [Real.le_sqrt (norm_nonneg _) (norm_nonneg _), sq, ← CstarRing.norm_star_mul_self]
instance : CstarRing (α →ᵇ β) where
  norm_star_mul_self := by
    intro f
    refine' le_antisymm _ _
    · rw [← sq, norm_le (sq_nonneg _)]
      dsimp [star_apply]
      intro x
      rw [CstarRing.norm_star_mul_self, ← sq]
      refine' sq_le_sq' _ _
      · linarith [norm_nonneg (f x), norm_nonneg f]
      · exact norm_coe_le_norm f x
    · rw [← sq, ← Real.le_sqrt (norm_nonneg _) (norm_nonneg _), norm_le (Real.sqrt_nonneg _)]
      intro x
      rw [Real.le_sqrt (norm_nonneg _) (norm_nonneg _), sq, ← CstarRing.norm_star_mul_self]
      

Proof state:
case refine'_2
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝³ : TopologicalSpace α
inst✝² : NonUnitalNormedRing β
inst✝¹ : StarRing β
inst✝ : CstarRing β
f : α →ᵇ β
x : α
⊢ ‖star (f x) * f x‖ ≤ ‖star f * f‖

Next tactic:
exact norm_coe_le_norm (star f * f) x
instance partialOrder : PartialOrder (α →ᵇ β) :=
  PartialOrder.lift (fun f => f.toFun) (by 

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
⊢ Injective fun f => f.toFun

Next tactic:
simp [Injective]
/-- Continuous normed lattice group valued functions form a meet-semilattice. -/
instance semilatticeInf : SemilatticeInf (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    inf := fun f g =>
      { toFun := fun t => f t ⊓ g t
        continuous_toFun := f.continuous.inf g.continuous
        map_bounded' := by
          

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
⊢ ∃ C,
    ∀ (x y : α),
      dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) x)
          (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) y) ≤
        C

Next tactic:
obtain ⟨C₁, hf⟩ := f.bounded
/-- Continuous normed lattice group valued functions form a meet-semilattice. -/
instance semilatticeInf : SemilatticeInf (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    inf := fun f g =>
      { toFun := fun t => f t ⊓ g t
        continuous_toFun := f.continuous.inf g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          

Proof state:
case intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ : ℝ
hf : ∀ (x y : α), dist (f x) (f y) ≤ C₁
⊢ ∃ C,
    ∀ (x y : α),
      dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) x)
          (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) y) ≤
        C

Next tactic:
obtain ⟨C₂, hg⟩ := g.bounded
/-- Continuous normed lattice group valued functions form a meet-semilattice. -/
instance semilatticeInf : SemilatticeInf (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    inf := fun f g =>
      { toFun := fun t => f t ⊓ g t
        continuous_toFun := f.continuous.inf g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          obtain ⟨C₂, hg⟩ := g.bounded
          

Proof state:
case intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ : ℝ
hf : ∀ (x y : α), dist (f x) (f y) ≤ C₁
C₂ : ℝ
hg : ∀ (x y : α), dist (g x) (g y) ≤ C₂
⊢ ∃ C,
    ∀ (x y : α),
      dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) x)
          (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) y) ≤
        C

Next tactic:
refine' ⟨C₁ + C₂, fun x y => _⟩
/-- Continuous normed lattice group valued functions form a meet-semilattice. -/
instance semilatticeInf : SemilatticeInf (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    inf := fun f g =>
      { toFun := fun t => f t ⊓ g t
        continuous_toFun := f.continuous.inf g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          obtain ⟨C₂, hg⟩ := g.bounded
          refine' ⟨C₁ + C₂, fun x y => _⟩
          

Proof state:
case intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ : ℝ
hf : ∀ (x y : α), dist (f x) (f y) ≤ C₁
C₂ : ℝ
hg : ∀ (x y : α), dist (g x) (g y) ≤ C₂
x y : α
⊢ dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) x)
      (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊓ g t) y) ≤
    C₁ + C₂

Next tactic:
simp_rw [NormedAddCommGroup.dist_eq] at hf hg ⊢
/-- Continuous normed lattice group valued functions form a meet-semilattice. -/
instance semilatticeInf : SemilatticeInf (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    inf := fun f g =>
      { toFun := fun t => f t ⊓ g t
        continuous_toFun := f.continuous.inf g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          obtain ⟨C₂, hg⟩ := g.bounded
          refine' ⟨C₁ + C₂, fun x y => _⟩
          simp_rw [NormedAddCommGroup.dist_eq] at hf hg ⊢
          

Proof state:
case intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ C₂ : ℝ
x y : α
hf : ∀ (x y : α), ‖f x - f y‖ ≤ C₁
hg : ∀ (x y : α), ‖g x - g y‖ ≤ C₂
⊢ ‖f x ⊓ g x - f y ⊓ g y‖ ≤ C₁ + C₂

Next tactic:
exact (norm_inf_sub_inf_le_add_norm _ _ _ _).trans (add_le_add (hf _ _) (hg _ _))
instance semilatticeSup : SemilatticeSup (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    sup := fun f g =>
      { toFun := fun t => f t ⊔ g t
        continuous_toFun := f.continuous.sup g.continuous
        map_bounded' := by
          

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
⊢ ∃ C,
    ∀ (x y : α),
      dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) x)
          (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) y) ≤
        C

Next tactic:
obtain ⟨C₁, hf⟩ := f.bounded
instance semilatticeSup : SemilatticeSup (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    sup := fun f g =>
      { toFun := fun t => f t ⊔ g t
        continuous_toFun := f.continuous.sup g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          

Proof state:
case intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ : ℝ
hf : ∀ (x y : α), dist (f x) (f y) ≤ C₁
⊢ ∃ C,
    ∀ (x y : α),
      dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) x)
          (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) y) ≤
        C

Next tactic:
obtain ⟨C₂, hg⟩ := g.bounded
instance semilatticeSup : SemilatticeSup (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    sup := fun f g =>
      { toFun := fun t => f t ⊔ g t
        continuous_toFun := f.continuous.sup g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          obtain ⟨C₂, hg⟩ := g.bounded
          

Proof state:
case intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ : ℝ
hf : ∀ (x y : α), dist (f x) (f y) ≤ C₁
C₂ : ℝ
hg : ∀ (x y : α), dist (g x) (g y) ≤ C₂
⊢ ∃ C,
    ∀ (x y : α),
      dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) x)
          (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) y) ≤
        C

Next tactic:
refine' ⟨C₁ + C₂, fun x y => _⟩
instance semilatticeSup : SemilatticeSup (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    sup := fun f g =>
      { toFun := fun t => f t ⊔ g t
        continuous_toFun := f.continuous.sup g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          obtain ⟨C₂, hg⟩ := g.bounded
          refine' ⟨C₁ + C₂, fun x y => _⟩
          

Proof state:
case intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ : ℝ
hf : ∀ (x y : α), dist (f x) (f y) ≤ C₁
C₂ : ℝ
hg : ∀ (x y : α), dist (g x) (g y) ≤ C₂
x y : α
⊢ dist (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) x)
      (ContinuousMap.toFun (ContinuousMap.mk fun t => f t ⊔ g t) y) ≤
    C₁ + C₂

Next tactic:
simp_rw [NormedAddCommGroup.dist_eq] at hf hg ⊢
instance semilatticeSup : SemilatticeSup (α →ᵇ β) :=
  { BoundedContinuousFunction.partialOrder with
    sup := fun f g =>
      { toFun := fun t => f t ⊔ g t
        continuous_toFun := f.continuous.sup g.continuous
        map_bounded' := by
          obtain ⟨C₁, hf⟩ := f.bounded
          obtain ⟨C₂, hg⟩ := g.bounded
          refine' ⟨C₁ + C₂, fun x y => _⟩
          simp_rw [NormedAddCommGroup.dist_eq] at hf hg ⊢
          

Proof state:
case intro.intro
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝ : PartialOrder (α →ᵇ β) := partialOrder
f g : α →ᵇ β
C₁ C₂ : ℝ
x y : α
hf : ∀ (x y : α), ‖f x - f y‖ ≤ C₁
hg : ∀ (x y : α), ‖g x - g y‖ ≤ C₂
⊢ ‖f x ⊔ g x - f y ⊔ g y‖ ≤ C₁ + C₂

Next tactic:
exact (norm_sup_sub_sup_le_add_norm _ _ _ _).trans (add_le_add (hf _ _) (hg _ _))
instance : NormedLatticeAddCommGroup (α →ᵇ β) :=
  { BoundedContinuousFunction.lattice,
    BoundedContinuousFunction.seminormedAddCommGroup with
    add_le_add_left := by
      intro f g h₁ h t
      simp only [coe_to_continuous_fun, Pi.add_apply, add_le_add_iff_left, coe_add,
        ContinuousMap.toFun_eq_coe]
      exact h₁ _
    solid := by
      

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝¹ : Lattice (α →ᵇ β) := lattice
src✝ : SeminormedAddCommGroup (α →ᵇ β) := seminormedAddCommGroup
⊢ ∀ ⦃x y : α →ᵇ β⦄, |x| ≤ |y| → ‖x‖ ≤ ‖y‖

Next tactic:
intro f g h
instance : NormedLatticeAddCommGroup (α →ᵇ β) :=
  { BoundedContinuousFunction.lattice,
    BoundedContinuousFunction.seminormedAddCommGroup with
    add_le_add_left := by
      intro f g h₁ h t
      simp only [coe_to_continuous_fun, Pi.add_apply, add_le_add_iff_left, coe_add,
        ContinuousMap.toFun_eq_coe]
      exact h₁ _
    solid := by
      intro f g h
      

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝¹ : Lattice (α →ᵇ β) := lattice
src✝ : SeminormedAddCommGroup (α →ᵇ β) := seminormedAddCommGroup
f g : α →ᵇ β
h : |f| ≤ |g|
⊢ ‖f‖ ≤ ‖g‖

Next tactic:
have i1 : ∀ t, ‖f t‖ ≤ ‖g t‖ := fun t => HasSolidNorm.solid (h t)
instance : NormedLatticeAddCommGroup (α →ᵇ β) :=
  { BoundedContinuousFunction.lattice,
    BoundedContinuousFunction.seminormedAddCommGroup with
    add_le_add_left := by
      intro f g h₁ h t
      simp only [coe_to_continuous_fun, Pi.add_apply, add_le_add_iff_left, coe_add,
        ContinuousMap.toFun_eq_coe]
      exact h₁ _
    solid := by
      intro f g h
      have i1 : ∀ t, ‖f t‖ ≤ ‖g t‖ := fun t => HasSolidNorm.solid (h t)
      

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝¹ : Lattice (α →ᵇ β) := lattice
src✝ : SeminormedAddCommGroup (α →ᵇ β) := seminormedAddCommGroup
f g : α →ᵇ β
h : |f| ≤ |g|
i1 : ∀ (t : α), ‖f t‖ ≤ ‖g t‖
⊢ ‖f‖ ≤ ‖g‖

Next tactic:
rw [norm_le (norm_nonneg _)]
instance : NormedLatticeAddCommGroup (α →ᵇ β) :=
  { BoundedContinuousFunction.lattice,
    BoundedContinuousFunction.seminormedAddCommGroup with
    add_le_add_left := by
      intro f g h₁ h t
      simp only [coe_to_continuous_fun, Pi.add_apply, add_le_add_iff_left, coe_add,
        ContinuousMap.toFun_eq_coe]
      exact h₁ _
    solid := by
      intro f g h
      have i1 : ∀ t, ‖f t‖ ≤ ‖g t‖ := fun t => HasSolidNorm.solid (h t)
      rw [norm_le (norm_nonneg _)]
      

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝¹ : Lattice (α →ᵇ β) := lattice
src✝ : SeminormedAddCommGroup (α →ᵇ β) := seminormedAddCommGroup
f g : α →ᵇ β
h : |f| ≤ |g|
i1 : ∀ (t : α), ‖f t‖ ≤ ‖g t‖
⊢ ∀ (x : α), ‖f x‖ ≤ ‖g‖

Next tactic:
exact fun t => (i1 t).trans (norm_coe_le_norm g t)
instance : NormedLatticeAddCommGroup (α →ᵇ β) :=
  { BoundedContinuousFunction.lattice,
    BoundedContinuousFunction.seminormedAddCommGroup with
    add_le_add_left := by
      

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝¹ : Lattice (α →ᵇ β) := lattice
src✝ : SeminormedAddCommGroup (α →ᵇ β) := seminormedAddCommGroup
⊢ ∀ (a b : α →ᵇ β), a ≤ b → ∀ (c : α →ᵇ β), c + a ≤ c + b

Next tactic:
intro f g h₁ h t
instance : NormedLatticeAddCommGroup (α →ᵇ β) :=
  { BoundedContinuousFunction.lattice,
    BoundedContinuousFunction.seminormedAddCommGroup with
    add_le_add_left := by
      intro f g h₁ h t
      

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝¹ : Lattice (α →ᵇ β) := lattice
src✝ : SeminormedAddCommGroup (α →ᵇ β) := seminormedAddCommGroup
f g : α →ᵇ β
h₁ : f ≤ g
h : α →ᵇ β
t : α
⊢ (fun f => f.toFun) (h + f) t ≤ (fun f => f.toFun) (h + g) t

Next tactic:
simp only [coe_to_continuous_fun, Pi.add_apply, add_le_add_iff_left, coe_add,
        ContinuousMap.toFun_eq_coe]
instance : NormedLatticeAddCommGroup (α →ᵇ β) :=
  { BoundedContinuousFunction.lattice,
    BoundedContinuousFunction.seminormedAddCommGroup with
    add_le_add_left := by
      intro f g h₁ h t
      simp only [coe_to_continuous_fun, Pi.add_apply, add_le_add_iff_left, coe_add,
        ContinuousMap.toFun_eq_coe]
      

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝¹ : TopologicalSpace α
inst✝ : NormedLatticeAddCommGroup β
src✝¹ : Lattice (α →ᵇ β) := lattice
src✝ : SeminormedAddCommGroup (α →ᵇ β) := seminormedAddCommGroup
f g : α →ᵇ β
h₁ : f ≤ g
h : α →ᵇ β
t : α
⊢ f t ≤ g t

Next tactic:
exact h₁ _
/-- Decompose a bounded continuous function to its positive and negative parts. -/
theorem self_eq_nnrealPart_sub_nnrealPart_neg (f : α →ᵇ ℝ) :
    ⇑f = (↑) ∘ f.nnrealPart - (↑) ∘ (-f).nnrealPart := by
  

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
⊢ ⇑f = toReal ∘ ⇑(nnrealPart f) - toReal ∘ ⇑(nnrealPart (-f))

Next tactic:
funext x
/-- Decompose a bounded continuous function to its positive and negative parts. -/
theorem self_eq_nnrealPart_sub_nnrealPart_neg (f : α →ᵇ ℝ) :
    ⇑f = (↑) ∘ f.nnrealPart - (↑) ∘ (-f).nnrealPart := by
  funext x
  

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ f x = (toReal ∘ ⇑(nnrealPart f) - toReal ∘ ⇑(nnrealPart (-f))) x

Next tactic:
dsimp
/-- Decompose a bounded continuous function to its positive and negative parts. -/
theorem self_eq_nnrealPart_sub_nnrealPart_neg (f : α →ᵇ ℝ) :
    ⇑f = (↑) ∘ f.nnrealPart - (↑) ∘ (-f).nnrealPart := by
  funext x
  dsimp
  

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ f x = max (f x) 0 - max (-f x) 0

Next tactic:
simp only [max_zero_sub_max_neg_zero_eq_self]
/-- Express the absolute value of a bounded continuous function in terms of its
positive and negative parts. -/
theorem abs_self_eq_nnrealPart_add_nnrealPart_neg (f : α →ᵇ ℝ) :
    abs ∘ ⇑f = (↑) ∘ f.nnrealPart + (↑) ∘ (-f).nnrealPart := by
  

Proof state:
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
⊢ abs ∘ ⇑f = toReal ∘ ⇑(nnrealPart f) + toReal ∘ ⇑(nnrealPart (-f))

Next tactic:
funext x
/-- Express the absolute value of a bounded continuous function in terms of its
positive and negative parts. -/
theorem abs_self_eq_nnrealPart_add_nnrealPart_neg (f : α →ᵇ ℝ) :
    abs ∘ ⇑f = (↑) ∘ f.nnrealPart + (↑) ∘ (-f).nnrealPart := by
  funext x
  

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ (abs ∘ ⇑f) x = (toReal ∘ ⇑(nnrealPart f) + toReal ∘ ⇑(nnrealPart (-f))) x

Next tactic:
dsimp
/-- Express the absolute value of a bounded continuous function in terms of its
positive and negative parts. -/
theorem abs_self_eq_nnrealPart_add_nnrealPart_neg (f : α →ᵇ ℝ) :
    abs ∘ ⇑f = (↑) ∘ f.nnrealPart + (↑) ∘ (-f).nnrealPart := by
  funext x
  dsimp
  

Proof state:
case h
F : Type u_1
α : Type u
β : Type v
γ : Type w
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ |f x| = max (f x) 0 + max (-f x) 0

Next tactic:
simp only [max_zero_add_max_neg_zero_eq_abs_self]
lemma add_norm_nonneg (f : α →ᵇ ℝ) :
    0 ≤ f + const _ ‖f‖ := by
  

Proof state:
F : Type u_1
α✝ : Type u
β : Type v
γ : Type w
α : Type u_2
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
⊢ 0 ≤ f + const α ‖f‖

Next tactic:
intro x
lemma add_norm_nonneg (f : α →ᵇ ℝ) :
    0 ≤ f + const _ ‖f‖ := by
  intro x
  

Proof state:
F : Type u_1
α✝ : Type u
β : Type v
γ : Type w
α : Type u_2
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ (fun f => f.toFun) 0 x ≤ (fun f => f.toFun) (f + const α ‖f‖) x

Next tactic:
dsimp
lemma add_norm_nonneg (f : α →ᵇ ℝ) :
    0 ≤ f + const _ ‖f‖ := by
  intro x
  dsimp
  

Proof state:
F : Type u_1
α✝ : Type u
β : Type v
γ : Type w
α : Type u_2
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ 0 ≤ f x + ‖f‖

Next tactic:
linarith [(abs_le.mp (norm_coe_le_norm f x)).1]
lemma norm_sub_nonneg (f : α →ᵇ ℝ) :
    0 ≤ const _ ‖f‖ - f := by
  

Proof state:
F : Type u_1
α✝ : Type u
β : Type v
γ : Type w
α : Type u_2
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
⊢ 0 ≤ const α ‖f‖ - f

Next tactic:
intro x
lemma norm_sub_nonneg (f : α →ᵇ ℝ) :
    0 ≤ const _ ‖f‖ - f := by
  intro x
  

Proof state:
F : Type u_1
α✝ : Type u
β : Type v
γ : Type w
α : Type u_2
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ (fun f => f.toFun) 0 x ≤ (fun f => f.toFun) (const α ‖f‖ - f) x

Next tactic:
dsimp
lemma norm_sub_nonneg (f : α →ᵇ ℝ) :
    0 ≤ const _ ‖f‖ - f := by
  intro x
  dsimp
  

Proof state:
F : Type u_1
α✝ : Type u
β : Type v
γ : Type w
α : Type u_2
inst✝ : TopologicalSpace α
f : α →ᵇ ℝ
x : α
⊢ 0 ≤ ‖f‖ - f x

Next tactic:
linarith [(abs_le.mp (norm_coe_le_norm f x)).2]
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by 

Proof state:
⊢ SuccOrder (Fin 0)

Next tactic:
constructor
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> 

Proof state:
case le_succ
⊢ ∀ (a : Fin 0), a ≤ ?succ a

Next tactic:
first | assumption | intro a; exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | 

Proof state:
case le_succ
⊢ ∀ (a : Fin 0), a ≤ ?succ a

Next tactic:
assumption
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | 

Proof state:
case le_succ
⊢ ∀ (a : Fin 0), a ≤ ?succ a

Next tactic:
intro a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | intro a; 

Proof state:
case le_succ
a : Fin 0
⊢ a ≤ ?succ a

Next tactic:
exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> 

Proof state:
case max_of_succ_le
⊢ ∀ {a : Fin 0}, ?succ a ≤ a → IsMax a

Next tactic:
first | assumption | intro a; exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | 

Proof state:
case max_of_succ_le
⊢ ∀ {a : Fin 0}, ?succ a ≤ a → IsMax a

Next tactic:
assumption
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | 

Proof state:
case max_of_succ_le
⊢ ∀ {a : Fin 0}, ?succ a ≤ a → IsMax a

Next tactic:
intro a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | intro a; 

Proof state:
case max_of_succ_le
a : Fin 0
⊢ ?succ a ≤ a → IsMax a

Next tactic:
exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> 

Proof state:
case succ_le_of_lt
⊢ ∀ {a b : Fin 0}, a < b → ?succ a ≤ b

Next tactic:
first | assumption | intro a; exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | 

Proof state:
case succ_le_of_lt
⊢ ∀ {a b : Fin 0}, a < b → ?succ a ≤ b

Next tactic:
assumption
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | 

Proof state:
case succ_le_of_lt
⊢ ∀ {a b : Fin 0}, a < b → ?succ a ≤ b

Next tactic:
intro a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | intro a; 

Proof state:
case succ_le_of_lt
a : Fin 0
⊢ ∀ {b : Fin 0}, a < b → ?succ a ≤ b

Next tactic:
exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> 

Proof state:
case le_of_lt_succ
⊢ ∀ {a b : Fin 0}, a < ?succ b → a ≤ b

Next tactic:
first | assumption | intro a; exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | 

Proof state:
case le_of_lt_succ
⊢ ∀ {a b : Fin 0}, a < ?succ b → a ≤ b

Next tactic:
assumption
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | 

Proof state:
case le_of_lt_succ
⊢ ∀ {a b : Fin 0}, a < ?succ b → a ≤ b

Next tactic:
intro a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | intro a; 

Proof state:
case le_of_lt_succ
a : Fin 0
⊢ ∀ {b : Fin 0}, a < ?succ b → a ≤ b

Next tactic:
exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> 

Proof state:
case succ
⊢ Fin 0 → Fin 0

Next tactic:
first | assumption | intro a; exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | 

Proof state:
case succ
⊢ Fin 0 → Fin 0

Next tactic:
assumption
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | 

Proof state:
case succ
⊢ Fin 0 → Fin 0

Next tactic:
intro a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | intro a; 

Proof state:
case succ
a : Fin 0
⊢ Fin 0

Next tactic:
exact elim0 a
instance : ∀ {n : ℕ}, SuccOrder (Fin n)
  | 0 => by constructor <;> first | assumption | intro a; exact elim0 a
  | n + 1 =>
    SuccOrder.ofCore (fun i => if i < Fin.last n then i + 1 else i)
      (by
        

Proof state:
n : ℕ
⊢ ∀ {a : Fin (n + 1)}, ¬IsMax a → ∀ (b : Fin (n + 1)), a < b ↔ (fun i => if i < last n then i + 1 else i) a ≤ b

Next tactic:
intro a ha b