l3lab/ntp-mathlib huggingface dataset:
instance Module.Finite.base_change [CommSemiring R] [Semiring A] [Algebra R A] [AddCommMonoid M]
    [Module R M] [h : Module.Finite R M] : Module.Finite A (TensorProduct R A M) := by
  classical
    obtain ⟨s, hs⟩ := h.out
    refine ⟨⟨s.image (TensorProduct.mk R A M 1), eq_top_iff.mpr ?_⟩⟩
    rintro x -
    induction x using TensorProduct.induction_on with
    | zero => exact zero_mem _
    | tmul x y =>
      -- Porting note: new TC reminder
      haveI : IsScalarTower R A (TensorProduct R A M) := TensorProduct.isScalarTower_left
      rw [Finset.coe_image, ← Submodule.span_span_of_tower R, Submodule.span_image, hs,
        Submodule.map_top, LinearMap.range_coe]
      change _ ∈ Submodule.span A (Set.range <| TensorProduct.mk R A M 1)
      

Proof state:
case intro.tmul
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
N : Type u_5
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
h : Finite R M
s : Finset M
hs : Submodule.span R ↑s = ⊤
x : A
y : M
this : IsScalarTower R A (TensorProduct R A M)
⊢ x ⊗ₜ[R] y ∈ Submodule.span A (Set.range ⇑((TensorProduct.mk R A M) 1))

