l3lab/ntp-mathlib huggingface dataset:
/-- Define a `Group` structure on a Type by proving `∀ a, 1 * a = a` and
`∀ a, a⁻¹ * a = 1`.
Note that this uses the default definitions for `npow`, `zpow` and `div`.
See note [reducible non-instances]. -/
@[to_additive (attr := reducible)
"Define an `AddGroup` structure on a Type by proving `∀ a, 0 + a = a` and
`∀ a, -a + a = 0`.
Note that this uses the default definitions for `nsmul`, `zsmul` and `sub`.
See note [reducible non-instances]."]
def Group.ofLeftAxioms {G : Type u} [Mul G] [Inv G] [One G]
    (assoc : ∀ a b c : G, (a * b) * c = a * (b * c))
    (one_mul : ∀ a : G, 1 * a = a)
    (mul_left_inv : ∀ a : G, a⁻¹ * a = 1) : Group G :=
  { mul_assoc := assoc,
    one_mul := one_mul,
    mul_left_inv := mul_left_inv,
    mul_one := fun a => by
      have mul_right_inv : ∀ a, a * a⁻¹ = 1 := fun a =>
        calc a * a⁻¹ = 1 * (a * a⁻¹) := (one_mul _).symm
          _ = ((a * a⁻¹)⁻¹ * (a * a⁻¹)) * (a * a⁻¹) := by
            rw [mul_left_inv]
          _ = (a * a⁻¹)⁻¹ * (a * ((a⁻¹ * a) * a⁻¹)) := by
            simp only [assoc]
          _ = 1 := by
            rw [mul_left_inv, one_mul, mul_left_inv]
      

Proof state:
G : Type u
inst✝² : Mul G
inst✝¹ : Inv G
inst✝ : One G
assoc : ∀ (a b c : G), a * b * c = a * (b * c)
one_mul : ∀ (a : G), 1 * a = a
mul_left_inv : ∀ (a : G), a⁻¹ * a = 1
a : G
mul_right_inv : ∀ (a : G), a * a⁻¹ = 1
⊢ a * 1 = a

Next tactic:
rw [← mul_left_inv a, ← assoc, mul_right_inv a, one_mul]
/-- Define a `Group` structure on a Type by proving `∀ a, a * 1 = a` and
`∀ a, a * a⁻¹ = 1`.
Note that this uses the default definitions for `npow`, `zpow` and `div`.
See note [reducible non-instances]. -/
@[to_additive (attr := reducible)
"Define an `AddGroup` structure on a Type by proving `∀ a, a + 0 = a` and
`∀ a, a + -a = 0`.
Note that this uses the default definitions for `nsmul`, `zsmul` and `sub`.
See note [reducible non-instances]."]
def Group.ofRightAxioms {G : Type u} [Mul G] [Inv G] [One G]
    (assoc : ∀ a b c : G, (a * b) * c = a * (b * c))
    (mul_one : ∀ a : G, a * 1 = a)
    (mul_right_inv : ∀ a : G, a * a⁻¹ = 1) : Group G :=
  have mul_left_inv : ∀ a, a⁻¹ * a = 1 := fun a =>
    calc a⁻¹ * a = (a⁻¹ * a) * 1 := (mul_one _).symm
      _ = (a⁻¹ * a) * ((a⁻¹ * a) * (a⁻¹ * a)⁻¹) := by
        

Proof state:
G : Type u
inst✝² : Mul G
inst✝¹ : Inv G
inst✝ : One G
assoc : ∀ (a b c : G), a * b * c = a * (b * c)
mul_one : ∀ (a : G), a * 1 = a
mul_right_inv : ∀ (a : G), a * a⁻¹ = 1
a : G
⊢ a⁻¹ * a * 1 = a⁻¹ * a * (a⁻¹ * a * (a⁻¹ * a)⁻¹)

Next tactic:
rw [mul_right_inv]
/-- Define a `Group` structure on a Type by proving `∀ a, a * 1 = a` and
`∀ a, a * a⁻¹ = 1`.
Note that this uses the default definitions for `npow`, `zpow` and `div`.
See note [reducible non-instances]. -/
@[to_additive (attr := reducible)
"Define an `AddGroup` structure on a Type by proving `∀ a, a + 0 = a` and
`∀ a, a + -a = 0`.
Note that this uses the default definitions for `nsmul`, `zsmul` and `sub`.
See note [reducible non-instances]."]
def Group.ofRightAxioms {G : Type u} [Mul G] [Inv G] [One G]
    (assoc : ∀ a b c : G, (a * b) * c = a * (b * c))
    (mul_one : ∀ a : G, a * 1 = a)
    (mul_right_inv : ∀ a : G, a * a⁻¹ = 1) : Group G :=
  have mul_left_inv : ∀ a, a⁻¹ * a = 1 := fun a =>
    calc a⁻¹ * a = (a⁻¹ * a) * 1 := (mul_one _).symm
      _ = (a⁻¹ * a) * ((a⁻¹ * a) * (a⁻¹ * a)⁻¹) := by
        rw [mul_right_inv]
      _ = ((a⁻¹ * (a * a⁻¹)) * a) * (a⁻¹ * a)⁻¹ := by
        

Proof state:
G : Type u
inst✝² : Mul G
inst✝¹ : Inv G
inst✝ : One G
assoc : ∀ (a b c : G), a * b * c = a * (b * c)
mul_one : ∀ (a : G), a * 1 = a
mul_right_inv : ∀ (a : G), a * a⁻¹ = 1
a : G
⊢ a⁻¹ * a * (a⁻¹ * a * (a⁻¹ * a)⁻¹) = a⁻¹ * (a * a⁻¹) * a * (a⁻¹ * a)⁻¹

Next tactic:
simp only [assoc]
/-- Define a `Group` structure on a Type by proving `∀ a, a * 1 = a` and
`∀ a, a * a⁻¹ = 1`.
Note that this uses the default definitions for `npow`, `zpow` and `div`.
See note [reducible non-instances]. -/
@[to_additive (attr := reducible)
"Define an `AddGroup` structure on a Type by proving `∀ a, a + 0 = a` and
`∀ a, a + -a = 0`.
Note that this uses the default definitions for `nsmul`, `zsmul` and `sub`.
See note [reducible non-instances]."]
def Group.ofRightAxioms {G : Type u} [Mul G] [Inv G] [One G]
    (assoc : ∀ a b c : G, (a * b) * c = a * (b * c))
    (mul_one : ∀ a : G, a * 1 = a)
    (mul_right_inv : ∀ a : G, a * a⁻¹ = 1) : Group G :=
  have mul_left_inv : ∀ a, a⁻¹ * a = 1 := fun a =>
    calc a⁻¹ * a = (a⁻¹ * a) * 1 := (mul_one _).symm
      _ = (a⁻¹ * a) * ((a⁻¹ * a) * (a⁻¹ * a)⁻¹) := by
        rw [mul_right_inv]
      _ = ((a⁻¹ * (a * a⁻¹)) * a) * (a⁻¹ * a)⁻¹ := by
        simp only [assoc]
      _ = 1 := by
        

Proof state:
G : Type u
inst✝² : Mul G
inst✝¹ : Inv G
inst✝ : One G
assoc : ∀ (a b c : G), a * b * c = a * (b * c)
mul_one : ∀ (a : G), a * 1 = a
mul_right_inv : ∀ (a : G), a * a⁻¹ = 1
a : G
⊢ a⁻¹ * (a * a⁻¹) * a * (a⁻¹ * a)⁻¹ = 1

Next tactic:
rw [mul_right_inv, mul_one, mul_right_inv]
/-- Define a `Group` structure on a Type by proving `∀ a, a * 1 = a` and
`∀ a, a * a⁻¹ = 1`.
Note that this uses the default definitions for `npow`, `zpow` and `div`.
See note [reducible non-instances]. -/
@[to_additive (attr := reducible)
"Define an `AddGroup` structure on a Type by proving `∀ a, a + 0 = a` and
`∀ a, a + -a = 0`.
Note that this uses the default definitions for `nsmul`, `zsmul` and `sub`.
See note [reducible non-instances]."]
def Group.ofRightAxioms {G : Type u} [Mul G] [Inv G] [One G]
    (assoc : ∀ a b c : G, (a * b) * c = a * (b * c))
    (mul_one : ∀ a : G, a * 1 = a)
    (mul_right_inv : ∀ a : G, a * a⁻¹ = 1) : Group G :=
  have mul_left_inv : ∀ a, a⁻¹ * a = 1 := fun a =>
    calc a⁻¹ * a = (a⁻¹ * a) * 1 := (mul_one _).symm
      _ = (a⁻¹ * a) * ((a⁻¹ * a) * (a⁻¹ * a)⁻¹) := by
        rw [mul_right_inv]
      _ = ((a⁻¹ * (a * a⁻¹)) * a) * (a⁻¹ * a)⁻¹ := by
        simp only [assoc]
      _ = 1 := by
        rw [mul_right_inv, mul_one, mul_right_inv]
  { mul_assoc := assoc,
    mul_one := mul_one,
    mul_left_inv := mul_left_inv,
    one_mul := fun a => by
      

Proof state:
G : Type u
inst✝² : Mul G
inst✝¹ : Inv G
inst✝ : One G
assoc : ∀ (a b c : G), a * b * c = a * (b * c)
mul_one : ∀ (a : G), a * 1 = a
mul_right_inv : ∀ (a : G), a * a⁻¹ = 1
mul_left_inv : ∀ (a : G), a⁻¹ * a = 1
a : G
⊢ 1 * a = a

Next tactic:
rw [← mul_right_inv a, assoc, mul_left_inv, mul_one]
theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') :
    η = η' := by
  

Proof state:
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η η' : ApplicativeTransformation F G
h : (fun {α} => app η α) = fun {α} => app η' α
⊢ η = η'

Next tactic:
cases η
theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') :
    η = η' := by
  cases η
  

Proof state:
case mk
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η' : ApplicativeTransformation F G
app✝ : (α : Type u) → F α → G α
preserves_pure'✝ : ∀ {α : Type u} (x : α), app✝ α (pure x) = pure x
preserves_seq'✝ :
  ∀ {α β : Type u} (x : F (α → β)) (y : F α), app✝ β (Seq.seq x fun x => y) = Seq.seq (app✝ (α → β) x) fun x => app✝ α y
h :
  (fun {α} => app { app := app✝, preserves_pure' := preserves_pure'✝, preserves_seq' := preserves_seq'✝ } α) =
    fun {α} => app η' α
⊢ { app := app✝, preserves_pure' := preserves_pure'✝, preserves_seq' := preserves_seq'✝ } = η'

Next tactic:
cases η'
theorem coe_inj ⦃η η' : ApplicativeTransformation F G⦄ (h : (η : ∀ α, F α → G α) = η') :
    η = η' := by
  cases η
  cases η'
  

Proof state:
case mk.mk
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
app✝¹ : (α : Type u) → F α → G α
preserves_pure'✝¹ : ∀ {α : Type u} (x : α), app✝¹ α (pure x) = pure x
preserves_seq'✝¹ :
  ∀ {α β : Type u} (x : F (α → β)) (y : F α),
    app✝¹ β (Seq.seq x fun x => y) = Seq.seq (app✝¹ (α → β) x) fun x => app✝¹ α y
app✝ : (α : Type u) → F α → G α
preserves_pure'✝ : ∀ {α : Type u} (x : α), app✝ α (pure x) = pure x
preserves_seq'✝ :
  ∀ {α β : Type u} (x : F (α → β)) (y : F α), app✝ β (Seq.seq x fun x => y) = Seq.seq (app✝ (α → β) x) fun x => app✝ α y
h :
  (fun {α} => app { app := app✝¹, preserves_pure' := preserves_pure'✝¹, preserves_seq' := preserves_seq'✝¹ } α) =
    fun {α} => app { app := app✝, preserves_pure' := preserves_pure'✝, preserves_seq' := preserves_seq'✝ } α
⊢ { app := app✝¹, preserves_pure' := preserves_pure'✝¹, preserves_seq' := preserves_seq'✝¹ } =
    { app := app✝, preserves_pure' := preserves_pure'✝, preserves_seq' := preserves_seq'✝ }

Next tactic:
congr
@[ext]
theorem ext ⦃η η' : ApplicativeTransformation F G⦄ (h : ∀ (α : Type u) (x : F α), η x = η' x) :
    η = η' := by
  

Proof state:
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η η' : ApplicativeTransformation F G
h : ∀ (α : Type u) (x : F α), (fun {α} => app η α) x = (fun {α} => app η' α) x
⊢ η = η'

Next tactic:
apply coe_inj
@[ext]
theorem ext ⦃η η' : ApplicativeTransformation F G⦄ (h : ∀ (α : Type u) (x : F α), η x = η' x) :
    η = η' := by
  apply coe_inj
  

Proof state:
case h
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η η' : ApplicativeTransformation F G
h : ∀ (α : Type u) (x : F α), (fun {α} => app η α) x = (fun {α} => app η' α) x
⊢ (fun {α} => app η α) = fun {α} => app η' α

Next tactic:
ext1 α
@[ext]
theorem ext ⦃η η' : ApplicativeTransformation F G⦄ (h : ∀ (α : Type u) (x : F α), η x = η' x) :
    η = η' := by
  apply coe_inj
  ext1 α
  

Proof state:
case h.h
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η η' : ApplicativeTransformation F G
h : ∀ (α : Type u) (x : F α), (fun {α} => app η α) x = (fun {α} => app η' α) x
α : Type u
⊢ app η α = app η' α

Next tactic:
exact funext (h α)
@[functor_norm]
theorem preserves_map {α β} (x : α → β) (y : F α) : η (x <$> y) = x <$> η y := by
  

Proof state:
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η : ApplicativeTransformation F G
α β : Type u
x : α → β
y : F α
⊢ (fun {α} => app η α) (x <$> y) = x <$> (fun {α} => app η α) y

Next tactic:
rw [← pure_seq, η.preserves_seq, preserves_pure, pure_seq]
theorem preserves_map' {α β} (x : α → β) : @η _ ∘ Functor.map x = Functor.map x ∘ @η _ := by
  

Proof state:
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η : ApplicativeTransformation F G
α β : Type u
x : α → β
⊢ (fun {α} => app η α) ∘ Functor.map x = Functor.map x ∘ fun {α} => app η α

Next tactic:
ext y
theorem preserves_map' {α β} (x : α → β) : @η _ ∘ Functor.map x = Functor.map x ∘ @η _ := by
  ext y
  

Proof state:
case h
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
η : ApplicativeTransformation F G
α β : Type u
x : α → β
y : F α
⊢ ((fun {α} => app η α) ∘ Functor.map x) y = (Functor.map x ∘ fun {α} => app η α) y

Next tactic:
exact preserves_map η x y
/-- The identity applicative transformation from an applicative functor to itself. -/
def idTransformation : ApplicativeTransformation F F where
  app α := id
  preserves_pure' := by 

Proof state:
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
⊢ ∀ {α : Type u} (x : α), (fun α => id) α (pure x) = pure x

Next tactic:
simp
/-- The identity applicative transformation from an applicative functor to itself. -/
def idTransformation : ApplicativeTransformation F F where
  app α := id
  preserves_pure' := by simp
  preserves_seq' x y := by 

Proof state:
F : Type u → Type v
inst✝³ : Applicative F
inst✝² : LawfulApplicative F
G : Type u → Type w
inst✝¹ : Applicative G
inst✝ : LawfulApplicative G
α✝ β✝ : Type u
x : F (α✝ → β✝)
y : F α✝
⊢ (fun α => id) β✝ (Seq.seq x fun x => y) = Seq.seq ((fun α => id) (α✝ → β✝) x) fun x => (fun α => id) α✝ y

Next tactic:
simp
/-- The composition of applicative transformations. -/
def comp (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F G) :
    ApplicativeTransformation F H where
  app α x := η' (η x)
  -- Porting note: something has gone wrong with `simp [functor_norm]`,
  -- which should suffice for the next two.
  preserves_pure' x := by 

Proof state:
F : Type u → Type v
inst✝⁵ : Applicative F
inst✝⁴ : LawfulApplicative F
G : Type u → Type w
inst✝³ : Applicative G
inst✝² : LawfulApplicative G
H : Type u → Type s
inst✝¹ : Applicative H
inst✝ : LawfulApplicative H
η' : ApplicativeTransformation G H
η : ApplicativeTransformation F G
α✝ : Type u
x : α✝
⊢ (fun α x => (fun {α} => app η' α) ((fun {α} => app η α) x)) α✝ (pure x) = pure x

Next tactic:
simp only [preserves_pure]
/-- The composition of applicative transformations. -/
def comp (η' : ApplicativeTransformation G H) (η : ApplicativeTransformation F G) :
    ApplicativeTransformation F H where
  app α x := η' (η x)
  -- Porting note: something has gone wrong with `simp [functor_norm]`,
  -- which should suffice for the next two.
  preserves_pure' x := by simp only [preserves_pure]
  preserves_seq' x y := by 

Proof state:
F : Type u → Type v
inst✝⁵ : Applicative F
inst✝⁴ : LawfulApplicative F
G : Type u → Type w
inst✝³ : Applicative G
inst✝² : LawfulApplicative G
H : Type u → Type s
inst✝¹ : Applicative H
inst✝ : LawfulApplicative H
η' : ApplicativeTransformation G H
η : ApplicativeTransformation F G
α✝ β✝ : Type u
x : F (α✝ → β✝)
y : F α✝
⊢ (fun α x => (fun {α} => app η' α) ((fun {α} => app η α) x)) β✝ (Seq.seq x fun x => y) =
    Seq.seq ((fun α x => (fun {α} => app η' α) ((fun {α} => app η α) x)) (α✝ → β✝) x) fun x =>
      (fun α x => (fun {α} => app η' α) ((fun {α} => app η α) x)) α✝ y

Next tactic:
simp only [preserves_seq]
instance : LawfulTraversable Id := by 

Proof state:
⊢ LawfulTraversable Id

Next tactic:
refine' { .. }
instance : LawfulTraversable Id := by refine' { .. } <;> 

Proof state:
case refine'_1
⊢ ∀ {α β : Type ?u.10608}, mapConst = map ∘ const β

Next tactic:
intros
instance : LawfulTraversable Id := by refine' { .. } <;> 

Proof state:
case refine'_2
⊢ ∀ {α : Type ?u.10608} (x : Id α), id <$> x = x

Next tactic:
intros
instance : LawfulTraversable Id := by refine' { .. } <;> 

Proof state:
case refine'_3
⊢ ∀ {α β γ : Type ?u.10608} (g : α → β) (h : β → γ) (x : Id α), (h ∘ g) <$> x = h <$> g <$> x

Next tactic:
intros
instance : LawfulTraversable Id := by refine' { .. } <;> 

Proof state:
case refine'_4
⊢ ∀ {α : Type ?u.10608} (x : Id α), traverse pure x = x

Next tactic:
intros
instance : LawfulTraversable Id := by refine' { .. } <;> 

Proof state:
case refine'_5
⊢ ∀ {F G : Type ?u.10608 → Type ?u.10608} [inst : Applicative F] [inst_1 : Applicative G] [inst_2 : LawfulApplicative F]
    [inst_3 : LawfulApplicative G] {α β γ : Type ?u.10608} (f : β → F γ) (g : α → G β) (x : Id α),
    traverse (Comp.mk ∘ map f ∘ g) x = Comp.mk (traverse f <$> traverse g x)

Next tactic:
intros
instance : LawfulTraversable Id := by refine' { .. } <;> 

Proof state:
case refine'_6
⊢ ∀ {α β : Type ?u.10608} (f : α → β) (x : Id α), traverse (pure ∘ f) x = id.mk (f <$> x)

Next tactic:
intros
instance : LawfulTraversable Id := by refine' { .. } <;> 

Proof state:
case refine'_7
⊢ ∀ {F G : Type ?u.10608 → Type ?u.10608} [inst : Applicative F] [inst_1 : Applicative G] [inst_2 : LawfulApplicative F]
    [inst_3 : LawfulApplicative G] (η : ApplicativeTransformation F G) {α β : Type ?u.10608} (f : α → F β) (x : Id α),
    (fun {α} => ApplicativeTransformation.app η α) (traverse f x) =
      traverse ((fun {α} => ApplicativeTransformation.app η α) ∘ f) x

Next tactic:
intros
instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_1
α✝ β✝ : Type ?u.10608
⊢ mapConst = map ∘ const β✝

Next tactic:
rfl
instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_2
α✝ : Type ?u.10608
x✝ : Id α✝
⊢ id <$> x✝ = x✝

Next tactic:
rfl
instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_3
α✝ β✝ γ✝ : Type ?u.10608
g✝ : α✝ → β✝
h✝ : β✝ → γ✝
x✝ : Id α✝
⊢ (h✝ ∘ g✝) <$> x✝ = h✝ <$> g✝ <$> x✝

Next tactic:
rfl
instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_4
α✝ : Type ?u.10608
x✝ : Id α✝
⊢ traverse pure x✝ = x✝

Next tactic:
rfl
instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_5
F✝ G✝ : Type ?u.10608 → Type ?u.10608
inst✝³ : Applicative F✝
inst✝² : Applicative G✝
inst✝¹ : LawfulApplicative F✝
inst✝ : LawfulApplicative G✝
α✝ β✝ γ✝ : Type ?u.10608
f✝ : β✝ → F✝ γ✝
g✝ : α✝ → G✝ β✝
x✝ : Id α✝
⊢ traverse (Comp.mk ∘ map f✝ ∘ g✝) x✝ = Comp.mk (traverse f✝ <$> traverse g✝ x✝)

Next tactic:
rfl
instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_6
α✝ β✝ : Type ?u.10608
f✝ : α✝ → β✝
x✝ : Id α✝
⊢ traverse (pure ∘ f✝) x✝ = id.mk (f✝ <$> x✝)

Next tactic:
rfl
instance : LawfulTraversable Id := by refine' { .. } <;> intros <;> 

Proof state:
case refine'_7
F✝ G✝ : Type ?u.10608 → Type ?u.10608
inst✝³ : Applicative F✝
inst✝² : Applicative G✝
inst✝¹ : LawfulApplicative F✝
inst✝ : LawfulApplicative G✝
η✝ : ApplicativeTransformation F✝ G✝
α✝ β✝ : Type ?u.10608
f✝ : α✝ → F✝ β✝
x✝ : Id α✝
⊢ (fun {α} => ApplicativeTransformation.app η✝ α) (traverse f✝ x✝) =
    traverse ((fun {α} => ApplicativeTransformation.app η✝ α) ∘ f✝) x✝

Next tactic:
rfl
@[simp]
theorem cast_inv_nat (n : ℕ) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹ := by
  

Proof state:
α : Type u_1
inst✝ : DivisionRing α
n : ℕ
⊢ ↑(↑n)⁻¹ = (↑n)⁻¹

Next tactic:
cases' n with n
@[simp]
theorem cast_inv_nat (n : ℕ) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹ := by
  cases' n with n
  · 

Proof state:
case zero
α : Type u_1
inst✝ : DivisionRing α
⊢ ↑(↑Nat.zero)⁻¹ = (↑Nat.zero)⁻¹

Next tactic:
simp
@[simp]
theorem cast_inv_nat (n : ℕ) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹ := by
  cases' n with n
  · simp
  

Proof state:
case succ
α : Type u_1
inst✝ : DivisionRing α
n : ℕ
⊢ ↑(↑(Nat.succ n))⁻¹ = (↑(Nat.succ n))⁻¹

Next tactic:
rw [cast_def, inv_coe_nat_num, inv_coe_nat_den, if_neg n.succ_ne_zero,
    Int.sign_eq_one_of_pos (Nat.cast_pos.mpr n.succ_pos), Int.cast_one, one_div]
@[simp]
theorem cast_inv_int (n : ℤ) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹ := by
  

Proof state:
α : Type u_1
inst✝ : DivisionRing α
n : ℤ
⊢ ↑(↑n)⁻¹ = (↑n)⁻¹

Next tactic:
cases' n with n n
@[simp]
theorem cast_inv_int (n : ℤ) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹ := by
  cases' n with n n
  · 

Proof state:
case ofNat
α : Type u_1
inst✝ : DivisionRing α
n : ℕ
⊢ ↑(↑(Int.ofNat n))⁻¹ = (↑(Int.ofNat n))⁻¹

Next tactic:
simp [ofInt_eq_cast, cast_inv_nat]
@[simp]
theorem cast_inv_int (n : ℤ) : ((n⁻¹ : ℚ) : α) = (n : α)⁻¹ := by
  cases' n with n n
  · simp [ofInt_eq_cast, cast_inv_nat]
  · 

Proof state:
case negSucc
α : Type u_1
inst✝ : DivisionRing α
n : ℕ
⊢ ↑(↑(Int.negSucc n))⁻¹ = (↑(Int.negSucc n))⁻¹

Next tactic:
simp only [ofInt_eq_cast, Int.cast_negSucc, ← Nat.cast_succ, cast_neg, inv_neg, cast_inv_nat]
theorem sub_mem : x ≡ y [SMOD U] ↔ x - y ∈ U := by 

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
U U₁ U₂ : Submodule R M
x x₁ x₂ y y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
V V₁ V₂ : Submodule R N
⊢ x ≡ y [SMOD U] ↔ x - y ∈ U

Next tactic:
rw [SModEq.def, Submodule.Quotient.eq]
@[simp]
theorem bot : x ≡ y [SMOD (⊥ : Submodule R M)] ↔ x = y := by
  

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
U U₁ U₂ : Submodule R M
x x₁ x₂ y y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
V V₁ V₂ : Submodule R N
⊢ x ≡ y [SMOD ⊥] ↔ x = y

Next tactic:
rw [SModEq.def, Submodule.Quotient.eq, mem_bot, sub_eq_zero]
theorem add (hxy₁ : x₁ ≡ y₁ [SMOD U]) (hxy₂ : x₂ ≡ y₂ [SMOD U]) : x₁ + x₂ ≡ y₁ + y₂ [SMOD U] := by
  

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
U U₁ U₂ : Submodule R M
x x₁ x₂ y y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
V V₁ V₂ : Submodule R N
hxy₁ : x₁ ≡ y₁ [SMOD U]
hxy₂ : x₂ ≡ y₂ [SMOD U]
⊢ x₁ + x₂ ≡ y₁ + y₂ [SMOD U]

Next tactic:
rw [SModEq.def] at hxy₁ hxy₂ ⊢
theorem add (hxy₁ : x₁ ≡ y₁ [SMOD U]) (hxy₂ : x₂ ≡ y₂ [SMOD U]) : x₁ + x₂ ≡ y₁ + y₂ [SMOD U] := by
  rw [SModEq.def] at hxy₁ hxy₂ ⊢
  

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
U U₁ U₂ : Submodule R M
x x₁ x₂ y y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
V V₁ V₂ : Submodule R N
hxy₁ : Submodule.Quotient.mk x₁ = Submodule.Quotient.mk y₁
hxy₂ : Submodule.Quotient.mk x₂ = Submodule.Quotient.mk y₂
⊢ Submodule.Quotient.mk (x₁ + x₂) = Submodule.Quotient.mk (y₁ + y₂)

Next tactic:
simp_rw [Quotient.mk_add, hxy₁, hxy₂]
theorem smul (hxy : x ≡ y [SMOD U]) (c : R) : c • x ≡ c • y [SMOD U] := by
  

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
U U₁ U₂ : Submodule R M
x x₁ x₂ y y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
V V₁ V₂ : Submodule R N
hxy : x ≡ y [SMOD U]
c : R
⊢ c • x ≡ c • y [SMOD U]

Next tactic:
rw [SModEq.def] at hxy ⊢
theorem smul (hxy : x ≡ y [SMOD U]) (c : R) : c • x ≡ c • y [SMOD U] := by
  rw [SModEq.def] at hxy ⊢
  

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
U U₁ U₂ : Submodule R M
x x₁ x₂ y y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
V V₁ V₂ : Submodule R N
hxy : Submodule.Quotient.mk x = Submodule.Quotient.mk y
c : R
⊢ Submodule.Quotient.mk (c • x) = Submodule.Quotient.mk (c • y)

Next tactic:
simp_rw [Quotient.mk_smul, hxy]
theorem zero : x ≡ 0 [SMOD U] ↔ x ∈ U := by 

Proof state:
R : Type u_1
inst✝⁴ : Ring R
M : Type u_2
inst✝³ : AddCommGroup M
inst✝² : Module R M
U U₁ U₂ : Submodule R M
x x₁ x₂ y y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝¹ : AddCommGroup N
inst✝ : Module R N
V V₁ V₂ : Submodule R N
⊢ x ≡ 0 [SMOD U] ↔ x ∈ U

Next tactic:
rw [SModEq.def, Submodule.Quotient.eq, sub_zero]
theorem eval {R : Type*} [CommRing R] {I : Ideal R} {x y : R} (h : x ≡ y [SMOD I]) (f : R[X]) :
    f.eval x ≡ f.eval y [SMOD I] := by
  

Proof state:
R✝ : Type u_1
inst✝⁵ : Ring R✝
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
U U₁ U₂ : Submodule R✝ M
x✝ x₁ x₂ y✝ y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R✝ N
V V₁ V₂ : Submodule R✝ N
R : Type u_4
inst✝ : CommRing R
I : Ideal R
x y : R
h : x ≡ y [SMOD I]
f : R[X]
⊢ Polynomial.eval x f ≡ Polynomial.eval y f [SMOD I]

Next tactic:
rw [SModEq.def] at h ⊢
theorem eval {R : Type*} [CommRing R] {I : Ideal R} {x y : R} (h : x ≡ y [SMOD I]) (f : R[X]) :
    f.eval x ≡ f.eval y [SMOD I] := by
  rw [SModEq.def] at h ⊢
  

Proof state:
R✝ : Type u_1
inst✝⁵ : Ring R✝
M : Type u_2
inst✝⁴ : AddCommGroup M
inst✝³ : Module R✝ M
U U₁ U₂ : Submodule R✝ M
x✝ x₁ x₂ y✝ y₁ y₂ z z₁ z₂ : M
N : Type u_3
inst✝² : AddCommGroup N
inst✝¹ : Module R✝ N
V V₁ V₂ : Submodule R✝ N
R : Type u_4
inst✝ : CommRing R
I : Ideal R
x y : R
h : Submodule.Quotient.mk x = Submodule.Quotient.mk y
f : R[X]
⊢ Submodule.Quotient.mk (Polynomial.eval x f) = Submodule.Quotient.mk (Polynomial.eval y f)

Next tactic:
show Ideal.Quotient.mk I (f.eval x) = Ideal.Quotient.mk I (f.eval y)