l3lab/ntp-mathlib huggingface dataset:
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> 

Proof state:
case h.inr
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
e' : PartialHomeomorph (↑(Icc x y)) (EuclideanHalfSpace 1)
he' : e' ∈ ChartedSpace.atlas
⊢ ContDiffOn ℝ ⊤
    (↑(modelWithCornersEuclideanHalfSpace 1) ∘
      ↑(PartialHomeomorph.symm (IccRightChart x y) ≫ₕ e') ∘
        ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
    (↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)) ⁻¹'
        (PartialHomeomorph.symm (IccRightChart x y) ≫ₕ e').toPartialEquiv.source ∩
      range ↑(modelWithCornersEuclideanHalfSpace 1))

Next tactic:
rcases he' with (rfl | rfl)
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    

Proof state:
case h.inl.inl
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
⊢ ContDiffOn ℝ ⊤
    (↑(modelWithCornersEuclideanHalfSpace 1) ∘
      ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccLeftChart x y) ∘
        ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
    (↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)) ⁻¹'
        (PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccLeftChart x y).toPartialEquiv.source ∩
      range ↑(modelWithCornersEuclideanHalfSpace 1))

Next tactic:
exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    

Proof state:
case h.inl.inr
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
⊢ ContDiffOn ℝ ⊤
    (↑(modelWithCornersEuclideanHalfSpace 1) ∘
      ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y) ∘
        ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
    (↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)) ⁻¹'
        (PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y).toPartialEquiv.source ∩
      range ↑(modelWithCornersEuclideanHalfSpace 1))

Next tactic:
apply M.contDiffOn.congr
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    

Proof state:
case h.inl.inr
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
⊢ ∀
    x_1 ∈
      ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)) ⁻¹'
          (PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y).toPartialEquiv.source ∩
        range ↑(modelWithCornersEuclideanHalfSpace 1),
    (↑(modelWithCornersEuclideanHalfSpace 1) ∘
          ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y) ∘
            ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
        x_1 =
      (fun this => this) (fun z i => -z i + (y - x)) x_1

Next tactic:
rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    

Proof state:
case h.inl.inr.intro.intro.intro.mk
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
z : EuclideanSpace ℝ (Fin 1)
hz₀ : 0 ≤ z 0
hz₁ :
  ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) ∈
    (PartialHomeomorph.symm (PartialHomeomorph.symm (IccLeftChart x y))).toPartialEquiv.target
hz₂ :
  ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) ∈
    ↑(PartialHomeomorph.symm (PartialHomeomorph.symm (PartialHomeomorph.symm (IccLeftChart x y)))) ⁻¹'
      (IccRightChart x y).toPartialEquiv.source
⊢ (↑(modelWithCornersEuclideanHalfSpace 1) ∘
        ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y) ∘
          ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) =
    (fun this => this) (fun z i => -z i + (y - x))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ })

Next tactic:
simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
    

Proof state:
case h.inl.inr.intro.intro.intro.mk
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
z : EuclideanSpace ℝ (Fin 1)
hz₀ : 0 ≤ z 0
hz₁ : z 0 + x < y
hz₂ : x < min (z 0 + x) y
⊢ (↑(modelWithCornersEuclideanHalfSpace 1) ∘
        ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y) ∘
          ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) =
    (fun this => this) (fun z i => -z i + (y - x))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ })

Next tactic:
rw [min_eq_left hz₁.le, lt_add_iff_pos_left] at hz₂
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
    rw [min_eq_left hz₁.le, lt_add_iff_pos_left] at hz₂
    

Proof state:
case h.inl.inr.intro.intro.intro.mk
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
z : EuclideanSpace ℝ (Fin 1)
hz₀ : 0 ≤ z 0
hz₁ : z 0 + x < y
hz₂ : 0 < z 0
⊢ (↑(modelWithCornersEuclideanHalfSpace 1) ∘
        ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y) ∘
          ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) =
    (fun this => this) (fun z i => -z i + (y - x))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ })

Next tactic:
ext i
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
    rw [min_eq_left hz₁.le, lt_add_iff_pos_left] at hz₂
    ext i
    

Proof state:
case h.inl.inr.intro.intro.intro.mk.h
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
z : EuclideanSpace ℝ (Fin 1)
hz₀ : 0 ≤ z 0
hz₁ : z 0 + x < y
hz₂ : 0 < z 0
i : Fin 1
⊢ (↑(modelWithCornersEuclideanHalfSpace 1) ∘
        ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y) ∘
          ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) i =
    (fun this => this) (fun z i => -z i + (y - x))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) i

Next tactic:
rw [Subsingleton.elim i 0]
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
    rw [min_eq_left hz₁.le, lt_add_iff_pos_left] at hz₂
    ext i
    rw [Subsingleton.elim i 0]
    

