Theorem: FormalSum.cons_equiv_of_equiv (UnitConjecture/FreeModule.lean)

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
⊢ s₁ ≃ s₂ → (a, x) :: s₁ ≃ (a, x) :: s₂
Tactic:
intro h
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂
Tactic:
let f : FormalSum R X → FreeModuleAux R X := fun s => sum <| (a, x) :: s
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂
Tactic:
let wit : (s₁ s₂ : FormalSum R X) → (ElementaryMove R X s₁ s₂) → f s₁ = f s₂ := by
  intro s₁ s₂ hyp
  apply Quot.sound
  apply ElementaryMove.cons
  assumption
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂
Tactic:
let g := Quot.lift f wit
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂
Tactic:
let factorizes : (s : FormalSum R X) → g (s.sum) = sum ((a, x) :: s) := Quot.liftBeta f wit
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ (a, x) :: s₁ ≃ (a, x) :: s₂
Tactic:
rw [equiv]
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ sum ((a, x) :: s₁) = sum ((a, x) :: s₂)

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ sum ((a, x) :: s₁) = sum ((a, x) :: s₂)
Tactic:
rw [← factorizes]
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ g (sum s₁) = sum ((a, x) :: s₂)

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ g (sum s₁) = sum ((a, x) :: s₂)
Tactic:
rw [← factorizes]
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ g (sum s₁) = g (sum s₂)

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
wit : ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂ :=
  fun s₁ s₂ hyp => Quot.sound (ElementaryMove.cons a x s₁ s₂ hyp)
g : (Quot fun a b => ElementaryMove R X a b) → FreeModuleAux R X := Quot.lift f wit
factorizes : ∀ (s : FormalSum R X), g (sum s) = sum ((a, x) :: s) := Quot.liftBeta f wit
⊢ g (sum s₁) = g (sum s₂)
Tactic:
rw [h]
State after:
no goals

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁ s₂ : FormalSum R X
a : R
x : X
h : s₁ ≃ s₂
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
⊢ ∀ (s₁ s₂ : FormalSum R X), ElementaryMove R X s₁ s₂ → f s₁ = f s₂
Tactic:
intro s₁ s₂ hyp
State after:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁✝ s₂✝ : FormalSum R X
a : R
x : X
h : s₁✝ ≃ s₂✝
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
s₁ s₂ : FormalSum R X
hyp : ElementaryMove R X s₁ s₂
⊢ f s₁ = f s₂

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁✝ s₂✝ : FormalSum R X
a : R
x : X
h : s₁✝ ≃ s₂✝
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
s₁ s₂ : FormalSum R X
hyp : ElementaryMove R X s₁ s₂
⊢ f s₁ = f s₂
Tactic:
apply Quot.sound
State after:
case a
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁✝ s₂✝ : FormalSum R X
a : R
x : X
h : s₁✝ ≃ s₂✝
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
s₁ s₂ : FormalSum R X
hyp : ElementaryMove R X s₁ s₂
⊢ ElementaryMove R X ((a, x) :: s₁) ((a, x) :: s₂)

State before:
case a
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁✝ s₂✝ : FormalSum R X
a : R
x : X
h : s₁✝ ≃ s₂✝
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
s₁ s₂ : FormalSum R X
hyp : ElementaryMove R X s₁ s₂
⊢ ElementaryMove R X ((a, x) :: s₁) ((a, x) :: s₂)
Tactic:
apply ElementaryMove.cons
State after:
case a.a
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁✝ s₂✝ : FormalSum R X
a : R
x : X
h : s₁✝ ≃ s₂✝
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
s₁ s₂ : FormalSum R X
hyp : ElementaryMove R X s₁ s₂
⊢ ElementaryMove R X s₁ s₂

State before:
case a.a
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
s₁✝ s₂✝ : FormalSum R X
a : R
x : X
h : s₁✝ ≃ s₂✝
f : FormalSum R X → FreeModuleAux R X := fun s => sum ((a, x) :: s)
s₁ s₂ : FormalSum R X
hyp : ElementaryMove R X s₁ s₂
⊢ ElementaryMove R X s₁ s₂
Tactic:
assumption
State after:
no goals