This repository was archived by the owner on Jul 24, 2024. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 292
[Merged by Bors] - chore(number_theory/number_field/embeddings): golf #16804
          
     Closed
      
      
    
  
     Closed
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            8 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      66d422f
              
                golf `coeff_le_of_roots_le`
              
              
                alreadydone f5f4432
              
                simplification
              
              
                alreadydone 2e666f5
              
                a bit more golf
              
              
                alreadydone e61cf7f
              
                golf embeddings
              
              
                alreadydone 5855d16
              
                golf bUnion_roots_finite
              
              
                alreadydone 9ab68b8
              
                Merge remote-tracking branch 'origin/master' into num_field_embedding…
              
              
                alreadydone c9068b2
              
                Merge remote-tracking branch 'origin/staging' into num_field_embeddin…
              
              
                alreadydone de172cc
              
                out of WIP status
              
              
                alreadydone File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -48,51 +48,15 @@ section roots | |
|  | ||
| open set polynomial | ||
|  | ||
| /-- Let `A` an algebraically closed field and let `x ∈ K`, with `K` a number field. For `F`, | ||
| subfield of `K`, the images of `x` by the `F`-algebra morphisms from `K` to `A` are exactly | ||
| the roots in `A` of the minimal polynomial of `x` over `F`. -/ | ||
| lemma range_eq_roots (F K A : Type*) [field F] [number_field F] [field K] [number_field K] | ||
| [field A] [is_alg_closed A] [algebra F K] [algebra F A] (x : K) : | ||
| range (λ ψ : K →ₐ[F] A, ψ x) = (minpoly F x).root_set A := | ||
| begin | ||
| haveI : finite_dimensional F K := finite_dimensional.right ℚ _ _ , | ||
| have hx : is_integral F x := is_separable.is_integral F x, | ||
| ext a, split, | ||
| { rintro ⟨ψ, hψ⟩, | ||
| rw [mem_root_set_iff, ←hψ], | ||
| { rw aeval_alg_hom_apply ψ x (minpoly F x), | ||
| simp only [minpoly.aeval, map_zero], }, | ||
| exact minpoly.ne_zero hx, }, | ||
| { intro ha, | ||
| let Fx := adjoin_root (minpoly F x), | ||
| haveI : fact (irreducible $ minpoly F x) := ⟨minpoly.irreducible hx⟩, | ||
| have hK : (aeval x) (minpoly F x) = 0 := minpoly.aeval _ _, | ||
| have hA : (aeval a) (minpoly F x) = 0, | ||
| { rwa [aeval_def, ←eval_map, ←mem_root_set_iff'], | ||
| exact monic.ne_zero (monic.map (algebra_map F A) (minpoly.monic hx)), }, | ||
| letI : algebra Fx A := ring_hom.to_algebra (by convert adjoin_root.lift (algebra_map F A) a hA), | ||
| letI : algebra Fx K := ring_hom.to_algebra (by convert adjoin_root.lift (algebra_map F K) x hK), | ||
| haveI : finite_dimensional Fx K := finite_dimensional.right ℚ _ _ , | ||
| let ψ₀ : K →ₐ[Fx] A := is_alg_closed.lift (algebra.is_algebraic_of_finite _ _), | ||
| haveI : is_scalar_tower F Fx K := is_scalar_tower.of_ring_hom (adjoin_root.lift_hom _ _ hK), | ||
| haveI : is_scalar_tower F Fx A := is_scalar_tower.of_ring_hom (adjoin_root.lift_hom _ _ hA), | ||
| let ψ : K →ₐ[F] A := alg_hom.restrict_scalars F ψ₀, | ||
| refine ⟨ψ, _⟩, | ||
| rw (_ : x = (algebra_map Fx K) (adjoin_root.root (minpoly F x))), | ||
| rw (_ : a = (algebra_map Fx A) (adjoin_root.root (minpoly F x))), | ||
| exact alg_hom.commutes _ _, | ||
| exact (adjoin_root.lift_root hA).symm, | ||
| exact (adjoin_root.lift_root hK).symm, }, | ||
| end | ||
|  | ||
| variables (K A : Type*) [field K] [number_field K] [field A] [char_zero A] [is_alg_closed A] (x : K) | ||
| variables (K A : Type*) [field K] [number_field K] | ||
| [field A] [algebra ℚ A] [is_alg_closed A] (x : K) | ||
|  | ||
| /-- Let `A` be an algebraically closed field and let `x ∈ K`, with `K` a number field. | ||
| The images of `x` by the embeddings of `K` in `A` are exactly the roots in `A` of | ||
| the minimal polynomial of `x` over `ℚ`. -/ | ||
| lemma rat_range_eq_roots : range (λ φ : K →+* A, φ x) = (minpoly ℚ x).root_set A := | ||
| lemma range_eval_eq_root_set_minpoly : range (λ φ : K →+* A, φ x) = (minpoly ℚ x).root_set A := | ||
| begin | ||
| convert range_eq_roots ℚ K A x using 1, | ||
| convert (number_field.is_algebraic K).range_eval_eq_root_set_minpoly A x using 1, | ||
| ext a, | ||
| exact ⟨λ ⟨φ, hφ⟩, ⟨φ.to_rat_alg_hom, hφ⟩, λ ⟨φ, hφ⟩, ⟨φ.to_ring_hom, hφ⟩⟩, | ||
| end | ||
|  | @@ -106,20 +70,16 @@ open finite_dimensional polynomial set | |
| variables {K : Type*} [field K] [number_field K] | ||
| variables {A : Type*} [normed_field A] [is_alg_closed A] [normed_algebra ℚ A] | ||
|  | ||
| lemma coeff_bdd_of_norm_le {B : ℝ} {x : K} (h : ∀ φ : K →+* A, ∥φ x∥ ≤ B) (i : ℕ): | ||
| lemma coeff_bdd_of_norm_le {B : ℝ} {x : K} (h : ∀ φ : K →+* A, ∥φ x∥ ≤ B) (i : ℕ) : | ||
| ∥(minpoly ℚ x).coeff i∥ ≤ (max B 1) ^ (finrank ℚ K) * (finrank ℚ K).choose ((finrank ℚ K) / 2) := | ||
| begin | ||
| have hx : is_integral ℚ x := is_separable.is_integral _ _, | ||
| rw (by rw [coeff_map, norm_algebra_map'] : | ||
| ∥(minpoly ℚ x).coeff i∥ = ∥(map (algebra_map ℚ A) (minpoly ℚ x)).coeff i∥), | ||
| have hx := is_separable.is_integral ℚ x, | ||
| rw [← norm_algebra_map' A, ← coeff_map (algebra_map ℚ A)], | ||
| refine coeff_bdd_of_roots_le _ (minpoly.monic hx) (is_alg_closed.splits_codomain _) | ||
| (minpoly.nat_degree_le hx) _ i, | ||
| intros z hz, | ||
| rsuffices ⟨φ, rfl⟩ : ∃ (φ : K →+* A), φ x = z, {exact h φ }, | ||
| letI : char_zero A := char_zero_of_injective_algebra_map (algebra_map ℚ _).injective, | ||
| rw [← set.mem_range, rat_range_eq_roots, mem_root_set_iff, aeval_def], | ||
| convert (mem_roots_map _).mp hz, | ||
| repeat { exact monic.ne_zero (minpoly.monic hx), }, | ||
| (minpoly.nat_degree_le hx) (λ z hz, _) i, | ||
| classical, rw ← multiset.mem_to_finset at hz, | ||
| obtain ⟨φ, rfl⟩ := (range_eval_eq_root_set_minpoly K A x).symm.subset hz, | ||
| exact h φ, | ||
| end | ||
|  | ||
| variables (K A) | ||
|  | @@ -131,42 +91,33 @@ lemma finite_of_norm_le (B : ℝ) : | |
| begin | ||
| let C := nat.ceil ((max B 1) ^ (finrank ℚ K) * (finrank ℚ K).choose ((finrank ℚ K) / 2)), | ||
| have := bUnion_roots_finite (algebra_map ℤ K) (finrank ℚ K) (finite_Icc (-C : ℤ) C), | ||
| refine this.subset (λ x hx, _), | ||
| have h_map_rat_minpoly := minpoly.gcd_domain_eq_field_fractions' ℚ hx.1, | ||
| rw mem_Union, | ||
| use minpoly ℤ x, | ||
| rw [mem_Union, exists_prop], | ||
| refine ⟨⟨_, λ i, _⟩, _⟩, | ||
| { rw [← nat_degree_map_eq_of_injective (algebra_map ℤ ℚ).injective_int _, ← h_map_rat_minpoly], | ||
| exact minpoly.nat_degree_le (is_integral_of_is_scalar_tower _ hx.1), }, | ||
| { rw [mem_Icc, ← abs_le, ← @int.cast_le ℝ], | ||
| apply le_trans _ (nat.le_ceil _), | ||
| convert coeff_bdd_of_norm_le hx.2 i, | ||
| simp only [h_map_rat_minpoly, coeff_map, eq_int_cast, int.norm_cast_rat, int.norm_eq_abs, | ||
| int.cast_abs], }, | ||
| { rw [finset.mem_coe, multiset.mem_to_finset, mem_roots, is_root.def, ← eval₂_eq_eval_map, | ||
| ← aeval_def], | ||
| { exact minpoly.aeval ℤ x, }, | ||
| { exact monic.ne_zero (monic.map (algebra_map ℤ K) (minpoly.monic hx.1)), }}, | ||
| refine this.subset (λ x hx, _), simp_rw mem_Union, | ||
| have h_map_ℚ_minpoly := minpoly.gcd_domain_eq_field_fractions' ℚ hx.1, | ||
| refine ⟨_, ⟨_, λ i, _⟩, (mem_root_set_iff (minpoly.ne_zero hx.1) x).2 (minpoly.aeval ℤ x)⟩, | ||
| { rw [← (minpoly.monic hx.1).nat_degree_map (algebra_map ℤ ℚ), ← h_map_ℚ_minpoly], | ||
| exact minpoly.nat_degree_le (is_integral_of_is_scalar_tower x hx.1), }, | ||
| rw [mem_Icc, ← abs_le, ← @int.cast_le ℝ], | ||
| refine (eq.trans_le _ $ coeff_bdd_of_norm_le hx.2 i).trans (nat.le_ceil _), | ||
| rw [h_map_ℚ_minpoly, coeff_map, eq_int_cast, int.norm_cast_rat, int.norm_eq_abs, int.cast_abs], | ||
| end | ||
|  | ||
| /-- An algebraic integer whose conjugates are all of norm one is a root of unity. -/ | ||
| lemma pow_eq_one_of_norm_eq_one {x : K} | ||
| (hxi : is_integral ℤ x) (hx : ∀ φ : K →+* A, ∥φ x∥ = 1) : | ||
| (hxi : is_integral ℤ x) (hx : ∀ φ : K →+* A, ∥φ x∥ = 1) : | ||
| 
      Comment on lines
    
      105
     to 
      +106
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 
 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| ∃ (n : ℕ) (hn : 0 < n), x ^ n = 1 := | ||
| begin | ||
| obtain ⟨a, -, b, -, habne, h⟩ := @set.infinite.exists_ne_map_eq_of_maps_to _ _ _ _ | ||
| ((^) x : ℕ → K) set.infinite_univ _ (finite_of_norm_le K A (1:ℝ)), | ||
| { replace habne := habne.lt_or_lt, | ||
| wlog : a < b := habne using [a b], | ||
| refine ⟨b - a, tsub_pos_of_lt habne, _⟩, | ||
| have hxne : x ≠ 0, | ||
| { contrapose! hx, | ||
| simp only [hx, norm_zero, ring_hom.map_zero, ne.def, not_false_iff, zero_ne_one], | ||
| use (is_alg_closed.lift (number_field.is_algebraic K)).to_ring_hom, }, | ||
| { rw [pow_sub₀ _ hxne habne.le, h, mul_inv_cancel (pow_ne_zero b hxne)], }}, | ||
| { rw set.maps_univ_to, | ||
| exact λ a, ⟨hxi.pow a, λ φ, by simp [hx φ, norm_pow, one_pow]⟩, }, | ||
| have : _, swap, cases habne, swap, | ||
| { revert a b, exact this }, | ||
| { exact this b a h.symm habne }, | ||
| refine λ a b h hlt, ⟨a - b, tsub_pos_of_lt hlt, _⟩, | ||
| rw [← nat.sub_add_cancel hlt.le, pow_add, mul_left_eq_self₀] at h, | ||
| refine h.resolve_right (λ hp, _), | ||
| specialize hx (is_alg_closed.lift (number_field.is_algebraic K)).to_ring_hom, | ||
| rw [pow_eq_zero hp, map_zero, norm_zero] at hx, norm_num at hx }, | ||
| { exact λ a _, ⟨hxi.pow a, λ φ, by simp only [hx φ, norm_pow, one_pow, map_pow]⟩ }, | ||
| end | ||
|  | ||
| end bounded | ||
|  | ||
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.