Proof state:
case h.inl.inr.intro.intro.intro.mk.h
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
z : EuclideanSpace ℝ (Fin 1)
hz₀ : 0 ≤ z 0
hz₁ : z 0 + x < y
hz₂ : 0 < z 0
i : Fin 1
⊢ (↑(modelWithCornersEuclideanHalfSpace 1) ∘
        ↑(PartialHomeomorph.symm (IccLeftChart x y) ≫ₕ IccRightChart x y) ∘
          ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) 0 =
    (fun this => this) (fun z i => -z i + (y - x))
      (↑(modelWithCornersEuclideanHalfSpace 1) { val := z, property := hz₀ }) 0

Next tactic:
simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, *, PiLp.add_apply,
      PiLp.neg_apply, max_eq_left, min_eq_left hz₁.le, update_same, mfld_simps]
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
    rw [min_eq_left hz₁.le, lt_add_iff_pos_left] at hz₂
    ext i
    rw [Subsingleton.elim i 0]
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, *, PiLp.add_apply,
      PiLp.neg_apply, max_eq_left, min_eq_left hz₁.le, update_same, mfld_simps]
    

Proof state:
case h.inl.inr.intro.intro.intro.mk.h
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
z : EuclideanSpace ℝ (Fin 1)
hz₀ : 0 ≤ z 0
hz₁ : z 0 + x < y
hz₂ : 0 < z 0
i : Fin 1
⊢ y - (z 0 + x) = -z 0 + (y - x)

Next tactic:
abel
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
    rw [min_eq_left hz₁.le, lt_add_iff_pos_left] at hz₂
    ext i
    rw [Subsingleton.elim i 0]
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, *, PiLp.add_apply,
      PiLp.neg_apply, max_eq_left, min_eq_left hz₁.le, update_same, mfld_simps]
    abel
  · -- `e = right chart`, `e' = left chart`
    

Proof state:
case h.inr.inl
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
⊢ ContDiffOn ℝ ⊤
    (↑(modelWithCornersEuclideanHalfSpace 1) ∘
      ↑(PartialHomeomorph.symm (IccRightChart x y) ≫ₕ IccLeftChart x y) ∘
        ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
    (↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)) ⁻¹'
        (PartialHomeomorph.symm (IccRightChart x y) ≫ₕ IccLeftChart x y).toPartialEquiv.source ∩
      range ↑(modelWithCornersEuclideanHalfSpace 1))

Next tactic:
apply M.contDiffOn.congr
/-- The manifold structure on `[x, y]` is smooth.
-/
instance Icc_smooth_manifold (x y : ℝ) [Fact (x < y)] :
    SmoothManifoldWithCorners (𝓡∂ 1) (Icc x y) := by
  have M : ContDiff ℝ ∞ (show EuclideanSpace ℝ (Fin 1) → EuclideanSpace ℝ (Fin 1)
      from fun z i => -z i + (y - x)) :=
    contDiff_id.neg.add contDiff_const
  apply smoothManifoldWithCorners_of_contDiffOn
  intro e e' he he'
  simp only [atlas, mem_singleton_iff, mem_insert_iff] at he he'
  /- We need to check that any composition of two charts gives a `C^∞` function. Each chart can be
  either the left chart or the right chart, leaving 4 possibilities that we handle successively. -/
  rcases he with (rfl | rfl) <;> rcases he' with (rfl | rfl)
  · -- `e = left chart`, `e' = left chart`
    exact (mem_groupoid_of_pregroupoid.mpr (symm_trans_mem_contDiffGroupoid _ _ _)).1
  · -- `e = left chart`, `e' = right chart`
    apply M.contDiffOn.congr
    rintro _ ⟨⟨hz₁, hz₂⟩, ⟨⟨z, hz₀⟩, rfl⟩⟩
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, update_same,
      max_eq_left, hz₀, lt_sub_iff_add_lt, mfld_simps] at hz₁ hz₂
    rw [min_eq_left hz₁.le, lt_add_iff_pos_left] at hz₂
    ext i
    rw [Subsingleton.elim i 0]
    simp only [modelWithCornersEuclideanHalfSpace, IccLeftChart, IccRightChart, *, PiLp.add_apply,
      PiLp.neg_apply, max_eq_left, min_eq_left hz₁.le, update_same, mfld_simps]
    abel
  · -- `e = right chart`, `e' = left chart`
    apply M.contDiffOn.congr
    

Proof state:
case h.inr.inl
x y : ℝ
inst✝ : Fact (x < y)
M :
  ContDiff ℝ ⊤
    (let_fun this := fun z i => -z i + (y - x);
    this)
⊢ ∀
    x_1 ∈
      ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)) ⁻¹'
          (PartialHomeomorph.symm (IccRightChart x y) ≫ₕ IccLeftChart x y).toPartialEquiv.source ∩
        range ↑(modelWithCornersEuclideanHalfSpace 1),
    (↑(modelWithCornersEuclideanHalfSpace 1) ∘
          ↑(PartialHomeomorph.symm (IccRightChart x y) ≫ₕ IccLeftChart x y) ∘
            ↑(ModelWithCorners.symm (modelWithCornersEuclideanHalfSpace 1)))
        x_1 =
      (fun this => this) (fun z i => -z i + (y - x)) x_1

Next tactic:
rintro _ ⟨⟨hz₁, hz₂⟩, ⟨z, hz₀⟩, rfl⟩