Next tactic:
rw [← mul_one x, ← smul_eq_mul, ← TensorProduct.smul_tmul']
instance Module.Finite.base_change [CommSemiring R] [Semiring A] [Algebra R A] [AddCommMonoid M]
    [Module R M] [h : Module.Finite R M] : Module.Finite A (TensorProduct R A M) := by
  classical
    obtain ⟨s, hs⟩ := h.out
    refine ⟨⟨s.image (TensorProduct.mk R A M 1), eq_top_iff.mpr ?_⟩⟩
    rintro x -
    induction x using TensorProduct.induction_on with
    | zero => exact zero_mem _
    | tmul x y =>
      -- Porting note: new TC reminder
      haveI : IsScalarTower R A (TensorProduct R A M) := TensorProduct.isScalarTower_left
      rw [Finset.coe_image, ← Submodule.span_span_of_tower R, Submodule.span_image, hs,
        Submodule.map_top, LinearMap.range_coe]
      change _ ∈ Submodule.span A (Set.range <| TensorProduct.mk R A M 1)
      rw [← mul_one x, ← smul_eq_mul, ← TensorProduct.smul_tmul']
      

Proof state:
case intro.tmul
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
N : Type u_5
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
h : Finite R M
s : Finset M
hs : Submodule.span R ↑s = ⊤
x : A
y : M
this : IsScalarTower R A (TensorProduct R A M)
⊢ x • 1 ⊗ₜ[R] y ∈ Submodule.span A (Set.range ⇑((TensorProduct.mk R A M) 1))

Next tactic:
exact Submodule.smul_mem _ x (Submodule.subset_span <| Set.mem_range_self y)
instance Module.Finite.base_change [CommSemiring R] [Semiring A] [Algebra R A] [AddCommMonoid M]
    [Module R M] [h : Module.Finite R M] : Module.Finite A (TensorProduct R A M) := by
  classical
    obtain ⟨s, hs⟩ := h.out
    refine ⟨⟨s.image (TensorProduct.mk R A M 1), eq_top_iff.mpr ?_⟩⟩
    rintro x -
    induction x using TensorProduct.induction_on with
    | zero => exact zero_mem _
    | tmul x y =>
      -- Porting note: new TC reminder
      haveI : IsScalarTower R A (TensorProduct R A M) := TensorProduct.isScalarTower_left
      rw [Finset.coe_image, ← Submodule.span_span_of_tower R, Submodule.span_image, hs,
        Submodule.map_top, LinearMap.range_coe]
      change _ ∈ Submodule.span A (Set.range <| TensorProduct.mk R A M 1)
      rw [← mul_one x, ← smul_eq_mul, ← TensorProduct.smul_tmul']
      exact Submodule.smul_mem _ x (Submodule.subset_span <| Set.mem_range_self y)
    

Proof state:
case intro.add
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
N : Type u_5
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
h : Finite R M
s : Finset M
hs : Submodule.span R ↑s = ⊤
x y : TensorProduct R A M
hx : x ∈ Submodule.span A ↑(Finset.image (⇑((TensorProduct.mk R A M) 1)) s)
hy : y ∈ Submodule.span A ↑(Finset.image (⇑((TensorProduct.mk R A M) 1)) s)
⊢ x + y ∈ Submodule.span A ↑(Finset.image (⇑((TensorProduct.mk R A M) 1)) s)

Next tactic:
| add x y hx hy => exact Submodule.add_mem _ hx hy
instance Module.Finite.base_change [CommSemiring R] [Semiring A] [Algebra R A] [AddCommMonoid M]
    [Module R M] [h : Module.Finite R M] : Module.Finite A (TensorProduct R A M) := by
  classical
    obtain ⟨s, hs⟩ := h.out
    refine ⟨⟨s.image (TensorProduct.mk R A M 1), eq_top_iff.mpr ?_⟩⟩
    rintro x -
    induction x using TensorProduct.induction_on with
    | zero => exact zero_mem _
    | tmul x y =>
      -- Porting note: new TC reminder
      haveI : IsScalarTower R A (TensorProduct R A M) := TensorProduct.isScalarTower_left
      rw [Finset.coe_image, ← Submodule.span_span_of_tower R, Submodule.span_image, hs,
        Submodule.map_top, LinearMap.range_coe]
      change _ ∈ Submodule.span A (Set.range <| TensorProduct.mk R A M 1)
      rw [← mul_one x, ← smul_eq_mul, ← TensorProduct.smul_tmul']
      exact Submodule.smul_mem _ x (Submodule.subset_span <| Set.mem_range_self y)
    | add x y hx hy => 

Proof state:
case intro.add
R : Type u_1
A : Type u_2
B : Type u_3
M : Type u_4
N : Type u_5
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
h : Finite R M
s : Finset M
hs : Submodule.span R ↑s = ⊤
x y : TensorProduct R A M
hx : x ∈ Submodule.span A ↑(Finset.image (⇑((TensorProduct.mk R A M) 1)) s)
hy : y ∈ Submodule.span A ↑(Finset.image (⇑((TensorProduct.mk R A M) 1)) s)
⊢ x + y ∈ Submodule.span A ↑(Finset.image (⇑((TensorProduct.mk R A M) 1)) s)

Next tactic:
exact Submodule.add_mem _ hx hy
theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite := by
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : Finite g
hf : Finite f
⊢ Finite (RingHom.comp g f)

Next tactic:
letI := f.toAlgebra
theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite := by
  letI := f.toAlgebra
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : Finite g
hf : Finite f
this : Algebra A B := toAlgebra f
⊢ Finite (RingHom.comp g f)

Next tactic:
letI := g.toAlgebra
theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : Finite g
hf : Finite f
this✝ : Algebra A B := toAlgebra f
this : Algebra B C := toAlgebra g
⊢ Finite (RingHom.comp g f)

Next tactic:
letI := (g.comp f).toAlgebra
theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  letI := (g.comp f).toAlgebra
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : Finite g
hf : Finite f
this✝¹ : Algebra A B := toAlgebra f
this✝ : Algebra B C := toAlgebra g
this : Algebra A C := toAlgebra (RingHom.comp g f)
⊢ Finite (RingHom.comp g f)

Next tactic:
letI : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  letI := (g.comp f).toAlgebra
  letI : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : Finite g
hf : Finite f
this✝² : Algebra A B := toAlgebra f
this✝¹ : Algebra B C := toAlgebra g
this✝ : Algebra A C := toAlgebra (RingHom.comp g f)
this : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
⊢ Finite (RingHom.comp g f)

Next tactic:
letI : Module.Finite A B := hf
theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  letI := (g.comp f).toAlgebra
  letI : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
  letI : Module.Finite A B := hf
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : Finite g
hf : Finite f
this✝³ : Algebra A B := toAlgebra f
this✝² : Algebra B C := toAlgebra g
this✝¹ : Algebra A C := toAlgebra (RingHom.comp g f)
this✝ : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
this : Module.Finite A B := hf
⊢ Finite (RingHom.comp g f)

Next tactic:
letI : Module.Finite B C := hg
theorem comp {g : B →+* C} {f : A →+* B} (hg : g.Finite) (hf : f.Finite) : (g.comp f).Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  letI := (g.comp f).toAlgebra
  letI : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
  letI : Module.Finite A B := hf
  letI : Module.Finite B C := hg
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
g : B →+* C
f : A →+* B
hg : Finite g
hf : Finite f
this✝⁴ : Algebra A B := toAlgebra f
this✝³ : Algebra B C := toAlgebra g
this✝² : Algebra A C := toAlgebra (RingHom.comp g f)
this✝¹ : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
this✝ : Module.Finite A B := hf
this : Module.Finite B C := hg
⊢ Finite (RingHom.comp g f)

Next tactic:
exact Module.Finite.trans B C
theorem of_comp_finite {f : A →+* B} {g : B →+* C} (h : (g.comp f).Finite) : g.Finite := by
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
h : Finite (RingHom.comp g f)
⊢ Finite g

Next tactic:
letI := f.toAlgebra
theorem of_comp_finite {f : A →+* B} {g : B →+* C} (h : (g.comp f).Finite) : g.Finite := by
  letI := f.toAlgebra
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
h : Finite (RingHom.comp g f)
this : Algebra A B := toAlgebra f
⊢ Finite g

Next tactic:
letI := g.toAlgebra
theorem of_comp_finite {f : A →+* B} {g : B →+* C} (h : (g.comp f).Finite) : g.Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
h : Finite (RingHom.comp g f)
this✝ : Algebra A B := toAlgebra f
this : Algebra B C := toAlgebra g
⊢ Finite g

Next tactic:
letI := (g.comp f).toAlgebra
theorem of_comp_finite {f : A →+* B} {g : B →+* C} (h : (g.comp f).Finite) : g.Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  letI := (g.comp f).toAlgebra
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
h : Finite (RingHom.comp g f)
this✝¹ : Algebra A B := toAlgebra f
this✝ : Algebra B C := toAlgebra g
this : Algebra A C := toAlgebra (RingHom.comp g f)
⊢ Finite g

Next tactic:
letI : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
theorem of_comp_finite {f : A →+* B} {g : B →+* C} (h : (g.comp f).Finite) : g.Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  letI := (g.comp f).toAlgebra
  letI : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
h : Finite (RingHom.comp g f)
this✝² : Algebra A B := toAlgebra f
this✝¹ : Algebra B C := toAlgebra g
this✝ : Algebra A C := toAlgebra (RingHom.comp g f)
this : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
⊢ Finite g

Next tactic:
letI : Module.Finite A C := h
theorem of_comp_finite {f : A →+* B} {g : B →+* C} (h : (g.comp f).Finite) : g.Finite := by
  letI := f.toAlgebra
  letI := g.toAlgebra
  letI := (g.comp f).toAlgebra
  letI : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
  letI : Module.Finite A C := h
  

Proof state:
A : Type u_1
B : Type u_2
C : Type u_3
inst✝² : CommRing A
inst✝¹ : CommRing B
inst✝ : CommRing C
f : A →+* B
g : B →+* C
h : Finite (RingHom.comp g f)
this✝³ : Algebra A B := toAlgebra f
this✝² : Algebra B C := toAlgebra g
this✝¹ : Algebra A C := toAlgebra (RingHom.comp g f)
this✝ : IsScalarTower A B C := RestrictScalars.isScalarTower A B C
this : Module.Finite A C := h
⊢ Finite g

Next tactic:
exact Module.Finite.of_restrictScalars_finite A B C
/-- Pointwise `Singleton.singleton` bundled as a `Finsupp`. -/
@[simps]
def rangeSingleton (f : ι →₀ α) : ι →₀ Finset α where
  toFun i := {f i}
  support := f.support
  mem_support_toFun i := by
    

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : Zero α
f✝ : ι →₀ α
i✝ : ι
a : α
f : ι →₀ α
i : ι
⊢ i ∈ f.support ↔ (fun i => {f i}) i ≠ 0

Next tactic:
rw [← not_iff_not, not_mem_support_iff, not_ne_iff]
/-- Pointwise `Singleton.singleton` bundled as a `Finsupp`. -/
@[simps]
def rangeSingleton (f : ι →₀ α) : ι →₀ Finset α where
  toFun i := {f i}
  support := f.support
  mem_support_toFun i := by
    rw [← not_iff_not, not_mem_support_iff, not_ne_iff]
    

Proof state:
ι : Type u_1
α : Type u_2
inst✝ : Zero α
f✝ : ι →₀ α
i✝ : ι
a : α
f : ι →₀ α
i : ι
⊢ f i = 0 ↔ (fun i => {f i}) i = 0

Next tactic:
exact singleton_injective.eq_iff.symm
/-- Pointwise `Finset.Icc` bundled as a `Finsupp`. -/
@[simps toFun]
def rangeIcc (f g : ι →₀ α) : ι →₀ Finset α where
  toFun i := Icc (f i) (g i)
  support :=
    -- porting note: Not needed (due to open Classical), in mathlib3 too
    -- haveI := Classical.decEq ι
    f.support ∪ g.support
  mem_support_toFun i := by
    

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : Zero α
inst✝¹ : PartialOrder α
inst✝ : LocallyFiniteOrder α
f✝ g✝ : ι →₀ α
i✝ : ι
a : α
f g : ι →₀ α
i : ι
⊢ i ∈ f.support ∪ g.support ↔ (fun i => Icc (f i) (g i)) i ≠ 0

Next tactic:
rw [mem_union, ← not_iff_not, not_or, not_mem_support_iff, not_mem_support_iff, not_ne_iff]
/-- Pointwise `Finset.Icc` bundled as a `Finsupp`. -/
@[simps toFun]
def rangeIcc (f g : ι →₀ α) : ι →₀ Finset α where
  toFun i := Icc (f i) (g i)
  support :=
    -- porting note: Not needed (due to open Classical), in mathlib3 too
    -- haveI := Classical.decEq ι
    f.support ∪ g.support
  mem_support_toFun i := by
    rw [mem_union, ← not_iff_not, not_or, not_mem_support_iff, not_mem_support_iff, not_ne_iff]
    

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : Zero α
inst✝¹ : PartialOrder α
inst✝ : LocallyFiniteOrder α
f✝ g✝ : ι →₀ α
i✝ : ι
a : α
f g : ι →₀ α
i : ι
⊢ f i = 0 ∧ g i = 0 ↔ (fun i => Icc (f i) (g i)) i = 0

Next tactic:
exact Icc_eq_singleton_iff.symm
instance : LocallyFiniteOrder (ι →₀ α) :=
  -- porting note: Not needed (due to open Classical), in mathlib3 too
  -- haveI := Classical.decEq ι
  -- haveI := Classical.decEq α
  LocallyFiniteOrder.ofIcc (ι →₀ α) (fun f g => (f.support ∪ g.support).finsupp <| f.rangeIcc g)
    fun f g x => by
      

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : PartialOrder α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f✝ g✝ f g x : ι →₀ α
⊢ x ∈ (fun f g => Finset.finsupp (f.support ∪ g.support) ⇑(rangeIcc f g)) f g ↔ f ≤ x ∧ x ≤ g

Next tactic:
refine'
        (mem_finsupp_iff_of_support_subset <| Finset.subset_of_eq <| rangeIcc_support _ _).trans _
instance : LocallyFiniteOrder (ι →₀ α) :=
  -- porting note: Not needed (due to open Classical), in mathlib3 too
  -- haveI := Classical.decEq ι
  -- haveI := Classical.decEq α
  LocallyFiniteOrder.ofIcc (ι →₀ α) (fun f g => (f.support ∪ g.support).finsupp <| f.rangeIcc g)
    fun f g x => by
      refine'
        (mem_finsupp_iff_of_support_subset <| Finset.subset_of_eq <| rangeIcc_support _ _).trans _
      

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : PartialOrder α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f✝ g✝ f g x : ι →₀ α
⊢ (∀ (i : ι), x i ∈ (rangeIcc f g) i) ↔ f ≤ x ∧ x ≤ g

Next tactic:
simp_rw [mem_rangeIcc_apply_iff]
instance : LocallyFiniteOrder (ι →₀ α) :=
  -- porting note: Not needed (due to open Classical), in mathlib3 too
  -- haveI := Classical.decEq ι
  -- haveI := Classical.decEq α
  LocallyFiniteOrder.ofIcc (ι →₀ α) (fun f g => (f.support ∪ g.support).finsupp <| f.rangeIcc g)
    fun f g x => by
      refine'
        (mem_finsupp_iff_of_support_subset <| Finset.subset_of_eq <| rangeIcc_support _ _).trans _
      simp_rw [mem_rangeIcc_apply_iff]
      

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : PartialOrder α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f✝ g✝ f g x : ι →₀ α
⊢ (∀ (i : ι), f i ≤ x i ∧ x i ≤ g i) ↔ f ≤ x ∧ x ≤ g

Next tactic:
exact forall_and
theorem card_Icc : (Icc f g).card = ∏ i in f.support ∪ g.support, (Icc (f i) (g i)).card := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : PartialOrder α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f g : ι →₀ α
⊢ card (Icc f g) = ∏ i in f.support ∪ g.support, card (Icc (f i) (g i))

Next tactic:
simp_rw [Icc_eq, card_finsupp, coe_rangeIcc]
theorem card_Ico : (Ico f g).card = (∏ i in f.support ∪ g.support, (Icc (f i) (g i)).card) - 1 := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : PartialOrder α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f g : ι →₀ α
⊢ card (Ico f g) = ∏ i in f.support ∪ g.support, card (Icc (f i) (g i)) - 1

Next tactic:
rw [card_Ico_eq_card_Icc_sub_one, card_Icc]
theorem card_Ioc : (Ioc f g).card = (∏ i in f.support ∪ g.support, (Icc (f i) (g i)).card) - 1 := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : PartialOrder α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f g : ι →₀ α
⊢ card (Ioc f g) = ∏ i in f.support ∪ g.support, card (Icc (f i) (g i)) - 1

Next tactic:
rw [card_Ioc_eq_card_Icc_sub_one, card_Icc]
theorem card_Ioo : (Ioo f g).card = (∏ i in f.support ∪ g.support, (Icc (f i) (g i)).card) - 2 := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : PartialOrder α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f g : ι →₀ α
⊢ card (Ioo f g) = ∏ i in f.support ∪ g.support, card (Icc (f i) (g i)) - 2

Next tactic:
rw [card_Ioo_eq_card_Icc_sub_two, card_Icc]
theorem card_uIcc :
    (uIcc f g).card = ∏ i in f.support ∪ g.support, (uIcc (f i) (g i)).card := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : Lattice α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f g : ι →₀ α
⊢ card (uIcc f g) = ∏ i in f.support ∪ g.support, card (uIcc (f i) (g i))

Next tactic:
rw [← support_inf_union_support_sup]
theorem card_uIcc :
    (uIcc f g).card = ∏ i in f.support ∪ g.support, (uIcc (f i) (g i)).card := by
  rw [← support_inf_union_support_sup]; 

Proof state:
ι : Type u_1
α : Type u_2
inst✝² : Lattice α
inst✝¹ : Zero α
inst✝ : LocallyFiniteOrder α
f g : ι →₀ α
⊢ card (uIcc f g) = ∏ i in (f ⊓ g).support ∪ (f ⊔ g).support, card (uIcc (f i) (g i))

Next tactic:
exact card_Icc (_ : ι →₀ α) _
theorem card_Iic : (Iic f).card = ∏ i in f.support, (Iic (f i)).card := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝¹ : CanonicallyOrderedAddCommMonoid α
inst✝ : LocallyFiniteOrder α
f : ι →₀ α
⊢ card (Iic f) = ∏ i in f.support, card (Iic (f i))

Next tactic:
classical simp_rw [Iic_eq_Icc, card_Icc, Finsupp.bot_eq_zero, support_zero, empty_union,
      zero_apply, bot_eq_zero]
theorem card_Iic : (Iic f).card = ∏ i in f.support, (Iic (f i)).card := by
  classical 

Proof state:
ι : Type u_1
α : Type u_2
inst✝¹ : CanonicallyOrderedAddCommMonoid α
inst✝ : LocallyFiniteOrder α
f : ι →₀ α
⊢ card (Iic f) = ∏ i in f.support, card (Iic (f i))

Next tactic:
simp_rw [Iic_eq_Icc, card_Icc, Finsupp.bot_eq_zero, support_zero, empty_union,
      zero_apply, bot_eq_zero]
theorem card_Iio : (Iio f).card = (∏ i in f.support, (Iic (f i)).card) - 1 := by
  

Proof state:
ι : Type u_1
α : Type u_2
inst✝¹ : CanonicallyOrderedAddCommMonoid α
inst✝ : LocallyFiniteOrder α
f : ι →₀ α
⊢ card (Iio f) = ∏ i in f.support, card (Iic (f i)) - 1

Next tactic:
rw [card_Iio_eq_card_Iic_sub_one, card_Iic]
theorem contMDiffWithinAt_iff_contDiffWithinAt {f : E → E'} {s : Set E} {x : E} :
    ContMDiffWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') n f s x ↔ ContDiffWithinAt 𝕜 n f s x := by
  

Proof state:
𝕜 : Type u_1
inst✝³² : NontriviallyNormedField 𝕜
E : Type u_2
inst✝³¹ : NormedAddCommGroup E
inst✝³⁰ : NormedSpace 𝕜 E
H : Type u_3
inst✝²⁹ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝²⁸ : TopologicalSpace M
inst✝²⁷ : ChartedSpace H M
inst✝²⁶ : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝²⁵ : NormedAddCommGroup E'
inst✝²⁴ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝²³ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝²² : TopologicalSpace M'
inst✝²¹ : ChartedSpace H' M'
inst✝²⁰ : SmoothManifoldWithCorners I' M'
F : Type u_8
inst✝¹⁹ : NormedAddCommGroup F
inst✝¹⁸ : NormedSpace 𝕜 F
G : Type u_9
inst✝¹⁷ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_10
inst✝¹⁶ : TopologicalSpace N
inst✝¹⁵ : ChartedSpace G N
inst✝¹⁴ : SmoothManifoldWithCorners J N
F' : Type u_11
inst✝¹³ : NormedAddCommGroup F'
inst✝¹² : NormedSpace 𝕜 F'
G' : Type u_12
inst✝¹¹ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_13
inst✝¹⁰ : TopologicalSpace N'
inst✝⁹ : ChartedSpace G' N'
inst✝⁸ : SmoothManifoldWithCorners J' N'
F₁ : Type u_14
inst✝⁷ : NormedAddCommGroup F₁
inst✝⁶ : NormedSpace 𝕜 F₁
F₂ : Type u_15
inst✝⁵ : NormedAddCommGroup F₂
inst✝⁴ : NormedSpace 𝕜 F₂
F₃ : Type u_16
inst✝³ : NormedAddCommGroup F₃
inst✝² : NormedSpace 𝕜 F₃
F₄ : Type u_17
inst✝¹ : NormedAddCommGroup F₄
inst✝ : NormedSpace 𝕜 F₄
f✝ f₁ : M → M'
s✝ t : Set M
x✝ : M
m n : ℕ∞
f : E → E'
s : Set E
x : E
⊢ ContMDiffWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') n f s x ↔ ContDiffWithinAt 𝕜 n f s x

Next tactic:
simp (config := { contextual := true }) only [ContMDiffWithinAt, LiftPropWithinAt,
    ContDiffWithinAtProp, iff_def, mfld_simps]
theorem contMDiffWithinAt_iff_contDiffWithinAt {f : E → E'} {s : Set E} {x : E} :
    ContMDiffWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') n f s x ↔ ContDiffWithinAt 𝕜 n f s x := by
  simp (config := { contextual := true }) only [ContMDiffWithinAt, LiftPropWithinAt,
    ContDiffWithinAtProp, iff_def, mfld_simps]
  

Proof state:
𝕜 : Type u_1
inst✝³² : NontriviallyNormedField 𝕜
E : Type u_2
inst✝³¹ : NormedAddCommGroup E
inst✝³⁰ : NormedSpace 𝕜 E
H : Type u_3
inst✝²⁹ : TopologicalSpace H
I : ModelWithCorners 𝕜 E H
M : Type u_4
inst✝²⁸ : TopologicalSpace M
inst✝²⁷ : ChartedSpace H M
inst✝²⁶ : SmoothManifoldWithCorners I M
E' : Type u_5
inst✝²⁵ : NormedAddCommGroup E'
inst✝²⁴ : NormedSpace 𝕜 E'
H' : Type u_6
inst✝²³ : TopologicalSpace H'
I' : ModelWithCorners 𝕜 E' H'
M' : Type u_7
inst✝²² : TopologicalSpace M'
inst✝²¹ : ChartedSpace H' M'
inst✝²⁰ : SmoothManifoldWithCorners I' M'
F : Type u_8
inst✝¹⁹ : NormedAddCommGroup F
inst✝¹⁸ : NormedSpace 𝕜 F
G : Type u_9
inst✝¹⁷ : TopologicalSpace G
J : ModelWithCorners 𝕜 F G
N : Type u_10
inst✝¹⁶ : TopologicalSpace N
inst✝¹⁵ : ChartedSpace G N
inst✝¹⁴ : SmoothManifoldWithCorners J N
F' : Type u_11
inst✝¹³ : NormedAddCommGroup F'
inst✝¹² : NormedSpace 𝕜 F'
G' : Type u_12
inst✝¹¹ : TopologicalSpace G'
J' : ModelWithCorners 𝕜 F' G'
N' : Type u_13
inst✝¹⁰ : TopologicalSpace N'
inst✝⁹ : ChartedSpace G' N'
inst✝⁸ : SmoothManifoldWithCorners J' N'
F₁ : Type u_14
inst✝⁷ : NormedAddCommGroup F₁
inst✝⁶ : NormedSpace 𝕜 F₁
F₂ : Type u_15
inst✝⁵ : NormedAddCommGroup F₂
inst✝⁴ : NormedSpace 𝕜 F₂
F₃ : Type u_16
inst✝³ : NormedAddCommGroup F₃
inst✝² : NormedSpace 𝕜 F₃
F₄ : Type u_17
inst✝¹ : NormedAddCommGroup F₄
inst✝ : NormedSpace 𝕜 F₄
f✝ f₁ : M → M'
s✝ t : Set M
x✝ : M
m n : ℕ∞
f : E → E'
s : Set E
x : E
⊢ ContDiffWithinAt 𝕜 n f s x → ContinuousWithinAt f s x

Next tactic:
exact ContDiffWithinAt.continuousWithinAt