l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem dropFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    dropFun (f ⊗' f') = (dropFun f ⊗' dropFun f') := by
  ext i : 2
  

Proof state:
case a.h
n : ℕ
α α' β β' : TypeVec.{u_1} (n + 1)
f : α ⟹ β
f' : α' ⟹ β'
i : Fin2 n
x✝ : drop (α ⊗ α') i
⊢ dropFun (f ⊗' f') i x✝ = (dropFun f ⊗' dropFun f') i x✝

Next tactic:
induction i
@[simp]
theorem dropFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    dropFun (f ⊗' f') = (dropFun f ⊗' dropFun f') := by
  ext i : 2
  induction i <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α α' β β' : TypeVec.{u_1} (Nat.succ n✝ + 1)
f : α ⟹ β
f' : α' ⟹ β'
x✝ : drop (α ⊗ α') Fin2.fz
⊢ dropFun (f ⊗' f') Fin2.fz x✝ = (dropFun f ⊗' dropFun f') Fin2.fz x✝

Next tactic:
simp [dropFun, *]
@[simp]
theorem dropFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    dropFun (f ⊗' f') = (dropFun f ⊗' dropFun f') := by
  ext i : 2
  induction i <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α α' β β' : TypeVec.{u_1} (n✝ + 1)} (f : α ⟹ β) (f' : α' ⟹ β') (x : drop (α ⊗ α') a✝),
    dropFun (f ⊗' f') a✝ x = (dropFun f ⊗' dropFun f') a✝ x
α α' β β' : TypeVec.{u_1} (Nat.succ n✝ + 1)
f : α ⟹ β
f' : α' ⟹ β'
x✝ : drop (α ⊗ α') (Fin2.fs a✝)
⊢ dropFun (f ⊗' f') (Fin2.fs a✝) x✝ = (dropFun f ⊗' dropFun f') (Fin2.fs a✝) x✝

Next tactic:
simp [dropFun, *]
@[simp]
theorem dropFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    dropFun (f ⊗' f') = (dropFun f ⊗' dropFun f') := by
  ext i : 2
  induction i <;> simp [dropFun, *] <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α α' β β' : TypeVec.{u_1} (Nat.succ n✝ + 1)
f : α ⟹ β
f' : α' ⟹ β'
x✝ : drop (α ⊗ α') Fin2.fz
⊢ (f ⊗' f') (Fin2.fs Fin2.fz) x✝ = (dropFun f ⊗' dropFun f') Fin2.fz x✝

Next tactic:
rfl
@[simp]
theorem dropFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    dropFun (f ⊗' f') = (dropFun f ⊗' dropFun f') := by
  ext i : 2
  induction i <;> simp [dropFun, *] <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α α' β β' : TypeVec.{u_1} (n✝ + 1)} (f : α ⟹ β) (f' : α' ⟹ β') (x : drop (α ⊗ α') a✝),
    dropFun (f ⊗' f') a✝ x = (dropFun f ⊗' dropFun f') a✝ x
α α' β β' : TypeVec.{u_1} (Nat.succ n✝ + 1)
f : α ⟹ β
f' : α' ⟹ β'
x✝ : drop (α ⊗ α') (Fin2.fs a✝)
⊢ (f ⊗' f') (Fin2.fs (Fin2.fs a✝)) x✝ = (dropFun f ⊗' dropFun f') (Fin2.fs a✝) x✝

Next tactic:
rfl
@[simp]
theorem lastFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    lastFun (f ⊗' f') = Prod.map (lastFun f) (lastFun f') := by
  

Proof state:
n : ℕ
α α' β β' : TypeVec.{u_1} (n + 1)
f : α ⟹ β
f' : α' ⟹ β'
⊢ lastFun (f ⊗' f') = Prod.map (lastFun f) (lastFun f')

Next tactic:
ext i : 1
@[simp]
theorem lastFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    lastFun (f ⊗' f') = Prod.map (lastFun f) (lastFun f') := by
  ext i : 1
  

Proof state:
case h
n : ℕ
α α' β β' : TypeVec.{u_1} (n + 1)
f : α ⟹ β
f' : α' ⟹ β'
i : last (α ⊗ α')
⊢ lastFun (f ⊗' f') i = Prod.map (lastFun f) (lastFun f') i

Next tactic:
induction i
@[simp]
theorem lastFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    lastFun (f ⊗' f') = Prod.map (lastFun f) (lastFun f') := by
  ext i : 1
  induction i; 

Proof state:
case h.mk
n : ℕ
α α' β β' : TypeVec.{u_1} (n + 1)
f : α ⟹ β
f' : α' ⟹ β'
fst✝ : last α
snd✝ : last α'
⊢ lastFun (f ⊗' f') (fst✝, snd✝) = Prod.map (lastFun f) (lastFun f') (fst✝, snd✝)

Next tactic:
simp [lastFun, *]
@[simp]
theorem lastFun_prod {α α' β β' : TypeVec (n + 1)} (f : α ⟹ β) (f' : α' ⟹ β') :
    lastFun (f ⊗' f') = Prod.map (lastFun f) (lastFun f') := by
  ext i : 1
  induction i; simp [lastFun, *]; 

Proof state:
case h.mk
n : ℕ
α α' β β' : TypeVec.{u_1} (n + 1)
f : α ⟹ β
f' : α' ⟹ β'
fst✝ : last α
snd✝ : last α'
⊢ (f ⊗' f') Fin2.fz (fst✝, snd✝) = Prod.map (f Fin2.fz) (f' Fin2.fz) (fst✝, snd✝)

Next tactic:
rfl
@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := by
  

Proof state:
n : ℕ
α β : TypeVec.{u_1} n
⊢ (id ⊗' id) = id

Next tactic:
ext i x : 2
@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := by
  ext i x : 2
  

Proof state:
case a.h
n : ℕ
α β : TypeVec.{u_1} n
i : Fin2 n
x : (α ⊗ β) i
⊢ (id ⊗' id) i x = id i x

Next tactic:
induction i
@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := by
  ext i x : 2
  induction i <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α β : TypeVec.{u_1} (Nat.succ n✝)
x : (α ⊗ β) Fin2.fz
⊢ (id ⊗' id) Fin2.fz x = id Fin2.fz x

Next tactic:
simp only [TypeVec.prod.map, *, dropFun_id]
@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := by
  ext i x : 2
  induction i <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ : ∀ {α β : TypeVec.{u_1} n✝} (x : (α ⊗ β) a✝), (id ⊗' id) a✝ x = id a✝ x
α β : TypeVec.{u_1} (Nat.succ n✝)
x : (α ⊗ β) (Fin2.fs a✝)
⊢ (id ⊗' id) (Fin2.fs a✝) x = id (Fin2.fs a✝) x

Next tactic:
simp only [TypeVec.prod.map, *, dropFun_id]
@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := by
  ext i x : 2
  induction i <;> simp only [TypeVec.prod.map, *, dropFun_id]
  

Proof state:
case a.h.fz
n n✝ : ℕ
α β : TypeVec.{u_1} (Nat.succ n✝)
x : (α ⊗ β) Fin2.fz
⊢ (id Fin2.fz x.fst, id Fin2.fz x.snd) = id Fin2.fz x
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ : ∀ {α β : TypeVec.{u_1} n✝} (x : (α ⊗ β) a✝), (id ⊗' id) a✝ x = id a✝ x
α β : TypeVec.{u_1} (Nat.succ n✝)
x : (α ⊗ β) (Fin2.fs a✝)
⊢ id a✝ x = id (Fin2.fs a✝) x

Next tactic:
cases x
@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := by
  ext i x : 2
  induction i <;> simp only [TypeVec.prod.map, *, dropFun_id]
  cases x
  

Proof state:
case a.h.fz.mk
n n✝ : ℕ
α β : TypeVec.{u_1} (Nat.succ n✝)
fst✝ : last α
snd✝ : last β
⊢ (id Fin2.fz (fst✝, snd✝).fst, id Fin2.fz (fst✝, snd✝).snd) = id Fin2.fz (fst✝, snd✝)
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ : ∀ {α β : TypeVec.{u_1} n✝} (x : (α ⊗ β) a✝), (id ⊗' id) a✝ x = id a✝ x
α β : TypeVec.{u_1} (Nat.succ n✝)
x : (α ⊗ β) (Fin2.fs a✝)
⊢ id a✝ x = id (Fin2.fs a✝) x

Next tactic:
rfl
@[simp]
theorem prod_map_id {α β : TypeVec n} : (@TypeVec.id _ α ⊗' @TypeVec.id _ β) = id := by
  ext i x : 2
  induction i <;> simp only [TypeVec.prod.map, *, dropFun_id]
  cases x
  rfl
  

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ : ∀ {α β : TypeVec.{u_1} n✝} (x : (α ⊗ β) a✝), (id ⊗' id) a✝ x = id a✝ x
α β : TypeVec.{u_1} (Nat.succ n✝)
x : (α ⊗ β) (Fin2.fs a✝)
⊢ id a✝ x = id (Fin2.fs a✝) x

Next tactic:
rfl
@[simp]
theorem subtypeVal_diagSub {α : TypeVec n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by
  

Proof state:
n : ℕ
α : TypeVec.{u_1} n
⊢ subtypeVal (repeatEq α) ⊚ diagSub = prod.diag

Next tactic:
ext i x
@[simp]
theorem subtypeVal_diagSub {α : TypeVec n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by
  ext i x
  

Proof state:
case a.h
n : ℕ
α : TypeVec.{u_1} n
i : Fin2 n
x : α i
⊢ (subtypeVal (repeatEq α) ⊚ diagSub) i x = prod.diag i x

Next tactic:
induction' i with _ _ _ i_ih
@[simp]
theorem subtypeVal_diagSub {α : TypeVec n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by
  ext i x
  induction' i with _ _ _ i_ih
  · 

Proof state:
case a.h.fz
n n✝ : ℕ
α : TypeVec.{u_1} (Nat.succ n✝)
x : α Fin2.fz
⊢ (subtypeVal (repeatEq α) ⊚ diagSub) Fin2.fz x = prod.diag Fin2.fz x

Next tactic:
simp [comp, diagSub, subtypeVal, prod.diag]
@[simp]
theorem subtypeVal_diagSub {α : TypeVec n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by
  ext i x
  induction' i with _ _ _ i_ih
  · simp [comp, diagSub, subtypeVal, prod.diag]
  · 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
i_ih : ∀ {α : TypeVec.{u_1} n✝} (x : α a✝), (subtypeVal (repeatEq α) ⊚ diagSub) a✝ x = prod.diag a✝ x
α : TypeVec.{u_1} (Nat.succ n✝)
x : α (Fin2.fs a✝)
⊢ (subtypeVal (repeatEq α) ⊚ diagSub) (Fin2.fs a✝) x = prod.diag (Fin2.fs a✝) x

Next tactic:
simp [prod.diag]
@[simp]
theorem subtypeVal_diagSub {α : TypeVec n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by
  ext i x
  induction' i with _ _ _ i_ih
  · simp [comp, diagSub, subtypeVal, prod.diag]
  · simp [prod.diag]
    

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
i_ih : ∀ {α : TypeVec.{u_1} n✝} (x : α a✝), (subtypeVal (repeatEq α) ⊚ diagSub) a✝ x = prod.diag a✝ x
α : TypeVec.{u_1} (Nat.succ n✝)
x : α (Fin2.fs a✝)
⊢ (subtypeVal (repeatEq α) ⊚ diagSub) (Fin2.fs a✝) x = prod.diag a✝ x

Next tactic:
simp? [comp, diagSub, subtypeVal, prod.diag] at * says
      simp only [comp, subtypeVal, diagSub] at *
@[simp]
theorem subtypeVal_diagSub {α : TypeVec n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by
  ext i x
  induction' i with _ _ _ i_ih
  · simp [comp, diagSub, subtypeVal, prod.diag]
  · simp [prod.diag]
    simp? [comp, diagSub, subtypeVal, prod.diag] at * says
      

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
i_ih : ∀ {α : TypeVec.{u_1} n✝} (x : α a✝), (subtypeVal (repeatEq α) ⊚ diagSub) a✝ x = prod.diag a✝ x
α : TypeVec.{u_1} (Nat.succ n✝)
x : α (Fin2.fs a✝)
⊢ (subtypeVal (repeatEq α) ⊚ diagSub) (Fin2.fs a✝) x = prod.diag a✝ x

Next tactic:
simp only [comp, subtypeVal, diagSub] at *
@[simp]
theorem subtypeVal_diagSub {α : TypeVec n} : subtypeVal (repeatEq α) ⊚ diagSub = prod.diag := by
  ext i x
  induction' i with _ _ _ i_ih
  · simp [comp, diagSub, subtypeVal, prod.diag]
  · simp [prod.diag]
    simp? [comp, diagSub, subtypeVal, prod.diag] at * says
      simp only [comp, subtypeVal, diagSub] at *
    

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
i_ih : ∀ {α : TypeVec.{u_1} n✝} (x : α a✝), subtypeVal (repeatEq α) a✝ (diagSub a✝ x) = prod.diag a✝ x
α : TypeVec.{u_1} (Nat.succ n✝)
x : α (Fin2.fs a✝)
⊢ subtypeVal (dropFun (repeatEq α)) a✝ (diagSub a✝ x) = prod.diag a✝ x

Next tactic:
apply @i_ih (drop _)
@[simp]
theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    toSubtype p ⊚ ofSubtype p = id := by
  

Proof state:
n : ℕ
α : TypeVec.{u_1} n
p : α ⟹ repeat n Prop
⊢ toSubtype p ⊚ ofSubtype p = id

Next tactic:
ext i x
@[simp]
theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    toSubtype p ⊚ ofSubtype p = id := by
  ext i x
  

Proof state:
case a.h
n : ℕ
α : TypeVec.{u_1} n
p : α ⟹ repeat n Prop
i : Fin2 n
x : Subtype_ p i
⊢ (toSubtype p ⊚ ofSubtype p) i x = id i x

Next tactic:
induction i
@[simp]
theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    toSubtype p ⊚ ofSubtype p = id := by
  ext i x
  induction i <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α : TypeVec.{u_1} (Nat.succ n✝)
p : α ⟹ repeat (Nat.succ n✝) Prop
x : Subtype_ p Fin2.fz
⊢ (toSubtype p ⊚ ofSubtype p) Fin2.fz x = id Fin2.fz x

Next tactic:
dsimp only [id, toSubtype, comp, ofSubtype] at *
@[simp]
theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    toSubtype p ⊚ ofSubtype p = id := by
  ext i x
  induction i <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α : TypeVec.{u_1} n✝} (p : α ⟹ repeat n✝ Prop) (x : Subtype_ p a✝), (toSubtype p ⊚ ofSubtype p) a✝ x = id a✝ x
α : TypeVec.{u_1} (Nat.succ n✝)
p : α ⟹ repeat (Nat.succ n✝) Prop
x : Subtype_ p (Fin2.fs a✝)
⊢ (toSubtype p ⊚ ofSubtype p) (Fin2.fs a✝) x = id (Fin2.fs a✝) x

Next tactic:
dsimp only [id, toSubtype, comp, ofSubtype] at *
@[simp]
theorem toSubtype_of_subtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    toSubtype p ⊚ ofSubtype p = id := by
  ext i x
  induction i <;> dsimp only [id, toSubtype, comp, ofSubtype] at *
  

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ : ∀ {α : TypeVec.{u_1} n✝} (p : α ⟹ repeat n✝ Prop) (x : Subtype_ p a✝), toSubtype p a✝ (ofSubtype p a✝ x) = x
α : TypeVec.{u_1} (Nat.succ n✝)
p : α ⟹ repeat (Nat.succ n✝) Prop
x : Subtype_ p (Fin2.fs a✝)
⊢ toSubtype (dropFun p) a✝ (ofSubtype (dropFun p) a✝ x) = x

Next tactic:
simp [*]
@[simp]
theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    subtypeVal p ⊚ toSubtype p = fun _ => Subtype.val := by
  

Proof state:
n : ℕ
α : TypeVec.{u_1} n
p : α ⟹ repeat n Prop
⊢ subtypeVal p ⊚ toSubtype p = fun x => Subtype.val

Next tactic:
ext i x
@[simp]
theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    subtypeVal p ⊚ toSubtype p = fun _ => Subtype.val := by
  ext i x
  

Proof state:
case a.h
n : ℕ
α : TypeVec.{u_1} n
p : α ⟹ repeat n Prop
i : Fin2 n
x : (fun i => { x // ofRepeat (p i x) }) i
⊢ (subtypeVal p ⊚ toSubtype p) i x = ↑x

Next tactic:
induction i
@[simp]
theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    subtypeVal p ⊚ toSubtype p = fun _ => Subtype.val := by
  ext i x
  induction i <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α : TypeVec.{u_1} (Nat.succ n✝)
p : α ⟹ repeat (Nat.succ n✝) Prop
x : { x // ofRepeat (p Fin2.fz x) }
⊢ (subtypeVal p ⊚ toSubtype p) Fin2.fz x = ↑x

Next tactic:
dsimp only [toSubtype, comp, subtypeVal] at *
@[simp]
theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    subtypeVal p ⊚ toSubtype p = fun _ => Subtype.val := by
  ext i x
  induction i <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α : TypeVec.{u_1} n✝} (p : α ⟹ repeat n✝ Prop) (x : (fun i => { x // ofRepeat (p i x) }) a✝),
    (subtypeVal p ⊚ toSubtype p) a✝ x = ↑x
α : TypeVec.{u_1} (Nat.succ n✝)
p : α ⟹ repeat (Nat.succ n✝) Prop
x : { x // ofRepeat (p (Fin2.fs a✝) x) }
⊢ (subtypeVal p ⊚ toSubtype p) (Fin2.fs a✝) x = ↑x

Next tactic:
dsimp only [toSubtype, comp, subtypeVal] at *
@[simp]
theorem subtypeVal_toSubtype {α : TypeVec n} (p : α ⟹ «repeat» n Prop) :
    subtypeVal p ⊚ toSubtype p = fun _ => Subtype.val := by
  ext i x
  induction i <;> dsimp only [toSubtype, comp, subtypeVal] at *
  

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α : TypeVec.{u_1} n✝} (p : α ⟹ repeat n✝ Prop) (x : { x // ofRepeat (p a✝ x) }),
    subtypeVal p a✝ (toSubtype p a✝ x) = ↑x
α : TypeVec.{u_1} (Nat.succ n✝)
p : α ⟹ repeat (Nat.succ n✝) Prop
x : { x // ofRepeat (p (Fin2.fs a✝) x) }
⊢ subtypeVal (dropFun p) a✝ (toSubtype (dropFun p) a✝ x) = ↑x

Next tactic:
simp [*]
@[simp]
theorem toSubtype_of_subtype_assoc
    {α β : TypeVec n} (p : α ⟹ «repeat» n Prop) (f : β ⟹ Subtype_ p) :
    @toSubtype n _ p ⊚ ofSubtype _ ⊚ f = f :=
  by 

Proof state:
n : ℕ
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
p : α ⟹ repeat n Prop
f : β ⟹ Subtype_ p
⊢ toSubtype p ⊚ (ofSubtype fun i x => p i x) ⊚ f = f

Next tactic:
rw [← comp_assoc, toSubtype_of_subtype]
@[simp]
theorem toSubtype_of_subtype_assoc
    {α β : TypeVec n} (p : α ⟹ «repeat» n Prop) (f : β ⟹ Subtype_ p) :
    @toSubtype n _ p ⊚ ofSubtype _ ⊚ f = f :=
  by rw [← comp_assoc, toSubtype_of_subtype]; 

Proof state:
n : ℕ
α : TypeVec.{u_1} n
β : TypeVec.{u_2} n
p : α ⟹ repeat n Prop
f : β ⟹ Subtype_ p
⊢ id ⊚ f = f

Next tactic:
simp
@[simp]
theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    toSubtype' r ⊚ ofSubtype' r = id := by
  

Proof state:
n : ℕ
α : TypeVec.{u_1} n
r : α ⊗ α ⟹ repeat n Prop
⊢ toSubtype' r ⊚ ofSubtype' r = id

Next tactic:
ext i x
@[simp]
theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    toSubtype' r ⊚ ofSubtype' r = id := by
  ext i x
  

Proof state:
case a.h
n : ℕ
α : TypeVec.{u_1} n
r : α ⊗ α ⟹ repeat n Prop
i : Fin2 n
x : Subtype_ r i
⊢ (toSubtype' r ⊚ ofSubtype' r) i x = id i x

Next tactic:
induction i
@[simp]
theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    toSubtype' r ⊚ ofSubtype' r = id := by
  ext i x
  induction i
  <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α : TypeVec.{u_1} (Nat.succ n✝)
r : α ⊗ α ⟹ repeat (Nat.succ n✝) Prop
x : Subtype_ r Fin2.fz
⊢ (toSubtype' r ⊚ ofSubtype' r) Fin2.fz x = id Fin2.fz x

Next tactic:
dsimp only [id, toSubtype', comp, ofSubtype'] at *
@[simp]
theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    toSubtype' r ⊚ ofSubtype' r = id := by
  ext i x
  induction i
  <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α : TypeVec.{u_1} n✝} (r : α ⊗ α ⟹ repeat n✝ Prop) (x : Subtype_ r a✝),
    (toSubtype' r ⊚ ofSubtype' r) a✝ x = id a✝ x
α : TypeVec.{u_1} (Nat.succ n✝)
r : α ⊗ α ⟹ repeat (Nat.succ n✝) Prop
x : Subtype_ r (Fin2.fs a✝)
⊢ (toSubtype' r ⊚ ofSubtype' r) (Fin2.fs a✝) x = id (Fin2.fs a✝) x

Next tactic:
dsimp only [id, toSubtype', comp, ofSubtype'] at *
@[simp]
theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    toSubtype' r ⊚ ofSubtype' r = id := by
  ext i x
  induction i
  <;> dsimp only [id, toSubtype', comp, ofSubtype'] at *
  <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α : TypeVec.{u_1} (Nat.succ n✝)
r : α ⊗ α ⟹ repeat (Nat.succ n✝) Prop
x : Subtype_ r Fin2.fz
⊢ { val := ↑x,
      property :=
        (_ : r Fin2.fz ↑{ val := ↑x, property := (_ : ofRepeat (r Fin2.fz (prod.mk Fin2.fz (↑x).fst (↑x).snd))) }) } =
    x

Next tactic:
simp [Subtype.eta, *]
@[simp]
theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    toSubtype' r ⊚ ofSubtype' r = id := by
  ext i x
  induction i
  <;> dsimp only [id, toSubtype', comp, ofSubtype'] at *
  <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α : TypeVec.{u_1} n✝} (r : α ⊗ α ⟹ repeat n✝ Prop) (x : Subtype_ r a✝), toSubtype' r a✝ (ofSubtype' r a✝ x) = x
α : TypeVec.{u_1} (Nat.succ n✝)
r : α ⊗ α ⟹ repeat (Nat.succ n✝) Prop
x : Subtype_ r (Fin2.fs a✝)
⊢ toSubtype' (dropFun r) a✝ (ofSubtype' (dropFun r) a✝ x) = x

Next tactic:
simp [Subtype.eta, *]
theorem subtypeVal_toSubtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    subtypeVal r ⊚ toSubtype' r = fun i x => prod.mk i x.1.fst x.1.snd := by
  

Proof state:
n : ℕ
α : TypeVec.{u_1} n
r : α ⊗ α ⟹ repeat n Prop
⊢ subtypeVal r ⊚ toSubtype' r = fun i x => prod.mk i (↑x).fst (↑x).snd

Next tactic:
ext i x
theorem subtypeVal_toSubtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    subtypeVal r ⊚ toSubtype' r = fun i x => prod.mk i x.1.fst x.1.snd := by
  ext i x
  

Proof state:
case a.h
n : ℕ
α : TypeVec.{u_1} n
r : α ⊗ α ⟹ repeat n Prop
i : Fin2 n
x : (fun i => { x // ofRepeat (r i (prod.mk i x.fst x.snd)) }) i
⊢ (subtypeVal r ⊚ toSubtype' r) i x = prod.mk i (↑x).fst (↑x).snd

Next tactic:
induction i
theorem subtypeVal_toSubtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    subtypeVal r ⊚ toSubtype' r = fun i x => prod.mk i x.1.fst x.1.snd := by
  ext i x
  induction i <;> 

Proof state:
case a.h.fz
n n✝ : ℕ
α : TypeVec.{u_1} (Nat.succ n✝)
r : α ⊗ α ⟹ repeat (Nat.succ n✝) Prop
x : { x // ofRepeat (r Fin2.fz (prod.mk Fin2.fz x.fst x.snd)) }
⊢ (subtypeVal r ⊚ toSubtype' r) Fin2.fz x = prod.mk Fin2.fz (↑x).fst (↑x).snd

Next tactic:
dsimp only [id, toSubtype', comp, subtypeVal, prod.mk] at *
theorem subtypeVal_toSubtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    subtypeVal r ⊚ toSubtype' r = fun i x => prod.mk i x.1.fst x.1.snd := by
  ext i x
  induction i <;> 

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α : TypeVec.{u_1} n✝} (r : α ⊗ α ⟹ repeat n✝ Prop)
    (x : (fun i => { x // ofRepeat (r i (prod.mk i x.fst x.snd)) }) a✝),
    (subtypeVal r ⊚ toSubtype' r) a✝ x = prod.mk a✝ (↑x).fst (↑x).snd
α : TypeVec.{u_1} (Nat.succ n✝)
r : α ⊗ α ⟹ repeat (Nat.succ n✝) Prop
x : { x // ofRepeat (r (Fin2.fs a✝) (prod.mk (Fin2.fs a✝) x.fst x.snd)) }
⊢ (subtypeVal r ⊚ toSubtype' r) (Fin2.fs a✝) x = prod.mk (Fin2.fs a✝) (↑x).fst (↑x).snd

Next tactic:
dsimp only [id, toSubtype', comp, subtypeVal, prod.mk] at *
theorem subtypeVal_toSubtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    subtypeVal r ⊚ toSubtype' r = fun i x => prod.mk i x.1.fst x.1.snd := by
  ext i x
  induction i <;> dsimp only [id, toSubtype', comp, subtypeVal, prod.mk] at *
  

Proof state:
case a.h.fs
n n✝ : ℕ
a✝ : Fin2 n✝
a_ih✝ :
  ∀ {α : TypeVec.{u_1} n✝} (r : α ⊗ α ⟹ repeat n✝ Prop) (x : { x // ofRepeat (r a✝ (prod.mk a✝ x.fst x.snd)) }),
    subtypeVal r a✝ (toSubtype' r a✝ x) = prod.mk a✝ (↑x).fst (↑x).snd
α : TypeVec.{u_1} (Nat.succ n✝)
r : α ⊗ α ⟹ repeat (Nat.succ n✝) Prop
x : { x // ofRepeat (r (Fin2.fs a✝) (prod.mk (Fin2.fs a✝) x.fst x.snd)) }
⊢ subtypeVal (dropFun r) a✝ (toSubtype' (dropFun r) a✝ x) = prod.mk a✝ (↑x).fst (↑x).snd

Next tactic:
simp [*]
theorem _root_.Real.toNNReal_of_nonneg {r : ℝ} (hr : 0 ≤ r) : r.toNNReal = ⟨r, hr⟩ := by
  

Proof state:
r : ℝ
hr : 0 ≤ r
⊢ Real.toNNReal r = { val := r, property := hr }

Next tactic:
simp_rw [Real.toNNReal, max_eq_left hr]
example : Zero ℝ≥0 := by 

Proof state:
⊢ Zero ℝ≥0

Next tactic:
infer_instance
example : One ℝ≥0 := by 

Proof state:
⊢ One ℝ≥0

Next tactic:
infer_instance
example : Add ℝ≥0 := by 

Proof state:
⊢ Add ℝ≥0

Next tactic:
infer_instance
noncomputable example : Sub ℝ≥0 := by 

Proof state:
⊢ Sub ℝ≥0

Next tactic:
infer_instance
example : Mul ℝ≥0 := by 

Proof state:
⊢ Mul ℝ≥0

Next tactic:
infer_instance
noncomputable example : Inv ℝ≥0 := by 

Proof state:
⊢ Inv ℝ≥0

Next tactic:
infer_instance
noncomputable example : Div ℝ≥0 := by 

Proof state:
⊢ Div ℝ≥0

Next tactic:
infer_instance
example : LE ℝ≥0 := by 

Proof state:
⊢ LE ℝ≥0

Next tactic:
infer_instance
example : Bot ℝ≥0 := by 

Proof state:
⊢ Bot ℝ≥0

Next tactic:
infer_instance
example : Inhabited ℝ≥0 := by 

Proof state:
⊢ Inhabited ℝ≥0

Next tactic:
infer_instance
example : Nontrivial ℝ≥0 := by 

Proof state:
⊢ Nontrivial ℝ≥0

Next tactic:
infer_instance
@[simp, norm_cast]
protected theorem coe_sub {r₁ r₂ : ℝ≥0} (h : r₂ ≤ r₁) : ((r₁ - r₂ : ℝ≥0) : ℝ) = ↑r₁ - ↑r₂ :=
  max_eq_left <| le_sub_comm.2 <| by 

Proof state:
r₁ r₂ : ℝ≥0
h : r₂ ≤ r₁
⊢ ↑r₂ ≤ ↑r₁ - 0

Next tactic:
simp [show (r₂ : ℝ) ≤ r₁ from h]
@[simp, norm_cast]
protected theorem coe_eq_zero (r : ℝ≥0) : ↑r = (0 : ℝ) ↔ r = 0 := by
  

Proof state:
r : ℝ≥0
⊢ ↑r = 0 ↔ r = 0

Next tactic:
rw [← NNReal.coe_zero, NNReal.coe_eq]
@[simp, norm_cast]
protected theorem coe_eq_one (r : ℝ≥0) : ↑r = (1 : ℝ) ↔ r = 1 := by
  

Proof state:
r : ℝ≥0
⊢ ↑r = 1 ↔ r = 1

Next tactic:
rw [← NNReal.coe_one, NNReal.coe_eq]
example : CommSemiring ℝ≥0 := by 

Proof state:
⊢ CommSemiring ℝ≥0

Next tactic:
infer_instance
/-- An `Algebra` over `ℝ` restricts to an `Algebra` over `ℝ≥0`. -/
instance {A : Type*} [Semiring A] [Algebra ℝ A] : Algebra ℝ≥0 A where
  smul := (· • ·)
  commutes' r x := by 

Proof state:
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra ℝ A
r : ℝ≥0
x : A
⊢ (RingHom.comp (algebraMap ℝ A) toRealHom) r * x = x * (RingHom.comp (algebraMap ℝ A) toRealHom) r

Next tactic:
simp [Algebra.commutes]
/-- An `Algebra` over `ℝ` restricts to an `Algebra` over `ℝ≥0`. -/
instance {A : Type*} [Semiring A] [Algebra ℝ A] : Algebra ℝ≥0 A where
  smul := (· • ·)
  commutes' r x := by simp [Algebra.commutes]
  smul_def' r x := by 

Proof state:
A : Type u_1
inst✝¹ : Semiring A
inst✝ : Algebra ℝ A
r : ℝ≥0
x : A
⊢ r • x = (RingHom.comp (algebraMap ℝ A) toRealHom) r * x

Next tactic:
simp [← Algebra.smul_def (r : ℝ) x, smul_def]
instance : StarModule ℝ≥0 ℝ where
  star_smul := by 

Proof state:
⊢ ∀ (r : ℝ≥0) (a : ℝ), star (r • a) = star r • star a

Next tactic:
simp only [star_trivial, eq_self_iff_true, forall_const]
example : Algebra ℝ≥0 ℝ := by 

Proof state:
⊢ Algebra ℝ≥0 ℝ

Next tactic:
infer_instance
example : DistribMulAction ℝ≥0ˣ ℝ := by 

Proof state:
⊢ DistribMulAction ℝ≥0ˣ ℝ

Next tactic:
infer_instance
example : MonoidWithZero ℝ≥0 := by 

Proof state:
⊢ MonoidWithZero ℝ≥0

Next tactic:
infer_instance
example : CommMonoidWithZero ℝ≥0 := by 

Proof state:
⊢ CommMonoidWithZero ℝ≥0

Next tactic:
infer_instance
noncomputable example : CommGroupWithZero ℝ≥0 := by 

Proof state:
⊢ CommGroupWithZero ℝ≥0

Next tactic:
infer_instance
theorem _root_.Real.toNNReal_sum_of_nonneg {α} {s : Finset α} {f : α → ℝ}
    (hf : ∀ a, a ∈ s → 0 ≤ f a) :
    Real.toNNReal (∑ a in s, f a) = ∑ a in s, Real.toNNReal (f a) := by
  

Proof state:
α : Type u_1
s : Finset α
f : α → ℝ
hf : ∀ a ∈ s, 0 ≤ f a
⊢ Real.toNNReal (∑ a in s, f a) = ∑ a in s, Real.toNNReal (f a)

Next tactic:
rw [← NNReal.coe_eq, NNReal.coe_sum, Real.coe_toNNReal _ (Finset.sum_nonneg hf)]
theorem _root_.Real.toNNReal_sum_of_nonneg {α} {s : Finset α} {f : α → ℝ}
    (hf : ∀ a, a ∈ s → 0 ≤ f a) :
    Real.toNNReal (∑ a in s, f a) = ∑ a in s, Real.toNNReal (f a) := by
  rw [← NNReal.coe_eq, NNReal.coe_sum, Real.coe_toNNReal _ (Finset.sum_nonneg hf)]
  

Proof state:
α : Type u_1
s : Finset α
f : α → ℝ
hf : ∀ a ∈ s, 0 ≤ f a
⊢ ∑ i in s, f i = ∑ a in s, ↑(Real.toNNReal (f a))

Next tactic:
exact Finset.sum_congr rfl fun x hxs => by rw [Real.coe_toNNReal _ (hf x hxs)]